Skip to content

Commit 3781202

Browse files
authored
Add PopulateResourceFromAnnotation hook and adoption logic (#55)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 4312db6 commit 3781202

File tree

13 files changed

+78
-23
lines changed

13 files changed

+78
-23
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2024-10-10T03:57:16Z"
3-
build_hash: 36c2d234498c2bc4f60773ab8df632af4067f43b
2+
build_date: "2024-12-04T23:34:21Z"
3+
build_hash: 5b95c1667a03835266df2d3f598718dd164184af
44
go_version: go1.23.2
5-
version: v0.39.1
5+
version: v0.39.1-8-g5b95c16
66
api_directory_checksum: 78fb7fd24a85da24b8de6246cad67ff3fb6598f8
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.49.0
99
generator_config_info:
10-
file_checksum: 3a694e7177f90f7ba4c526b14e1ce2b1e9748446
10+
file_checksum: 139425ad105085ed1a9f4f113c780f37b31ccd1d
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ resources:
141141
template_path: hooks/record_set/sdk_read_many_post_set_output.go.tpl
142142
post_set_resource_identifiers:
143143
template_path: hooks/record_set/post_set_resource_identifiers.go.tpl
144+
post_populate_resource_from_annotation:
145+
template_path: hooks/record_set/post_populate_resource_from_annotation.go.tpl
144146
list_operation:
145147
match_fields:
146148
- HostedZoneId

config/controller/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ spec:
4141
- "$(LEADER_ELECTION_NAMESPACE)"
4242
- --reconcile-default-max-concurrent-syncs
4343
- "$(RECONCILE_DEFAULT_MAX_CONCURRENT_SYNCS)"
44+
- --feature-gates
45+
- "$(FEATURE_GATES)"
4446
image: controller:latest
4547
name: controller
4648
ports:
@@ -76,6 +78,8 @@ spec:
7678
value: "ack-system"
7779
- name: "RECONCILE_DEFAULT_MAX_CONCURRENT_SYNCS"
7880
value: "1"
81+
- name: "FEATURE_GATES"
82+
value: ""
7983
securityContext:
8084
allowPrivilegeEscalation: false
8185
privileged: false

generator.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ resources:
141141
template_path: hooks/record_set/sdk_read_many_post_set_output.go.tpl
142142
post_set_resource_identifiers:
143143
template_path: hooks/record_set/post_set_resource_identifiers.go.tpl
144+
post_populate_resource_from_annotation:
145+
template_path: hooks/record_set/post_populate_resource_from_annotation.go.tpl
144146
list_operation:
145147
match_fields:
146148
- HostedZoneId

helm/templates/caches-role-binding.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ roleRef:
88
name: ack-namespaces-cache-route53-controller
99
subjects:
1010
- kind: ServiceAccount
11-
name: ack-route53-controller
11+
name: {{ include "ack-route53-controller.service-account.name" . }}
1212
namespace: {{ .Release.Namespace }}
1313
---
1414
apiVersion: rbac.authorization.k8s.io/v1
@@ -22,5 +22,5 @@ roleRef:
2222
name: ack-configmaps-cache-route53-controller
2323
subjects:
2424
- kind: ServiceAccount
25-
name: ack-route53-controller
26-
namespace: {{ .Release.Namespace }}
25+
name: {{ include "ack-route53-controller.service-account.name" . }}
26+
namespace: {{ .Release.Namespace }}

helm/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,6 @@ featureGates:
163163
# Enables the Team level granularity for CARM. See https://github.com/aws-controllers-k8s/community/issues/2031
164164
TeamLevelCARM: false
165165
# Enable ReadOnlyResources feature/annotation.
166-
ReadOnlyResources: false
166+
ReadOnlyResources: false
167+
# Enable ResourceAdoption feature/annotation.
168+
ResourceAdoption: false

pkg/resource/health_check/descriptor.go

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

pkg/resource/health_check/resource.go

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

pkg/resource/hosted_zone/descriptor.go

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

pkg/resource/hosted_zone/resource.go

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

0 commit comments

Comments
 (0)