From f17a0ed2311044969722d4d6899f74f1ca371854 Mon Sep 17 00:00:00 2001 From: AWS Controllers for Kubernetes Bot <82905295+ack-bot@users.noreply.github.com> Date: Wed, 2 Feb 2022 13:59:48 -0800 Subject: [PATCH] Update ACK runtime to `v0.16.4` (#13) ### Update ACK runtime to `v0.16.4` ---------- * ACK code-generator `v0.16.4` [release notes](https://github.com/aws-controllers-k8s/code-generator/releases/tag/v0.16.4) * ACK runtime `v0.16.4` [release notes](https://github.com/aws-controllers-k8s/runtime/releases/tag/v0.16.4) ---------- NOTE: This PR increments the release version of service controller from `v0.0.8` to `v0.0.9` Once this PR is merged, release `v0.0.9` 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.0.9 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 | 8 ++++---- config/controller/deployment.yaml | 1 + config/controller/kustomization.yaml | 4 ++-- config/rbac/cluster-role-binding.yaml | 2 +- config/rbac/kustomization.yaml | 2 ++ config/rbac/service-account.yaml | 6 ++++++ go.mod | 4 ++-- go.sum | 9 +++++---- helm/Chart.yaml | 4 ++-- helm/templates/NOTES.txt | 2 +- helm/values.yaml | 2 +- pkg/resource/activity/manager.go | 16 ++++++++++++++++ pkg/resource/state_machine/manager.go | 16 ++++++++++++++++ 13 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 config/rbac/service-account.yaml diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index d96060b..330a1e5 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,11 +1,11 @@ ack_generate_info: - build_date: "2022-01-24T20:43:58Z" - build_hash: cccec82a27ddd880095383360df1fdc8f530842f + build_date: "2022-02-02T21:23:37Z" + build_hash: 8f02d7700eaa65a51e99c37d296056def0b70647 go_version: go1.17.5 - version: v0.16.3 + version: v0.16.4 api_directory_checksum: fb0d67de142257cc8f80703c3f14eabbd87711b7 api_version: v1alpha1 -aws_sdk_go_version: v1.37.10 +aws_sdk_go_version: v1.42.0 generator_config_info: file_checksum: 2f88f86d9277527a7997145217e606375d179b05 original_file_name: generator.yaml diff --git a/config/controller/deployment.yaml b/config/controller/deployment.yaml index c164c30..c761ef0 100644 --- a/config/controller/deployment.yaml +++ b/config/controller/deployment.yaml @@ -61,6 +61,7 @@ spec: drop: - ALL terminationGracePeriodSeconds: 10 + serviceAccountName: ack-sfn-controller hostIPC: false hostNetwork: false hostPID: false diff --git a/config/controller/kustomization.yaml b/config/controller/kustomization.yaml index ba17ddd..01f867c 100644 --- a/config/controller/kustomization.yaml +++ b/config/controller/kustomization.yaml @@ -5,5 +5,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: - name: controller - newName: ack-sfn-controller - newTag: latest + newName: public.ecr.aws/aws-controllers-k8s/sfn-controller + newTag: v0.0.9 diff --git a/config/rbac/cluster-role-binding.yaml b/config/rbac/cluster-role-binding.yaml index 8845686..825fcc7 100644 --- a/config/rbac/cluster-role-binding.yaml +++ b/config/rbac/cluster-role-binding.yaml @@ -8,5 +8,5 @@ roleRef: name: ack-sfn-controller subjects: - kind: ServiceAccount - name: default + name: ack-sfn-controller namespace: ack-system diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index 08df5b9..eb7df60 100644 --- a/config/rbac/kustomization.yaml +++ b/config/rbac/kustomization.yaml @@ -3,3 +3,5 @@ resources: - cluster-role-controller.yaml - role-reader.yaml - role-writer.yaml +- service-account.yaml + diff --git a/config/rbac/service-account.yaml b/config/rbac/service-account.yaml new file mode 100644 index 0000000..a9d669a --- /dev/null +++ b/config/rbac/service-account.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: ack-sfn-controller + namespace: ack-system diff --git a/go.mod b/go.mod index f206ec9..c87eff7 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/aws-controllers-k8s/sfn-controller go 1.17 require ( - github.com/aws-controllers-k8s/runtime v0.16.3 - github.com/aws/aws-sdk-go v1.37.10 + github.com/aws-controllers-k8s/runtime v0.16.4 + github.com/aws/aws-sdk-go v1.42.0 github.com/go-logr/logr v1.2.0 github.com/spf13/pflag v1.0.5 k8s.io/api v0.23.0 diff --git a/go.sum b/go.sum index 7803d74..1c7a9ef 100644 --- a/go.sum +++ b/go.sum @@ -64,10 +64,10 @@ 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.16.3 h1:AaufF1pkfX3M3G4WK6m9OTcI6yEzKnFsffpuWTIy5wY= -github.com/aws-controllers-k8s/runtime v0.16.3/go.mod h1:DHwPczqO/nK4L1kqWlmng5GuIQuX5MSSWbTQMuL4LnM= -github.com/aws/aws-sdk-go v1.37.10 h1:LRwl+97B4D69Z7tz+eRUxJ1C7baBaIYhgrn5eLtua+Q= -github.com/aws/aws-sdk-go v1.37.10/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws-controllers-k8s/runtime v0.16.4 h1:gV8jT09PwaCQWaC46NEnaEggqPm8Lxke6G0f7SxVsys= +github.com/aws-controllers-k8s/runtime v0.16.4/go.mod h1:9c2CL3w0BlVkse+foHlP1SkJRqYWLs9H+4X/z+2kE3w= +github.com/aws/aws-sdk-go v1.42.0 h1:BMZws0t8NAhHFsfnT3B40IwD13jVDG5KerlRksctVIw= +github.com/aws/aws-sdk-go v1.42.0/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -592,6 +592,7 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a h1:bRuuGXV8wwSdGTB+CtJf+FjgO1APK1CoO39T4BN/XBw= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 1ae1cf6..fe13b07 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.0.8 -appVersion: v0.0.8 +version: v0.0.9 +appVersion: v0.0.9 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 8ff48a7..0537b0c 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.0.8". +This chart deploys "public.ecr.aws/aws-controllers-k8s/sfn-controller:v0.0.9". 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 037d801..cead85e 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.0.8 + tag: v0.0.9 pullPolicy: IfNotPresent pullSecrets: [] diff --git a/pkg/resource/activity/manager.go b/pkg/resource/activity/manager.go index b647a7a..a5b591c 100644 --- a/pkg/resource/activity/manager.go +++ b/pkg/resource/activity/manager.go @@ -29,6 +29,7 @@ import ( ackrequeue "github.com/aws-controllers-k8s/runtime/pkg/requeue" ackrtlog "github.com/aws-controllers-k8s/runtime/pkg/runtime/log" acktypes "github.com/aws-controllers-k8s/runtime/pkg/types" + ackutil "github.com/aws-controllers-k8s/runtime/pkg/util" "github.com/aws/aws-sdk-go/aws/session" "github.com/go-logr/logr" corev1 "k8s.io/api/core/v1" @@ -37,6 +38,10 @@ import ( svcsdkapi "github.com/aws/aws-sdk-go/service/sfn/sfniface" ) +var ( + _ = ackutil.InStrings +) + // +kubebuilder:rbac:groups=sfn.services.k8s.aws,resources=activities,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=sfn.services.k8s.aws,resources=activities/status,verbs=get;update;patch @@ -241,6 +246,17 @@ func (rm *resourceManager) lateInitializeFromReadOneOutput( return latest } +// IsSynced returns true if the resource is synced. +func (rm *resourceManager) IsSynced(ctx context.Context, res acktypes.AWSResource) (bool, error) { + r := rm.concreteResource(res) + if r.ko == nil { + // Should never happen... if it does, it's buggy code. + panic("resource manager's IsSynced() method received resource with nil CR object") + } + + return true, nil +} + // newResourceManager returns a new struct implementing // acktypes.AWSResourceManager func newResourceManager( diff --git a/pkg/resource/state_machine/manager.go b/pkg/resource/state_machine/manager.go index abb61cd..fbb81da 100644 --- a/pkg/resource/state_machine/manager.go +++ b/pkg/resource/state_machine/manager.go @@ -29,6 +29,7 @@ import ( ackrequeue "github.com/aws-controllers-k8s/runtime/pkg/requeue" ackrtlog "github.com/aws-controllers-k8s/runtime/pkg/runtime/log" acktypes "github.com/aws-controllers-k8s/runtime/pkg/types" + ackutil "github.com/aws-controllers-k8s/runtime/pkg/util" "github.com/aws/aws-sdk-go/aws/session" "github.com/go-logr/logr" corev1 "k8s.io/api/core/v1" @@ -37,6 +38,10 @@ import ( svcsdkapi "github.com/aws/aws-sdk-go/service/sfn/sfniface" ) +var ( + _ = ackutil.InStrings +) + // +kubebuilder:rbac:groups=sfn.services.k8s.aws,resources=statemachines,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=sfn.services.k8s.aws,resources=statemachines/status,verbs=get;update;patch @@ -241,6 +246,17 @@ func (rm *resourceManager) lateInitializeFromReadOneOutput( return latest } +// IsSynced returns true if the resource is synced. +func (rm *resourceManager) IsSynced(ctx context.Context, res acktypes.AWSResource) (bool, error) { + r := rm.concreteResource(res) + if r.ko == nil { + // Should never happen... if it does, it's buggy code. + panic("resource manager's IsSynced() method received resource with nil CR object") + } + + return true, nil +} + // newResourceManager returns a new struct implementing // acktypes.AWSResourceManager func newResourceManager(