From ce0eb0820af3b5a49be3e4ba3cc707364add423e Mon Sep 17 00:00:00 2001 From: Amine Date: Thu, 29 Aug 2024 01:08:06 -0700 Subject: [PATCH] Regenerate controller w/ code-gen@l3385813 and pin runtime to a606fd18 (#136) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --- apis/v1alpha1/ack-generate-metadata.yaml | 6 +++--- go.mod | 2 +- go.sum | 2 ++ helm/values.yaml | 5 ++--- pkg/resource/bucket/manager_factory.go | 6 +++++- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index 4d8df63..ce0ceda 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,8 +1,8 @@ ack_generate_info: - build_date: "2024-08-08T05:43:33Z" - build_hash: 587b90dc860e91ee9a763e9e3bc4d3f1b2fbddb7 + build_date: "2024-08-29T07:59:28Z" + build_hash: 3385813a5940f3d307e32dd11064efb490b5b5b6 go_version: go1.22.4 - version: v0.36.0 + version: v0.38.0-4-g3385813 api_directory_checksum: 82bfc8d45e816b2a02a83a4b7cedd72056accddd api_version: v1alpha1 aws_sdk_go_version: v1.44.93 diff --git a/go.mod b/go.mod index a401194..6b0e1ed 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.0 toolchain go1.22.5 require ( - github.com/aws-controllers-k8s/runtime v0.36.0 + github.com/aws-controllers-k8s/runtime v0.37.2-0.20240829063928-a606fd18ca1f github.com/aws/aws-sdk-go v1.49.0 github.com/go-logr/logr v1.4.1 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index ad1c85f..f310f3a 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/aws-controllers-k8s/runtime v0.36.0 h1:XEMVGfUwsT9QMShihuCLHlape+daJWyYtXj45s/iJiU= github.com/aws-controllers-k8s/runtime v0.36.0/go.mod h1:gI2pWb20UGLP2SnHf1a1VzTd7iVVy+/I9VAzT0Y+Dew= +github.com/aws-controllers-k8s/runtime v0.37.2-0.20240829063928-a606fd18ca1f h1:N5WNMehmiBNdthmGYlua3P0P+i6hctfGVEtPe4QHme8= +github.com/aws-controllers-k8s/runtime v0.37.2-0.20240829063928-a606fd18ca1f/go.mod h1:gI2pWb20UGLP2SnHf1a1VzTd7iVVy+/I9VAzT0Y+Dew= github.com/aws/aws-sdk-go v1.49.0 h1:g9BkW1fo9GqKfwg2+zCD+TW/D36Ux+vtfJ8guF4AYmY= github.com/aws/aws-sdk-go v1.49.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= diff --git a/helm/values.yaml b/helm/values.yaml index f295cda..bae5d62 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -157,6 +157,5 @@ leaderElection: # Configuration for feature gates. These are optional controller features that # can be individually enabled ("true") or disabled ("false") by adding key/value # pairs below. -featureGates: {} - # featureGate1: true - # featureGate2: false +featureGates: + CARMv2: false diff --git a/pkg/resource/bucket/manager_factory.go b/pkg/resource/bucket/manager_factory.go index 740343e..9b0991b 100644 --- a/pkg/resource/bucket/manager_factory.go +++ b/pkg/resource/bucket/manager_factory.go @@ -53,8 +53,12 @@ func (f *resourceManagerFactory) ManagerFor( sess *session.Session, id ackv1alpha1.AWSAccountID, region ackv1alpha1.AWSRegion, + roleARN ackv1alpha1.AWSResourceName, ) (acktypes.AWSResourceManager, error) { - rmId := fmt.Sprintf("%s/%s", id, region) + // We use the account ID, region, and role ARN to uniquely identify a + // resource manager. This helps us to avoid creating multiple resource + // managers for the same account/region/roleARN combination. + rmId := fmt.Sprintf("%s/%s/%s", id, region, roleARN) f.RLock() rm, found := f.rmCache[rmId] f.RUnlock()