From 186ef50d19b19d230bf0f2e843128c57f5118b41 Mon Sep 17 00:00:00 2001 From: AWS Controllers for Kubernetes Bot <82905295+ack-bot@users.noreply.github.com> Date: Sun, 11 Dec 2022 07:07:18 -0800 Subject: [PATCH] Update to ACK runtime `v0.21.0`, code-generator `v0.21.0` (#36) ### Update to ACK runtime `v0.21.0`, code-generator `v0.21.0` ---------- * ACK code-generator `v0.21.0` [release notes](https://github.com/aws-controllers-k8s/code-generator/releases/tag/v0.21.0) * ACK runtime `v0.21.0` [release notes](https://github.com/aws-controllers-k8s/runtime/releases/tag/v0.21.0) ---------- NOTE: This PR increments the release version of service controller from `v0.1.2` to `v0.1.3` Once this PR is merged, release `v0.1.3` will be automatically created for `sfn-controller` **Please close this PR, if you do not want the new patch release for `sfn-controller`** ---------- #### stdout for `make build-controller`: ``` building ack-generate ... ok. ==== building sfn-controller ==== Copying common custom resource definitions into sfn Building Kubernetes API objects for sfn Generating deepcopy code for sfn Generating custom resource definitions for sfn Building service controller for sfn Generating RBAC manifests for sfn Running gofmt against generated code for sfn Updating additional GitHub repository maintenance files ==== building sfn-controller release artifacts ==== Building release artifacts for sfn-v0.1.3 Generating common custom resource definitions Generating custom resource definitions for sfn Generating RBAC manifests for sfn ``` ---------- 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 +- .../bases/services.k8s.aws_adoptedresources.yaml | 10 ++-------- .../common/bases/services.k8s.aws_fieldexports.yaml | 9 +-------- go.mod | 2 +- go.sum | 4 ++-- helm/Chart.yaml | 4 ++-- helm/templates/NOTES.txt | 2 +- helm/templates/cluster-role-controller.yaml | 8 ++++++++ helm/values.schema.json | 8 ++++++++ helm/values.yaml | 6 +++++- pkg/resource/activity/tags.go | 10 ++++++---- pkg/resource/state_machine/tags.go | 10 ++++++---- 13 files changed, 46 insertions(+), 35 deletions(-) diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index bd8b09e..610eacb 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,8 +1,8 @@ ack_generate_info: - build_date: "2022-09-12T19:19:08Z" - build_hash: 2944c8772f216656d84ee02d392eaca501274c1e + build_date: "2022-12-08T18:54:28Z" + build_hash: 12246c7da82841b351ec7a9e1f139f9338f2784b go_version: go1.17.5 - version: v0.20.1 + version: v0.21.0 api_directory_checksum: fb0d67de142257cc8f80703c3f14eabbd87711b7 api_version: v1alpha1 aws_sdk_go_version: v1.44.93 diff --git a/config/controller/kustomization.yaml b/config/controller/kustomization.yaml index ad45b6c..3412867 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/sfn-controller - newTag: v0.1.2 + newTag: v0.1.3 diff --git a/config/crd/common/bases/services.k8s.aws_adoptedresources.yaml b/config/crd/common/bases/services.k8s.aws_adoptedresources.yaml index f764dbb..7dca541 100644 --- a/config/crd/common/bases/services.k8s.aws_adoptedresources.yaml +++ b/config/crd/common/bases/services.k8s.aws_adoptedresources.yaml @@ -1,10 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.7.0 + controller-gen.kubebuilder.io/version: v0.9.2 creationTimestamp: null name: adoptedresources.services.k8s.aws spec: @@ -170,6 +169,7 @@ spec: - name - uid type: object + x-kubernetes-map-type: atomic type: array type: object required: @@ -224,9 +224,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/config/crd/common/bases/services.k8s.aws_fieldexports.yaml b/config/crd/common/bases/services.k8s.aws_fieldexports.yaml index a435de8..4a7ab61 100644 --- a/config/crd/common/bases/services.k8s.aws_fieldexports.yaml +++ b/config/crd/common/bases/services.k8s.aws_fieldexports.yaml @@ -1,10 +1,9 @@ - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.7.0 + controller-gen.kubebuilder.io/version: v0.9.2 creationTimestamp: null name: fieldexports.services.k8s.aws spec: @@ -133,9 +132,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/go.mod b/go.mod index 9b94d65..3512136 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws-controllers-k8s/sfn-controller go 1.17 require ( - github.com/aws-controllers-k8s/runtime v0.20.1 + github.com/aws-controllers-k8s/runtime v0.21.0 github.com/aws/aws-sdk-go v1.44.93 github.com/go-logr/logr v1.2.0 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 3a9fb7a..96b91e6 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.20.1 h1:L/Huf1shRahx5BqJBCSS5u+vYg3f0Rotsq1jutORpdI= -github.com/aws-controllers-k8s/runtime v0.20.1/go.mod h1:k7z4qlf6aK1Kzd4ff49wzcyhDKHjWaUpqxrwgl4uS1o= +github.com/aws-controllers-k8s/runtime v0.21.0 h1:e9DK88QodwXMLz+QXPXk+8XNetVj4ij+puaVwn9uEVc= +github.com/aws-controllers-k8s/runtime v0.21.0/go.mod h1:k7z4qlf6aK1Kzd4ff49wzcyhDKHjWaUpqxrwgl4uS1o= github.com/aws/aws-sdk-go v1.44.93 h1:hAgd9fuaptBatSft27/5eBMdcA8+cIMqo96/tZ6rKl8= github.com/aws/aws-sdk-go v1.44.93/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 691cdb2..859879c 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 name: sfn-chart description: A Helm chart for the ACK service controller for AWS Step Functions (Step-Functions) -version: v0.1.2 -appVersion: v0.1.2 +version: v0.1.3 +appVersion: v0.1.3 home: https://github.com/aws-controllers-k8s/sfn-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 a96f8f7..0b30155 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/sfn-controller:v0.1.2". +This chart deploys "public.ecr.aws/aws-controllers-k8s/sfn-controller:v0.1.3". Check its status by running: kubectl --namespace {{ .Release.Namespace }} get pods -l "app.kubernetes.io/instance={{ .Release.Name }}" diff --git a/helm/templates/cluster-role-controller.yaml b/helm/templates/cluster-role-controller.yaml index e3d0d87..fc20e6a 100644 --- a/helm/templates/cluster-role-controller.yaml +++ b/helm/templates/cluster-role-controller.yaml @@ -4,11 +4,19 @@ kind: ClusterRole metadata: creationTimestamp: null name: ack-sfn-controller + labels: + {{- range $key, $value := .Values.role.labels }} + {{ $key }}: {{ $value | quote }} + {{- end }} {{ else }} kind: Role metadata: creationTimestamp: null name: ack-sfn-controller + labels: + {{- range $key, $value := .Values.role.labels }} + {{ $key }}: {{ $value | quote }} + {{- end }} namespace: {{ .Release.Namespace }} {{ end }} rules: diff --git a/helm/values.schema.json b/helm/values.schema.json index 2d3555a..86a7580 100644 --- a/helm/values.schema.json +++ b/helm/values.schema.json @@ -65,6 +65,14 @@ ], "type": "object" }, + "role": { + "description": "Role settings", + "properties": { + "labels": { + "type": "object" + } + } + }, "metrics": { "description": "Metrics settings", "properties": { diff --git a/helm/values.yaml b/helm/values.yaml index b02997b..c26c146 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -4,7 +4,7 @@ image: repository: public.ecr.aws/aws-controllers-k8s/sfn-controller - tag: v0.1.2 + tag: v0.1.3 pullPolicy: IfNotPresent pullSecrets: [] @@ -28,6 +28,10 @@ deployment: # Which priorityClassName to set? # See: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority priorityClassName: "" + +# If "installScope: cluster" then these labels will be applied to ClusterRole +role: + labels: {} metrics: service: diff --git a/pkg/resource/activity/tags.go b/pkg/resource/activity/tags.go index f06ff59..5de0ef4 100644 --- a/pkg/resource/activity/tags.go +++ b/pkg/resource/activity/tags.go @@ -36,10 +36,12 @@ func ToACKTags(tags []*svcapitypes.Tag) acktags.Tags { } for _, t := range tags { - if t.Value == nil { - result[*t.Key] = "" - } else { - result[*t.Key] = *t.Value + if t.Key != nil { + if t.Value == nil { + result[*t.Key] = "" + } else { + result[*t.Key] = *t.Value + } } } diff --git a/pkg/resource/state_machine/tags.go b/pkg/resource/state_machine/tags.go index fa22456..4b52fd2 100644 --- a/pkg/resource/state_machine/tags.go +++ b/pkg/resource/state_machine/tags.go @@ -36,10 +36,12 @@ func ToACKTags(tags []*svcapitypes.Tag) acktags.Tags { } for _, t := range tags { - if t.Value == nil { - result[*t.Key] = "" - } else { - result[*t.Key] = *t.Value + if t.Key != nil { + if t.Value == nil { + result[*t.Key] = "" + } else { + result[*t.Key] = *t.Value + } } }