Skip to content

Commit 1dad631

Browse files
authored
Add tags for HostedZone (#26)
Issue (aws-controllers-k8s/community#1554) Description of changes: Adds support of tags in HostedZone spec By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. I
1 parent e4d7115 commit 1dad631

25 files changed

+710
-21
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2023-05-15T23:45:27Z"
3-
build_hash: 8f3ba427974fd6e769926778d54834eaee3b81a3
4-
go_version: go1.19
5-
version: v0.26.1
6-
api_directory_checksum: e2bcdcfd015dd5528e4df8745ede3ffccfd4e683
2+
build_date: "2023-07-17T18:30:35Z"
3+
build_hash: e9b68590da73ce9143ba1e4361cebdc1d876c81e
4+
go_version: go1.20.3
5+
version: v0.26.1-7-ge9b6859
6+
api_directory_checksum: 2f681761d3417cd3c65709b6dc71d9853bdf0481
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93
99
generator_config_info:
10-
file_checksum: 554ef2519945f32ea8788a1add7a3c496c944d88
10+
file_checksum: e4f89494b4e355fb756095b55c95050a23efa0b3
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,28 @@ resources:
3030
- InvalidDomainName
3131
- InvalidInput
3232
- InvalidVPCId
33+
fields:
34+
Tags:
35+
from:
36+
operation: ChangeTagsForResource
37+
path: AddTags
38+
compare:
39+
is_ignored: True
3340
hooks:
41+
delta_pre_compare:
42+
code: compareTags(delta, a, b)
43+
sdk_read_one_post_set_output:
44+
template_path: hooks/hosted_zone/sdk_read_one_post_set_output.go.tpl
45+
sdk_create_post_set_output:
46+
template_path: hooks/hosted_zone/sdk_create_post_set_output.go.tpl
3447
sdk_create_post_build_request:
3548
template_path: hooks/hosted_zone/sdk_create_post_build_request.go.tpl
49+
sdk_file_end:
50+
template_path: hooks/hosted_zone/sdk_file_end.go.tpl
51+
ensure_tags:
52+
template_path: hooks/hosted_zone/sdk_ensure_tags.go.tpl
53+
3654
tags:
3755
ignore: true
56+
update_operation:
57+
custom_method_name: customUpdateHostedZone

apis/v1alpha1/hosted_zone.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/types.go

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/zz_generated.deepcopy.go

Lines changed: 62 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/route53.services.k8s.aws_hostedzones.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,22 @@ spec:
6767
your domain to the set of NameServers that CreateHostedZone returns
6868
in DelegationSet."
6969
type: string
70+
tags:
71+
description: "A complex type that contains a list of the tags that
72+
you want to add to the specified health check or hosted zone and/or
73+
the tags that you want to edit Value for. \n You can add a maximum
74+
of 10 tags to a health check or a hosted zone."
75+
items:
76+
description: A complex type that contains information about a tag
77+
that you want to add or edit for the specified health check or
78+
hosted zone.
79+
properties:
80+
key:
81+
type: string
82+
value:
83+
type: string
84+
type: object
85+
type: array
7086
vpc:
7187
description: "(Private hosted zones only) A complex type that contains
7288
information about the Amazon VPC that you're associating with this

generator.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,28 @@ resources:
3030
- InvalidDomainName
3131
- InvalidInput
3232
- InvalidVPCId
33+
fields:
34+
Tags:
35+
from:
36+
operation: ChangeTagsForResource
37+
path: AddTags
38+
compare:
39+
is_ignored: True
3340
hooks:
41+
delta_pre_compare:
42+
code: compareTags(delta, a, b)
43+
sdk_read_one_post_set_output:
44+
template_path: hooks/hosted_zone/sdk_read_one_post_set_output.go.tpl
45+
sdk_create_post_set_output:
46+
template_path: hooks/hosted_zone/sdk_create_post_set_output.go.tpl
3447
sdk_create_post_build_request:
3548
template_path: hooks/hosted_zone/sdk_create_post_build_request.go.tpl
49+
sdk_file_end:
50+
template_path: hooks/hosted_zone/sdk_file_end.go.tpl
51+
ensure_tags:
52+
template_path: hooks/hosted_zone/sdk_ensure_tags.go.tpl
53+
3654
tags:
3755
ignore: true
56+
update_operation:
57+
custom_method_name: customUpdateHostedZone

helm/crds/route53.services.k8s.aws_hostedzones.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,22 @@ spec:
6767
your domain to the set of NameServers that CreateHostedZone returns
6868
in DelegationSet."
6969
type: string
70+
tags:
71+
description: "A complex type that contains a list of the tags that
72+
you want to add to the specified health check or hosted zone and/or
73+
the tags that you want to edit Value for. \n You can add a maximum
74+
of 10 tags to a health check or a hosted zone."
75+
items:
76+
description: A complex type that contains information about a tag
77+
that you want to add or edit for the specified health check or
78+
hosted zone.
79+
properties:
80+
key:
81+
type: string
82+
value:
83+
type: string
84+
type: object
85+
type: array
7086
vpc:
7187
description: "(Private hosted zones only) A complex type that contains
7288
information about the Amazon VPC that you're associating with this

helm/templates/deployment.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ spec:
1818
app.kubernetes.io/instance: {{ .Release.Name }}
1919
template:
2020
metadata:
21+
{{- if .Values.deployment.annotations }}
2122
annotations:
2223
{{- range $key, $value := .Values.deployment.annotations }}
2324
{{ $key }}: {{ $value | quote }}
2425
{{- end }}
26+
{{- end }}
2527
labels:
2628
app.kubernetes.io/name: {{ include "app.name" . }}
2729
app.kubernetes.io/instance: {{ .Release.Name }}
@@ -104,11 +106,19 @@ spec:
104106
value: {{ include "aws.credentials.path" . }}
105107
- name: AWS_PROFILE
106108
value: {{ .Values.aws.credentials.profile }}
109+
{{- end }}
110+
{{- if .Values.deployment.extraEnvVars -}}
111+
{{ toYaml .Values.deployment.extraEnvVars | nindent 8 }}
112+
{{- end }}
107113
volumeMounts:
114+
{{- if .Values.aws.credentials.secretName }}
108115
- name: {{ .Values.aws.credentials.secretName }}
109116
mountPath: {{ include "aws.credentials.secret_mount_path" . }}
110117
readOnly: true
111118
{{- end }}
119+
{{- if .Values.deployment.extraVolumeMounts -}}
120+
{{ toYaml .Values.deployment.extraVolumeMounts | nindent 12 }}
121+
{{- end }}
112122
securityContext:
113123
allowPrivilegeEscalation: false
114124
privileged: false
@@ -133,9 +143,12 @@ spec:
133143
hostIPC: false
134144
hostNetwork: false
135145
hostPID: false
136-
{{ if .Values.aws.credentials.secretName -}}
137146
volumes:
147+
{{- if .Values.aws.credentials.secretName -}}
138148
- name: {{ .Values.aws.credentials.secretName }}
139149
secret:
140150
secretName: {{ .Values.aws.credentials.secretName }}
141151
{{ end -}}
152+
{{- if .Values.deployment.extraVolumes }}
153+
{{ toYaml .Values.deployment.extraVolumes | indent 8}}
154+
{{- end }}

helm/values.schema.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@
5858
},
5959
"priorityClassName": {
6060
"type": "string"
61+
},
62+
"extraVolumeMounts": {
63+
"type": "array"
64+
},
65+
"extraVolumes": {
66+
"type": "array"
67+
},
68+
"extraEnvVars": {
69+
"type": "array"
6170
}
6271
},
6372
"required": [

0 commit comments

Comments
 (0)