From 50521c1c419562b40079a6ea03ae106e54c71c30 Mon Sep 17 00:00:00 2001 From: AWS Controllers for Kubernetes Bot <82905295+ack-bot@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:24:41 -0700 Subject: [PATCH] Update to ACK runtime `v0.38.0`, code-generator `v0.38.1` (#84) ### 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 `v0.0.35` to `v0.0.36` Once this PR is merged, release `v0.0.36` will be automatically created for `mq-controller` **Please close this PR, if you do not want the new patch release for `mq-controller`** ---------- #### stdout for `make build-controller`: ``` building ack-generate ... ok. ==== building mq-controller ==== Copying common custom resource definitions into mq Building Kubernetes API objects for mq Generating deepcopy code for mq Generating custom resource definitions for mq Building service controller for mq Generating RBAC manifests for mq Running gofmt against generated code for mq Updating additional GitHub repository maintenance files ==== building mq-controller release artifacts ==== Building release artifacts for mq-v0.0.36 Generating common custom resource definitions Generating custom resource definitions for mq Generating RBAC manifests for mq ``` ---------- 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/broker/manager_factory.go | 6 +++++- pkg/resource/broker/references.go | 26 +++++++++++++++--------- 9 files changed, 37 insertions(+), 25 deletions(-) diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index 6e9ad74..6ee2cde 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:38:33Z" - build_hash: 587b90dc860e91ee9a763e9e3bc4d3f1b2fbddb7 + build_date: "2024-08-29T17:10:15Z" + build_hash: f8f98563404066ac3340db0a049d2e530e5c51cc go_version: go1.22.5 - version: v0.36.0 + version: v0.38.1 api_directory_checksum: 2be594918c4fa03c742bb5d656f8b097cbc7f4c5 api_version: v1alpha1 aws_sdk_go_version: v1.44.93 diff --git a/config/controller/kustomization.yaml b/config/controller/kustomization.yaml index 8b35a2a..f122960 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/mq-controller - newTag: 0.0.35 + newTag: 0.0.36 diff --git a/go.mod b/go.mod index 86ec79d..3fc485b 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.5 require ( github.com/aws-controllers-k8s/ec2-controller v0.0.21 - 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.49.0 github.com/go-logr/logr v1.4.1 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 7009234..cf163f2 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/aws-controllers-k8s/ec2-controller v0.0.21 h1:5O7/9aED2Tl9OT0TL2rWrc1Ix5V1UxYEgDKAhvFhPJQ= github.com/aws-controllers-k8s/ec2-controller v0.0.21/go.mod h1:OMsmJeJ3iQZ1sJgs3hqnjBRnJ3hmTzJUO38W5rxnB5M= -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.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/Chart.yaml b/helm/Chart.yaml index 3ed01e5..69d7043 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 name: mq-chart description: A Helm chart for the ACK service controller for Amazon MQ (MQ) -version: 0.0.35 -appVersion: 0.0.35 +version: 0.0.36 +appVersion: 0.0.36 home: https://github.com/aws-controllers-k8s/mq-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 fcc4413..1fed3fb 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/mq-controller:0.0.35". +This chart deploys "public.ecr.aws/aws-controllers-k8s/mq-controller:0.0.36". 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 ccb6c08..b51aa0b 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -4,7 +4,7 @@ image: repository: public.ecr.aws/aws-controllers-k8s/mq-controller - tag: 0.0.35 + tag: 0.0.36 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/broker/manager_factory.go b/pkg/resource/broker/manager_factory.go index fccad3f..6a48c2d 100644 --- a/pkg/resource/broker/manager_factory.go +++ b/pkg/resource/broker/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/broker/references.go b/pkg/resource/broker/references.go index f1233ec..0b7ebe2 100644 --- a/pkg/resource/broker/references.go +++ b/pkg/resource/broker/references.go @@ -153,12 +153,8 @@ func getReferencedResourceState_SecurityGroup( if err != nil { return err } - var refResourceSynced, refResourceTerminal bool + var refResourceTerminal bool for _, cond := range obj.Status.Conditions { - if cond.Type == ackv1alpha1.ConditionTypeResourceSynced && - cond.Status == corev1.ConditionTrue { - refResourceSynced = true - } if cond.Type == ackv1alpha1.ConditionTypeTerminal && cond.Status == corev1.ConditionTrue { return ackerr.ResourceReferenceTerminalFor( @@ -171,6 +167,13 @@ func getReferencedResourceState_SecurityGroup( "SecurityGroup", namespace, name) } + var refResourceSynced bool + for _, cond := range obj.Status.Conditions { + if cond.Type == ackv1alpha1.ConditionTypeResourceSynced && + cond.Status == corev1.ConditionTrue { + refResourceSynced = true + } + } if !refResourceSynced { return ackerr.ResourceReferenceNotSyncedFor( "SecurityGroup", @@ -238,12 +241,8 @@ func getReferencedResourceState_Subnet( if err != nil { return err } - var refResourceSynced, refResourceTerminal bool + var refResourceTerminal bool for _, cond := range obj.Status.Conditions { - if cond.Type == ackv1alpha1.ConditionTypeResourceSynced && - cond.Status == corev1.ConditionTrue { - refResourceSynced = true - } if cond.Type == ackv1alpha1.ConditionTypeTerminal && cond.Status == corev1.ConditionTrue { return ackerr.ResourceReferenceTerminalFor( @@ -256,6 +255,13 @@ func getReferencedResourceState_Subnet( "Subnet", namespace, name) } + var refResourceSynced bool + for _, cond := range obj.Status.Conditions { + if cond.Type == ackv1alpha1.ConditionTypeResourceSynced && + cond.Status == corev1.ConditionTrue { + refResourceSynced = true + } + } if !refResourceSynced { return ackerr.ResourceReferenceNotSyncedFor( "Subnet",