Skip to content

Commit c1dba71

Browse files
committed
Add Table tags update support
Issue: aws-controllers-k8s/community#1029 This patch adds hooks and delta helpers to properly update Table tags. Description of changes: - Drop the generate updateTable function and use a custom one - Add hooks to properly compute the tags delta and make necessary API calls to update them - Add e2e tests for table tag updates
1 parent c66c402 commit c1dba71

15 files changed

+524
-472
lines changed
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2021-10-27T21:04:06Z"
3-
build_hash: d2b063806d25cfcae4f2d4eb44f8e3f713b23e8e
4-
go_version: go1.15
2+
build_date: "2021-12-22T13:40:06Z"
3+
build_hash: 6f17f51682dc0d16c36aa456fd22855ce9282fbc
4+
go_version: go1.16.4
55
version: v0.15.2
66
api_directory_checksum: c1d144a18336326f141e97e6800b47f64ed992cc
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.38.47
99
generator_config_info:
10-
file_checksum: 3d4ab94742ecf92212b94a5e47bdda8258589718
10+
file_checksum: 2c5f9585b1b0356e601e17efc7f5c47bdabdf4ab
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ operations:
77
primary_identifier_field_name: BackupArn
88
resources:
99
Table:
10+
fields:
11+
Tags:
12+
compare:
13+
is_ignored: true
1014
exceptions:
1115
errors:
1216
404:
@@ -15,11 +19,13 @@ resources:
1519
- InternalServerError
1620
- LimitExceededException
1721
- ResourceInUseException
22+
update_operation:
23+
custom_method_name: customUpdateTable
1824
hooks:
25+
delta_pre_compare:
26+
code: customPreCompare(delta, a, b)
1927
sdk_read_one_post_set_output:
2028
template_path: hooks/table/sdk_read_one_post_set_output.go.tpl
21-
sdk_update_pre_build_request:
22-
template_path: hooks/table/sdk_update_pre_build_request.go.tpl
2329
sdk_delete_pre_build_request:
2430
template_path: hooks/table/sdk_delete_pre_build_request.go.tpl
2531
GlobalTable:

generator.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ operations:
77
primary_identifier_field_name: BackupArn
88
resources:
99
Table:
10+
fields:
11+
Tags:
12+
compare:
13+
is_ignored: true
1014
exceptions:
1115
errors:
1216
404:
@@ -15,11 +19,13 @@ resources:
1519
- InternalServerError
1620
- LimitExceededException
1721
- ResourceInUseException
22+
update_operation:
23+
custom_method_name: customUpdateTable
1824
hooks:
25+
delta_pre_compare:
26+
code: customPreCompare(delta, a, b)
1927
sdk_read_one_post_set_output:
2028
template_path: hooks/table/sdk_read_one_post_set_output.go.tpl
21-
sdk_update_pre_build_request:
22-
template_path: hooks/table/sdk_update_pre_build_request.go.tpl
2329
sdk_delete_pre_build_request:
2430
template_path: hooks/table/sdk_delete_pre_build_request.go.tpl
2531
GlobalTable:

helm/templates/deployment.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,12 @@ spec:
7575
value: {{ join "," .Values.resourceTags | quote }}
7676
terminationGracePeriodSeconds: 10
7777
nodeSelector: {{ toYaml .Values.deployment.nodeSelector | nindent 8 }}
78+
{{ if .Values.deployment.tolerations -}}
79+
tolerations: {{ toYaml .Values.deployment.tolerations | nindent 8 }}
80+
{{ end -}}
81+
{{ if .Values.deployment.affinity -}}
82+
affinity: {{ toYaml .Values.deployment.affinity | nindent 8 }}
83+
{{ end -}}
84+
{{ if .Values.deployment.priorityClassName -}}
85+
priorityClassName: {{ .Values.deployment.priorityClassName -}}
86+
{{ end -}}

helm/values.yaml

+12-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,20 @@ deployment:
1515
annotations: {}
1616
labels: {}
1717
containerPort: 8080
18+
# Which nodeSelector to set?
19+
# See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
1820
nodeSelector:
1921
kubernetes.io/os: linux
20-
22+
# Which tolerations to set?
23+
# See: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
24+
tolerations: {}
25+
# What affinity to set?
26+
# See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
27+
affinity: {}
28+
# Which priorityClassName to set?
29+
# See: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority
30+
priorityClassName:
31+
2132
metrics:
2233
service:
2334
# Set to true to automatically create a Kubernetes Service resource for the

pkg/resource/backup/sdk.go

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/resource/table/delta.go

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)