Skip to content

Commit 8b90acd

Browse files
authored
Add Adoption by annotation logic, and test eks cluster (#139)
Description: This PR also adds PopulateResourceFromAnnotation hook for the IdentityProviderConfig resource By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 7c92b1e commit 8b90acd

27 files changed

+256
-47
lines changed
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2024-10-21T22:52:48Z"
3-
build_hash: ab15f9206796e9660c51695fab0ff07a09ea28e2
2+
build_date: "2024-12-04T18:42:10Z"
3+
build_hash: 5b95c1667a03835266df2d3f598718dd164184af
44
go_version: go1.23.2
5-
version: v0.39.1-2-gab15f92
5+
version: v0.39.1-8-g5b95c16
66
api_directory_checksum: 4cfe0b6ec81b65719c1f165983b84116135f5e40
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.55.5
99
generator_config_info:
10-
file_checksum: 6c1343508adb97d2a4ff6f8328b2668356317b3b
10+
file_checksum: 687d1b51c5afe75b62b50c3c32c83d7e6cadc3e3
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ resources:
147147
template_path: hooks/identity_provider_config/sdk_read_one_post_set_output.go.tpl
148148
post_set_resource_identifiers:
149149
template_path: hooks/identity_provider_config/post_set_resource_identifiers.go.tpl
150+
post_populate_resource_from_annotation:
151+
template_path: hooks/identity_provider_config/post_populate_resource_from_annotation.go.tpl
150152
update_operation:
151153
custom_method_name: customUpdate
152154
Cluster:

config/controller/deployment.yaml

+4
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

+2
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ resources:
147147
template_path: hooks/identity_provider_config/sdk_read_one_post_set_output.go.tpl
148148
post_set_resource_identifiers:
149149
template_path: hooks/identity_provider_config/post_set_resource_identifiers.go.tpl
150+
post_populate_resource_from_annotation:
151+
template_path: hooks/identity_provider_config/post_populate_resource_from_annotation.go.tpl
150152
update_operation:
151153
custom_method_name: customUpdate
152154
Cluster:

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ require (
88
github.com/aws-controllers-k8s/ec2-controller v1.1.0
99
github.com/aws-controllers-k8s/iam-controller v1.3.1
1010
github.com/aws-controllers-k8s/kms-controller v1.0.9
11-
github.com/aws-controllers-k8s/runtime v0.39.0
12-
github.com/go-logr/logr v1.4.2
11+
github.com/aws-controllers-k8s/runtime v0.39.1-0.20241202082353-a6b0014a8130
1312
github.com/aws/aws-sdk-go v1.55.5
13+
github.com/go-logr/logr v1.4.2
1414
github.com/spf13/pflag v1.0.5
1515
github.com/stretchr/testify v1.9.0
1616
k8s.io/api v0.31.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ github.com/aws-controllers-k8s/iam-controller v1.3.1 h1:/3yH3tAtSVAAt2ulIqsmutjW
44
github.com/aws-controllers-k8s/iam-controller v1.3.1/go.mod h1:7nZzMtEN8xEL5fYhL9FKkBhqoP4QMmMp5x5dXDGwfYM=
55
github.com/aws-controllers-k8s/kms-controller v1.0.9 h1:GZHSnuZBoWp9r6RaJ3siyDn5BRhDuaZJXtdBKeAiLSw=
66
github.com/aws-controllers-k8s/kms-controller v1.0.9/go.mod h1:Pnz0d5sly7dUgmYMDJWSRIKASOujJFi/b8N2q1qCLqU=
7-
github.com/aws-controllers-k8s/runtime v0.39.0 h1:IgOXluSzvb4UcDr9eU7SPw5MJnL7kt5R6DuF5Qu9zVQ=
8-
github.com/aws-controllers-k8s/runtime v0.39.0/go.mod h1:G07g26y1cxyZO6Ngp+LwXf03CqFyLNL7os4Py4IdyGY=
7+
github.com/aws-controllers-k8s/runtime v0.39.1-0.20241202082353-a6b0014a8130 h1:EoXYRrpBX2hi5B1IawKr2LJTsVsreHsJdxULLlMNO9U=
8+
github.com/aws-controllers-k8s/runtime v0.39.1-0.20241202082353-a6b0014a8130/go.mod h1:G07g26y1cxyZO6Ngp+LwXf03CqFyLNL7os4Py4IdyGY=
99
github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
1010
github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
1111
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=

helm/templates/caches-role-binding.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ roleRef:
88
name: ack-namespaces-cache-eks-controller
99
subjects:
1010
- kind: ServiceAccount
11-
name: ack-eks-controller
11+
name: {{ include "ack-eks-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-eks-controller
2323
subjects:
2424
- kind: ServiceAccount
25-
name: ack-eks-controller
26-
namespace: {{ .Release.Namespace }}
25+
name: {{ include "ack-eks-controller.service-account.name" . }}
26+
namespace: {{ .Release.Namespace }}

helm/values.yaml

+3-1
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/access_entry/descriptor.go

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

pkg/resource/access_entry/resource.go

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

pkg/resource/addon/descriptor.go

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

pkg/resource/addon/resource.go

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

pkg/resource/cluster/descriptor.go

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

pkg/resource/cluster/resource.go

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

pkg/resource/fargate_profile/descriptor.go

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

pkg/resource/fargate_profile/resource.go

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

pkg/resource/identity_provider_config/descriptor.go

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

0 commit comments

Comments
 (0)