Skip to content

Commit e03df45

Browse files
authored
Add adoption by annotation logic & tests (#232)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent a712365 commit e03df45

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+497
-85
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-22T13:52:25Z"
3-
build_hash: 36c2d234498c2bc4f60773ab8df632af4067f43b
2+
build_date: "2024-12-04T16:46:43Z"
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: 585098fc7c99c27ca523f83e860107d22aaa5a10
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93
99
generator_config_info:
10-
file_checksum: 2c5ef491ef62c9347bcb87918f715692adf727bc
10+
file_checksum: 4a977c2334f44fd0ea8d09dd6afe759cd7459eb1
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
@@ -351,6 +351,8 @@ resources:
351351
template_path: hooks/flow_log/sdk_file_end.go.tpl
352352
post_set_resource_identifiers:
353353
template_path: hooks/flow_log/post_set_resource_identifiers.go.tpl
354+
post_populate_resource_from_annotation:
355+
template_path: hooks/flow_log/post_populate_resource_from_annotation.go.tpl
354356
update_operation:
355357
custom_method_name: customUpdateFlowLog
356358
InternetGateway:

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
@@ -351,6 +351,8 @@ resources:
351351
template_path: hooks/flow_log/sdk_file_end.go.tpl
352352
post_set_resource_identifiers:
353353
template_path: hooks/flow_log/post_set_resource_identifiers.go.tpl
354+
post_populate_resource_from_annotation:
355+
template_path: hooks/flow_log/post_populate_resource_from_annotation.go.tpl
354356
update_operation:
355357
custom_method_name: customUpdateFlowLog
356358
InternetGateway:

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.22.0
55
toolchain go1.22.6
66

77
require (
8-
github.com/aws-controllers-k8s/runtime v0.39.0
8+
github.com/aws-controllers-k8s/runtime v0.39.1-0.20241202082353-a6b0014a8130
99
github.com/aws/aws-sdk-go v1.49.0
1010
github.com/go-logr/logr v1.4.2
1111
github.com/samber/lo v1.37.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
github.com/aws-controllers-k8s/runtime v0.39.0 h1:IgOXluSzvb4UcDr9eU7SPw5MJnL7kt5R6DuF5Qu9zVQ=
22
github.com/aws-controllers-k8s/runtime v0.39.0/go.mod h1:G07g26y1cxyZO6Ngp+LwXf03CqFyLNL7os4Py4IdyGY=
3+
github.com/aws-controllers-k8s/runtime v0.39.1-0.20241202082353-a6b0014a8130 h1:EoXYRrpBX2hi5B1IawKr2LJTsVsreHsJdxULLlMNO9U=
4+
github.com/aws-controllers-k8s/runtime v0.39.1-0.20241202082353-a6b0014a8130/go.mod h1:G07g26y1cxyZO6Ngp+LwXf03CqFyLNL7os4Py4IdyGY=
35
github.com/aws/aws-sdk-go v1.49.0 h1:g9BkW1fo9GqKfwg2+zCD+TW/D36Ux+vtfJ8guF4AYmY=
46
github.com/aws/aws-sdk-go v1.49.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
57
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=

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-ec2-controller
99
subjects:
1010
- kind: ServiceAccount
11-
name: ack-ec2-controller
11+
name: {{ include "ack-ec2-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-ec2-controller
2323
subjects:
2424
- kind: ServiceAccount
25-
name: ack-ec2-controller
26-
namespace: {{ .Release.Namespace }}
25+
name: {{ include "ack-ec2-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/dhcp_options/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/dhcp_options/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)