From 68e13e51000a76e30b8dfe27c9c9da57e8a01f6a Mon Sep 17 00:00:00 2001 From: AWS Controllers for Kubernetes Bot <82905295+ack-bot@users.noreply.github.com> Date: Mon, 9 Sep 2024 18:38:52 -0700 Subject: [PATCH] Update to ACK runtime `v0.38.0`, code-generator `v0.38.1` (#281) ### Update to ACK runtime `v0.38.0`, code-generator `v0.38.1` ---------- * ACK code-generator `v0.38.1` [release notes](https://github.com/aws-controllers-k8s/code-generator/releases/tag/v0.38.1) * ACK runtime `v0.38.0` [release notes](https://github.com/aws-controllers-k8s/runtime/releases/tag/v0.38.0) ---------- NOTE: This PR increments the release version of service controller from `v1.2.12` to `v1.2.13` Once this PR is merged, release `v1.2.13` will be automatically created for `sagemaker-controller` **Please close this PR, if you do not want the new patch release for `sagemaker-controller`** ---------- #### stdout for `make build-controller`: ``` building ack-generate ... ok. ==== building sagemaker-controller ==== Copying common custom resource definitions into sagemaker Building Kubernetes API objects for sagemaker Generating deepcopy code for sagemaker Generating custom resource definitions for sagemaker Building service controller for sagemaker Generating RBAC manifests for sagemaker Running gofmt against generated code for sagemaker Updating additional GitHub repository maintenance files ==== building sagemaker-controller release artifacts ==== Building release artifacts for sagemaker-v1.2.13 Generating common custom resource definitions Generating custom resource definitions for sagemaker Generating RBAC manifests for sagemaker ``` ---------- 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 +++--- config/controller/kustomization.yaml | 2 +- go.mod | 2 +- go.sum | 4 ++-- helm/Chart.yaml | 4 ++-- helm/templates/NOTES.txt | 2 +- helm/values.yaml | 10 ++++++---- pkg/resource/app/manager_factory.go | 6 +++++- .../data_quality_job_definition/manager_factory.go | 6 +++++- pkg/resource/domain/manager_factory.go | 6 +++++- pkg/resource/endpoint/manager_factory.go | 6 +++++- pkg/resource/endpoint_config/manager_factory.go | 6 +++++- pkg/resource/feature_group/manager_factory.go | 6 +++++- .../hyper_parameter_tuning_job/manager_factory.go | 6 +++++- pkg/resource/inference_component/manager_factory.go | 6 +++++- pkg/resource/model/manager_factory.go | 6 +++++- .../model_bias_job_definition/manager_factory.go | 6 +++++- .../manager_factory.go | 6 +++++- pkg/resource/model_package/manager_factory.go | 6 +++++- pkg/resource/model_package_group/manager_factory.go | 6 +++++- .../model_quality_job_definition/manager_factory.go | 6 +++++- pkg/resource/monitoring_schedule/manager_factory.go | 6 +++++- pkg/resource/notebook_instance/manager_factory.go | 6 +++++- .../manager_factory.go | 6 +++++- pkg/resource/pipeline/manager_factory.go | 6 +++++- pkg/resource/pipeline_execution/manager_factory.go | 6 +++++- pkg/resource/processing_job/manager_factory.go | 6 +++++- pkg/resource/training_job/manager_factory.go | 6 +++++- pkg/resource/transform_job/manager_factory.go | 6 +++++- pkg/resource/user_profile/manager_factory.go | 6 +++++- 30 files changed, 131 insertions(+), 37 deletions(-) diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index 2ab72649..50f8c918 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-06T02:49:46Z" - build_hash: 587b90dc860e91ee9a763e9e3bc4d3f1b2fbddb7 + build_date: "2024-08-29T17:06:56Z" + build_hash: f8f98563404066ac3340db0a049d2e530e5c51cc go_version: go1.22.5 - version: v0.36.0 + version: v0.38.1 api_directory_checksum: 476c2a15949ae95e3cefcc07b7eb39de6cd7548b api_version: v1alpha1 aws_sdk_go_version: v1.50.15 diff --git a/config/controller/kustomization.yaml b/config/controller/kustomization.yaml index 01c1191f..03542421 100644 --- a/config/controller/kustomization.yaml +++ b/config/controller/kustomization.yaml @@ -6,4 +6,4 @@ kind: Kustomization images: - name: controller newName: public.ecr.aws/aws-controllers-k8s/sagemaker-controller - newTag: 1.2.12 + newTag: 1.2.13 diff --git a/go.mod b/go.mod index 337c7a3b..da0594ea 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.38.0 github.com/aws/aws-sdk-go v1.50.15 github.com/ghodss/yaml v1.0.0 github.com/go-logr/logr v1.4.1 diff --git a/go.sum b/go.sum index d964f285..57f9ea71 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -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.38.0 h1:gSEpmBm7OwTPd2kIOU+AIDIivi3teSm5FFrhROfu4wg= +github.com/aws-controllers-k8s/runtime v0.38.0/go.mod h1:gI2pWb20UGLP2SnHf1a1VzTd7iVVy+/I9VAzT0Y+Dew= github.com/aws/aws-sdk-go v1.50.15 h1:wEMnPfEQQFaoIJwuO18zq/vtG4Ft7NxQ3r9xlEi/8zg= github.com/aws/aws-sdk-go v1.50.15/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 337ad6f5..999396e9 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 name: sagemaker-chart description: A Helm chart for the ACK service controller for Amazon SageMaker (SageMaker) -version: 1.2.12 -appVersion: 1.2.12 +version: 1.2.13 +appVersion: 1.2.13 home: https://github.com/aws-controllers-k8s/sagemaker-controller icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png sources: diff --git a/helm/templates/NOTES.txt b/helm/templates/NOTES.txt index 47cac47a..9dee2a86 100644 --- a/helm/templates/NOTES.txt +++ b/helm/templates/NOTES.txt @@ -1,5 +1,5 @@ {{ .Chart.Name }} has been installed. -This chart deploys "public.ecr.aws/aws-controllers-k8s/sagemaker-controller:1.2.12". +This chart deploys "public.ecr.aws/aws-controllers-k8s/sagemaker-controller:1.2.13". Check its status by running: kubectl --namespace {{ .Release.Namespace }} get pods -l "app.kubernetes.io/instance={{ .Release.Name }}" diff --git a/helm/values.yaml b/helm/values.yaml index 4b1518bc..222a733f 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -4,7 +4,7 @@ image: repository: public.ecr.aws/aws-controllers-k8s/sagemaker-controller - tag: 1.2.12 + tag: 1.2.13 pullPolicy: IfNotPresent pullSecrets: [] @@ -157,6 +157,8 @@ 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: + # Enables the Service level granularity for CARM. See https://github.com/aws-controllers-k8s/community/issues/2031 + ServiceLevelCARM: false + # Enables the Team level granularity for CARM. See https://github.com/aws-controllers-k8s/community/issues/2031 + TeamLevelCARM: false diff --git a/pkg/resource/app/manager_factory.go b/pkg/resource/app/manager_factory.go index d02a8a88..2f2c7a70 100644 --- a/pkg/resource/app/manager_factory.go +++ b/pkg/resource/app/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() diff --git a/pkg/resource/data_quality_job_definition/manager_factory.go b/pkg/resource/data_quality_job_definition/manager_factory.go index 966d3f6e..b9b9ef29 100644 --- a/pkg/resource/data_quality_job_definition/manager_factory.go +++ b/pkg/resource/data_quality_job_definition/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() diff --git a/pkg/resource/domain/manager_factory.go b/pkg/resource/domain/manager_factory.go index e7b9dcbd..5ce3764b 100644 --- a/pkg/resource/domain/manager_factory.go +++ b/pkg/resource/domain/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() diff --git a/pkg/resource/endpoint/manager_factory.go b/pkg/resource/endpoint/manager_factory.go index cf714460..2624e3eb 100644 --- a/pkg/resource/endpoint/manager_factory.go +++ b/pkg/resource/endpoint/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() diff --git a/pkg/resource/endpoint_config/manager_factory.go b/pkg/resource/endpoint_config/manager_factory.go index b97ffa1e..e516bb8d 100644 --- a/pkg/resource/endpoint_config/manager_factory.go +++ b/pkg/resource/endpoint_config/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() diff --git a/pkg/resource/feature_group/manager_factory.go b/pkg/resource/feature_group/manager_factory.go index ad88fc2f..0b54baa3 100644 --- a/pkg/resource/feature_group/manager_factory.go +++ b/pkg/resource/feature_group/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() diff --git a/pkg/resource/hyper_parameter_tuning_job/manager_factory.go b/pkg/resource/hyper_parameter_tuning_job/manager_factory.go index b258d549..4482e785 100644 --- a/pkg/resource/hyper_parameter_tuning_job/manager_factory.go +++ b/pkg/resource/hyper_parameter_tuning_job/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() diff --git a/pkg/resource/inference_component/manager_factory.go b/pkg/resource/inference_component/manager_factory.go index 0163c105..ec424b0b 100644 --- a/pkg/resource/inference_component/manager_factory.go +++ b/pkg/resource/inference_component/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() diff --git a/pkg/resource/model/manager_factory.go b/pkg/resource/model/manager_factory.go index 7f365d79..d216c025 100644 --- a/pkg/resource/model/manager_factory.go +++ b/pkg/resource/model/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() diff --git a/pkg/resource/model_bias_job_definition/manager_factory.go b/pkg/resource/model_bias_job_definition/manager_factory.go index 348fcefe..0fccb478 100644 --- a/pkg/resource/model_bias_job_definition/manager_factory.go +++ b/pkg/resource/model_bias_job_definition/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() diff --git a/pkg/resource/model_explainability_job_definition/manager_factory.go b/pkg/resource/model_explainability_job_definition/manager_factory.go index fb45a7fb..d9e53542 100644 --- a/pkg/resource/model_explainability_job_definition/manager_factory.go +++ b/pkg/resource/model_explainability_job_definition/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() diff --git a/pkg/resource/model_package/manager_factory.go b/pkg/resource/model_package/manager_factory.go index a5e3610f..cf72a495 100644 --- a/pkg/resource/model_package/manager_factory.go +++ b/pkg/resource/model_package/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() diff --git a/pkg/resource/model_package_group/manager_factory.go b/pkg/resource/model_package_group/manager_factory.go index 89c38fb2..76ef9b02 100644 --- a/pkg/resource/model_package_group/manager_factory.go +++ b/pkg/resource/model_package_group/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() diff --git a/pkg/resource/model_quality_job_definition/manager_factory.go b/pkg/resource/model_quality_job_definition/manager_factory.go index 9505f999..6bd5542a 100644 --- a/pkg/resource/model_quality_job_definition/manager_factory.go +++ b/pkg/resource/model_quality_job_definition/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() diff --git a/pkg/resource/monitoring_schedule/manager_factory.go b/pkg/resource/monitoring_schedule/manager_factory.go index 9c496274..0e4cccd0 100644 --- a/pkg/resource/monitoring_schedule/manager_factory.go +++ b/pkg/resource/monitoring_schedule/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() diff --git a/pkg/resource/notebook_instance/manager_factory.go b/pkg/resource/notebook_instance/manager_factory.go index 124425b8..27762686 100644 --- a/pkg/resource/notebook_instance/manager_factory.go +++ b/pkg/resource/notebook_instance/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() diff --git a/pkg/resource/notebook_instance_lifecycle_config/manager_factory.go b/pkg/resource/notebook_instance_lifecycle_config/manager_factory.go index 79b88c96..0ae66a0d 100644 --- a/pkg/resource/notebook_instance_lifecycle_config/manager_factory.go +++ b/pkg/resource/notebook_instance_lifecycle_config/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() diff --git a/pkg/resource/pipeline/manager_factory.go b/pkg/resource/pipeline/manager_factory.go index 764071f8..ca0ffba5 100644 --- a/pkg/resource/pipeline/manager_factory.go +++ b/pkg/resource/pipeline/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() diff --git a/pkg/resource/pipeline_execution/manager_factory.go b/pkg/resource/pipeline_execution/manager_factory.go index 2cbd90ea..6ca8a206 100644 --- a/pkg/resource/pipeline_execution/manager_factory.go +++ b/pkg/resource/pipeline_execution/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() diff --git a/pkg/resource/processing_job/manager_factory.go b/pkg/resource/processing_job/manager_factory.go index 0d1468c0..a94c274a 100644 --- a/pkg/resource/processing_job/manager_factory.go +++ b/pkg/resource/processing_job/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() diff --git a/pkg/resource/training_job/manager_factory.go b/pkg/resource/training_job/manager_factory.go index ca5ef941..c1886d0d 100644 --- a/pkg/resource/training_job/manager_factory.go +++ b/pkg/resource/training_job/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() diff --git a/pkg/resource/transform_job/manager_factory.go b/pkg/resource/transform_job/manager_factory.go index 83a7421f..1599aee1 100644 --- a/pkg/resource/transform_job/manager_factory.go +++ b/pkg/resource/transform_job/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() diff --git a/pkg/resource/user_profile/manager_factory.go b/pkg/resource/user_profile/manager_factory.go index 301c5d46..267fdc5f 100644 --- a/pkg/resource/user_profile/manager_factory.go +++ b/pkg/resource/user_profile/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()