Skip to content

Commit dbbf635

Browse files
authored
Add Adoption by annotation tests (#139)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent b1893a4 commit dbbf635

File tree

12 files changed

+144
-14
lines changed

12 files changed

+144
-14
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ack_generate_info:
2-
build_date: "2024-10-10T04:12:55Z"
3-
build_hash: 36c2d234498c2bc4f60773ab8df632af4067f43b
2+
build_date: "2024-12-02T23:36:35Z"
3+
build_hash: ce8a66e1fd3d15afacc33069bb788795863a4245
44
go_version: go1.23.2
5-
version: v0.39.1
5+
version: v0.39.1-6-gce8a66e
66
api_directory_checksum: 82bfc8d45e816b2a02a83a4b7cedd72056accddd
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93

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

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.5
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/pkg/errors v0.9.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/aws-controllers-k8s/runtime v0.39.0 h1:IgOXluSzvb4UcDr9eU7SPw5MJnL7kt5R6DuF5Qu9zVQ=
2-
github.com/aws-controllers-k8s/runtime v0.39.0/go.mod h1:G07g26y1cxyZO6Ngp+LwXf03CqFyLNL7os4Py4IdyGY=
1+
github.com/aws-controllers-k8s/runtime v0.39.1-0.20241202082353-a6b0014a8130 h1:EoXYRrpBX2hi5B1IawKr2LJTsVsreHsJdxULLlMNO9U=
2+
github.com/aws-controllers-k8s/runtime v0.39.1-0.20241202082353-a6b0014a8130/go.mod h1:G07g26y1cxyZO6Ngp+LwXf03CqFyLNL7os4Py4IdyGY=
33
github.com/aws/aws-sdk-go v1.49.0 h1:g9BkW1fo9GqKfwg2+zCD+TW/D36Ux+vtfJ8guF4AYmY=
44
github.com/aws/aws-sdk-go v1.49.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
55
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-s3-controller
99
subjects:
1010
- kind: ServiceAccount
11-
name: ack-s3-controller
11+
name: {{ include "ack-s3-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-s3-controller
2323
subjects:
2424
- kind: ServiceAccount
25-
name: ack-s3-controller
26-
namespace: {{ .Release.Namespace }}
25+
name: {{ include "ack-s3-controller.service-account.name" . }}
26+
namespace: {{ .Release.Namespace }}

pkg/resource/bucket/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/bucket/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.

test/e2e/bootstrap_resources.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
@dataclass
2626
class BootstrapResources(Resources):
2727
ReplicationBucket: Bucket
28+
AdoptionBucket: Bucket
2829
ReplicationRole: Role
2930
NotificationTopic: Topic
3031

test/e2e/replacement_values.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
REPLACEMENT_VALUES = {
2020
"REPLICATION_ROLE_ARN": get_bootstrap_resources().ReplicationRole.arn,
21+
"ADOPTION_BUCKET_NAME": get_bootstrap_resources().AdoptionBucket.name,
2122
"REPLICATION_BUCKET_NAME": get_bootstrap_resources().ReplicationBucket.name,
2223
"NOTIFICATION_TOPIC_ARN": get_bootstrap_resources().NotificationTopic.arn,
2324
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: s3.services.k8s.aws/v1alpha1
2+
kind: Bucket
3+
metadata:
4+
name: $ADOPTION_BUCKET_NAME
5+
annotations:
6+
services.k8s.aws/adoption-policy: $ADOPTION_POLICY
7+
services.k8s.aws/adoption-fields: "$ADOPTION_FIELDS"
8+
services.k8s.aws/deletion-policy: retain

0 commit comments

Comments
 (0)