From 04859fb88c0316f55f510c2b08aafd1328276195 Mon Sep 17 00:00:00 2001 From: AWS Controllers for Kubernetes Bot <82905295+ack-bot@users.noreply.github.com> Date: Fri, 10 Feb 2023 03:06:46 -0800 Subject: [PATCH] Update to ACK runtime `v0.24.0`, code-generator `v0.24.2` (#11) ### Update to ACK runtime `v0.24.0`, code-generator `v0.24.2` ---------- * ACK code-generator `v0.24.2` [release notes](https://github.com/aws-controllers-k8s/code-generator/releases/tag/v0.24.2) * ACK runtime `v0.24.0` [release notes](https://github.com/aws-controllers-k8s/runtime/releases/tag/v0.24.0) ---------- NOTE: This PR increments the release version of service controller from `v0.0.2` to `v0.0.3` Once this PR is merged, release `v0.0.3` will be automatically created for `acm-controller` **Please close this PR, if you do not want the new patch release for `acm-controller`** ---------- #### stdout for `make build-controller`: ``` building ack-generate ... ok. ==== building acm-controller ==== Copying common custom resource definitions into acm Building Kubernetes API objects for acm Generating deepcopy code for acm Generating custom resource definitions for acm Building service controller for acm Generating RBAC manifests for acm Running gofmt against generated code for acm Updating additional GitHub repository maintenance files ==== building acm-controller release artifacts ==== Building release artifacts for acm-v0.0.3 Generating common custom resource definitions Generating custom resource definitions for acm Generating RBAC manifests for acm ``` ---------- 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 | 4 +++- go.sum | 8 ++++++-- helm/Chart.yaml | 4 ++-- helm/templates/NOTES.txt | 2 +- helm/templates/deployment.yaml | 16 ++++++++++++++++ helm/values.schema.json | 12 ++++++++++++ helm/values.yaml | 9 ++++++++- pkg/resource/certificate/delta.go | 4 +++- 10 files changed, 55 insertions(+), 12 deletions(-) diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index 721fea7..0906fc5 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,8 +1,8 @@ ack_generate_info: - build_date: "2023-02-02T18:00:06Z" - build_hash: b55ae8752ece381c383ffe5b388ed2147c6b30d8 + build_date: "2023-02-10T00:03:07Z" + build_hash: d0f3d78cbea8061f822cbceac3786128f091efe6 go_version: go1.19 - version: v0.23.1 + version: v0.24.2 api_directory_checksum: 202e02932e71256f27a9cd0f6454e508c5b7e9b6 api_version: v1alpha1 aws_sdk_go_version: v1.44.177 diff --git a/config/controller/kustomization.yaml b/config/controller/kustomization.yaml index 6e8a43d..ada8b32 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/acm-controller - newTag: v0.0.2 + newTag: v0.0.3 diff --git a/go.mod b/go.mod index 9641b2e..721962e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws-controllers-k8s/acm-controller go 1.19 require ( - github.com/aws-controllers-k8s/runtime v0.23.0 + github.com/aws-controllers-k8s/runtime v0.24.0 github.com/aws/aws-sdk-go v1.44.177 github.com/go-logr/logr v1.2.0 github.com/spf13/pflag v1.0.5 @@ -42,9 +42,11 @@ require ( github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.28.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect + github.com/samber/lo v1.37.0 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.19.1 // indirect + golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect golang.org/x/net v0.1.0 // indirect golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect golang.org/x/sys v0.1.0 // indirect diff --git a/go.sum b/go.sum index ae2662e..995e7d1 100644 --- a/go.sum +++ b/go.sum @@ -64,8 +64,8 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws-controllers-k8s/runtime v0.23.0 h1:xM/zKyFzqbSr4gN9/cMRyjUUEEezHB0inpcsSV5clkg= -github.com/aws-controllers-k8s/runtime v0.23.0/go.mod h1:vBsKxMSP7Ya2Mv5KPGadu6OuIESTX+YIZB/2dOV7gXo= +github.com/aws-controllers-k8s/runtime v0.24.0 h1:F53HtC1YDHXcjtlRl2Q1xU0/7TRFvy9IlMFp0rTYeWE= +github.com/aws-controllers-k8s/runtime v0.24.0/go.mod h1:vBfkfwxAIULdvjHCfJNi6Pj3/QJJCrh+8uH3/ZfewVU= github.com/aws/aws-sdk-go v1.44.177 h1:ckMJhU5Gj+4Rta+bJIUiUd7jvHom84aim3zkGPblq0s= github.com/aws/aws-sdk-go v1.44.177/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= @@ -413,6 +413,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samber/lo v1.37.0 h1:XjVcB8g6tgUp8rsPsJ2CvhClfImrpL04YpQHXeHPhRw= +github.com/samber/lo v1.37.0/go.mod h1:9vaz2O4o8oOnK23pd2TrXufcbdbJIa3b6cstBWKpopA= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -524,6 +526,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 h1:3MTrJm4PyNL9NBqvYDSj3DHl46qQakyfqfWo4jgfaEM= +golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/helm/Chart.yaml b/helm/Chart.yaml index f53eb51..cda3587 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 name: acm-chart description: A Helm chart for the ACK service controller for AWS Certificate Manager (ACM) -version: v0.0.2 -appVersion: v0.0.2 +version: v0.0.3 +appVersion: v0.0.3 home: https://github.com/aws-controllers-k8s/acm-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 276ff0d..7eb43d4 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/acm-controller:v0.0.2". +This chart deploys "public.ecr.aws/aws-controllers-k8s/acm-controller:v0.0.3". Check its status by running: kubectl --namespace {{ .Release.Namespace }} get pods -l "app.kubernetes.io/instance={{ .Release.Name }}" diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index 80c0922..b3c0ede 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -56,6 +56,14 @@ spec: - "$(ACK_WATCH_NAMESPACE)" - --deletion-policy - "$(DELETION_POLICY)" +{{- if gt .Values.reconcile.defaultResyncPeriod 0.0 }} + - --reconcile-default-resync-seconds + - "$(RECONCILE_DEFAULT_RESYNC_SECONDS)" +{{- end }} +{{- range $key, $value := .Values.reconcile.resourceResyncPeriods }} + - --reconcile-resource-resync-seconds + - "$(RECONCILE_RESOURCE_RESYNC_SECONDS_{{ $key | upper }})" +{{- end }} image: {{ .Values.image.repository }}:{{ .Values.image.tag }} imagePullPolicy: {{ .Values.image.pullPolicy }} name: controller @@ -83,6 +91,14 @@ spec: value: {{ .Values.log.level | quote }} - name: ACK_RESOURCE_TAGS value: {{ join "," .Values.resourceTags | quote }} +{{- if gt .Values.reconcile.defaultResyncPeriod 0.0 }} + - name: RECONCILE_DEFAULT_RESYNC_SECONDS + value: {{ .Values.reconcile.defaultResyncPeriod | quote }} +{{- end }} +{{- range $key, $value := .Values.reconcile.resourceResyncPeriods }} + - name: RECONCILE_RESOURCE_RESYNC_SECONDS_{{ $key | upper }} + value: {{ $key }}={{ $value }} +{{- end }} {{- if .Values.aws.credentials.secretName }} - name: AWS_SHARED_CREDENTIALS_FILE value: {{ include "aws.credentials.path" . }} diff --git a/helm/values.schema.json b/helm/values.schema.json index 267c541..d5a8d35 100644 --- a/helm/values.schema.json +++ b/helm/values.schema.json @@ -207,6 +207,18 @@ "type": "string", "enum": ["delete", "retain"] }, + "reconcile": { + "description": "Reconcile resync settings. Parameters to tune the controller's drift remediation period.", + "properties": { + "defaultResyncPeriod": { + "type": "number" + }, + "resourceResyncPeriods": { + "type": "object" + } + }, + "type": "object" + }, "serviceAccount": { "description": "ServiceAccount settings", "properties": { diff --git a/helm/values.yaml b/helm/values.yaml index 4f32797..2499ea7 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -4,7 +4,7 @@ image: repository: public.ecr.aws/aws-controllers-k8s/acm-controller - tag: v0.0.2 + tag: v0.0.3 pullPolicy: IfNotPresent pullSecrets: [] @@ -83,6 +83,13 @@ resourceTags: # before the K8s resource is removed. deletionPolicy: delete +# controller reconciliation configurations +reconcile: + # The default duration, in seconds, to wait before resyncing desired state of custom resources. + defaultResyncPeriod: 0 + # An object representing the reconcile resync configuration for each specific resource. + resourceResyncPeriods: {} + serviceAccount: # Specifies whether a service account should be created create: true diff --git a/pkg/resource/certificate/delta.go b/pkg/resource/certificate/delta.go index c9b8630..a268ce3 100644 --- a/pkg/resource/certificate/delta.go +++ b/pkg/resource/certificate/delta.go @@ -20,12 +20,14 @@ import ( "reflect" ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare" + acktags "github.com/aws-controllers-k8s/runtime/pkg/tags" ) // Hack to avoid import errors during build... var ( _ = &bytes.Buffer{} _ = &reflect.Method{} + _ = &acktags.Tags{} ) // newResourceDelta returns a new `ackcompare.Delta` used to compare two @@ -79,7 +81,7 @@ func newResourceDelta( if !ackcompare.SliceStringPEqual(a.ko.Spec.SubjectAlternativeNames, b.ko.Spec.SubjectAlternativeNames) { delta.Add("Spec.SubjectAlternativeNames", a.ko.Spec.SubjectAlternativeNames, b.ko.Spec.SubjectAlternativeNames) } - if !reflect.DeepEqual(a.ko.Spec.Tags, b.ko.Spec.Tags) { + if !ackcompare.MapStringStringEqual(ToACKTags(a.ko.Spec.Tags), ToACKTags(b.ko.Spec.Tags)) { delta.Add("Spec.Tags", a.ko.Spec.Tags, b.ko.Spec.Tags) }