From 37aaca2b7c57f4cd489eab5b520d58cb61f44bd6 Mon Sep 17 00:00:00 2001 From: ci-robot Date: Fri, 8 Oct 2021 18:32:05 +0000 Subject: [PATCH] Update ACK runtime to `v0.15.1` --- apis/v1alpha1/ack-generate-metadata.yaml | 6 +++--- config/controller/deployment.yaml | 2 -- go.mod | 2 +- go.sum | 6 ++++-- helm/templates/deployment.yaml | 2 -- pkg/resource/cache_parameter_group/descriptor.go | 5 +++-- pkg/resource/cache_subnet_group/descriptor.go | 5 +++-- pkg/resource/replication_group/custom_update_api.go | 2 +- pkg/resource/replication_group/custom_update_api_test.go | 2 +- pkg/resource/replication_group/descriptor.go | 5 +++-- pkg/resource/replication_group/sdk.go | 8 ++++---- pkg/resource/snapshot/descriptor.go | 5 +++-- pkg/resource/user/descriptor.go | 5 +++-- pkg/resource/user_group/descriptor.go | 5 +++-- 14 files changed, 32 insertions(+), 28 deletions(-) diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index 2801ab37..45ae9e5a 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,8 +1,8 @@ ack_generate_info: - build_date: "2021-09-23T18:08:08Z" - build_hash: fe3ca1f5ee52a0e49be0f8458b4e5058a8f0fd47 + build_date: "2021-10-08T18:31:51Z" + build_hash: 385779a205bea50e8762b76bc75cab957cf723b9 go_version: go1.15 - version: v0.14.1 + version: v0.15.1 api_directory_checksum: 69c917d1e1ee2b196c23799a02417b920297bc74 api_version: v1alpha1 aws_sdk_go_version: v1.38.52 diff --git a/config/controller/deployment.yaml b/config/controller/deployment.yaml index 056f2049..5a1410b6 100644 --- a/config/controller/deployment.yaml +++ b/config/controller/deployment.yaml @@ -26,8 +26,6 @@ spec: - command: - ./bin/controller args: - - --aws-account-id - - "$(AWS_ACCOUNT_ID)" - --aws-region - "$(AWS_REGION)" - --enable-development-logging diff --git a/go.mod b/go.mod index 3b3e483e..0428406e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws-controllers-k8s/elasticache-controller go 1.14 require ( - github.com/aws-controllers-k8s/runtime v0.14.1 + github.com/aws-controllers-k8s/runtime v0.15.1 github.com/aws/aws-sdk-go v1.38.52 github.com/ghodss/yaml v1.0.0 github.com/go-logr/logr v0.1.0 diff --git a/go.sum b/go.sum index 984165c8..70f2a205 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws-controllers-k8s/runtime v0.14.1 h1:2/hCwost9rmtgsgktCtJH75U74ziWiBs0bHFOB2iaKo= -github.com/aws-controllers-k8s/runtime v0.14.1/go.mod h1:kG2WM4JAmLgf67cgZV9IZUkY2DsrUzsaNbmhFMfb05c= +github.com/aws-controllers-k8s/runtime v0.15.1 h1:3P+6MKWe8ITJynmoxmDnMPlkoI9nuVgn8XD9Pt/XHE8= +github.com/aws-controllers-k8s/runtime v0.15.1/go.mod h1:W0Txdhb1Npx5kg72w2WFwIpGFvSsMxXlJzzNHAwCLeY= github.com/aws/aws-sdk-go v1.37.10/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.38.52 h1:7NKcUyTG/CyDX835kq04DDNe8vXaJhbGW8ThemHb18A= github.com/aws/aws-sdk-go v1.38.52/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= @@ -177,6 +177,8 @@ github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jaypipes/envutil v1.0.0 h1:u6Vwy9HwruFihoZrL0bxDLCa/YNadGVwKyPElNmZWow= +github.com/jaypipes/envutil v1.0.0/go.mod h1:vgIRDly+xgBq0eeZRcflOHMMobMwgC6MkMbxo/Nw65M= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index d32824ff..3cce9b35 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -37,8 +37,6 @@ spec: - command: - ./bin/controller args: - - --aws-account-id - - "$(AWS_ACCOUNT_ID)" - --aws-region - "$(AWS_REGION)" - --aws-endpoint-url diff --git a/pkg/resource/cache_parameter_group/descriptor.go b/pkg/resource/cache_parameter_group/descriptor.go index 7b66190f..1f80ff16 100644 --- a/pkg/resource/cache_parameter_group/descriptor.go +++ b/pkg/resource/cache_parameter_group/descriptor.go @@ -31,7 +31,8 @@ const ( ) var ( - resourceGK = metav1.GroupKind{ + GroupVersionResource = svcapitypes.GroupVersion.WithResource("cacheparametergroups") + GroupKind = metav1.GroupKind{ Group: "elasticache.services.k8s.aws", Kind: "CacheParameterGroup", } @@ -45,7 +46,7 @@ type resourceDescriptor struct { // GroupKind returns a Kubernetes metav1.GroupKind struct that describes the // API Group and Kind of CRs described by the descriptor func (d *resourceDescriptor) GroupKind() *metav1.GroupKind { - return &resourceGK + return &GroupKind } // EmptyRuntimeObject returns an empty object prototype that may be used in diff --git a/pkg/resource/cache_subnet_group/descriptor.go b/pkg/resource/cache_subnet_group/descriptor.go index 53cb0043..cb549e6b 100644 --- a/pkg/resource/cache_subnet_group/descriptor.go +++ b/pkg/resource/cache_subnet_group/descriptor.go @@ -31,7 +31,8 @@ const ( ) var ( - resourceGK = metav1.GroupKind{ + GroupVersionResource = svcapitypes.GroupVersion.WithResource("cachesubnetgroups") + GroupKind = metav1.GroupKind{ Group: "elasticache.services.k8s.aws", Kind: "CacheSubnetGroup", } @@ -45,7 +46,7 @@ type resourceDescriptor struct { // GroupKind returns a Kubernetes metav1.GroupKind struct that describes the // API Group and Kind of CRs described by the descriptor func (d *resourceDescriptor) GroupKind() *metav1.GroupKind { - return &resourceGK + return &GroupKind } // EmptyRuntimeObject returns an empty object prototype that may be used in diff --git a/pkg/resource/replication_group/custom_update_api.go b/pkg/resource/replication_group/custom_update_api.go index 7f49bb02..207d97ac 100644 --- a/pkg/resource/replication_group/custom_update_api.go +++ b/pkg/resource/replication_group/custom_update_api.go @@ -522,7 +522,7 @@ func (rm *resourceManager) newUpdateShardConfigurationRequestPayload( shardsConfig = append(shardsConfig, shardConfig) } } else if decrease { - for i := 0; i < int(*desiredShardsCount); i++ { + for i := 0; i < int(*desiredShardsCount); i++ { shardsToRetain = append(shardsToRetain, desired.ko.Status.NodeGroups[i].NodeGroupID) } } diff --git a/pkg/resource/replication_group/custom_update_api_test.go b/pkg/resource/replication_group/custom_update_api_test.go index 6a08852b..2e88fda2 100644 --- a/pkg/resource/replication_group/custom_update_api_test.go +++ b/pkg/resource/replication_group/custom_update_api_test.go @@ -392,7 +392,7 @@ func TestCustomModifyReplicationGroup_NodeGroup_available(t *testing.T) { }) } -func TestCustomModifyReplicationGroup_ScaleUpAndDown_And_Resharding(t *testing.T) { +func TestCustomModifyReplicationGroup_ScaleUpAndDown_And_Resharding(t *testing.T) { assert := assert.New(t) // Tests diff --git a/pkg/resource/replication_group/descriptor.go b/pkg/resource/replication_group/descriptor.go index 800bb2c7..099b54ea 100644 --- a/pkg/resource/replication_group/descriptor.go +++ b/pkg/resource/replication_group/descriptor.go @@ -31,7 +31,8 @@ const ( ) var ( - resourceGK = metav1.GroupKind{ + GroupVersionResource = svcapitypes.GroupVersion.WithResource("replicationgroups") + GroupKind = metav1.GroupKind{ Group: "elasticache.services.k8s.aws", Kind: "ReplicationGroup", } @@ -45,7 +46,7 @@ type resourceDescriptor struct { // GroupKind returns a Kubernetes metav1.GroupKind struct that describes the // API Group and Kind of CRs described by the descriptor func (d *resourceDescriptor) GroupKind() *metav1.GroupKind { - return &resourceGK + return &GroupKind } // EmptyRuntimeObject returns an empty object prototype that may be used in diff --git a/pkg/resource/replication_group/sdk.go b/pkg/resource/replication_group/sdk.go index 8fa6e096..f20df59e 100644 --- a/pkg/resource/replication_group/sdk.go +++ b/pkg/resource/replication_group/sdk.go @@ -1815,18 +1815,18 @@ func (rm *resourceManager) terminalAWSError(err error) bool { } } -// This method copies the data from given ReplicationGroup by populating it +// This method copies the data from given CreateReplicationGroupOutput by populating it // into copy of supplied resource and returns that. -func (rm *resourceManager) setReplicationGroupOutput( +func (rm *resourceManager) setCreateReplicationGroupOutputOutput( r *resource, - obj *svcsdk.ReplicationGroup, + obj *svcsdk.CreateReplicationGroupOutput, ) (*resource, error) { if obj == nil || r == nil || r.ko == nil { return nil, nil } - resp := &svcsdk.CreateReplicationGroupOutput{ReplicationGroup: obj} + resp := &svcsdk.CreateReplicationGroupOutput{CreateReplicationGroupOutput: obj} // Merge in the information we read from the API call above to the copy of // the original Kubernetes object we passed to the function ko := r.ko.DeepCopy() diff --git a/pkg/resource/snapshot/descriptor.go b/pkg/resource/snapshot/descriptor.go index b52bc629..cce7d61f 100644 --- a/pkg/resource/snapshot/descriptor.go +++ b/pkg/resource/snapshot/descriptor.go @@ -31,7 +31,8 @@ const ( ) var ( - resourceGK = metav1.GroupKind{ + GroupVersionResource = svcapitypes.GroupVersion.WithResource("snapshots") + GroupKind = metav1.GroupKind{ Group: "elasticache.services.k8s.aws", Kind: "Snapshot", } @@ -45,7 +46,7 @@ type resourceDescriptor struct { // GroupKind returns a Kubernetes metav1.GroupKind struct that describes the // API Group and Kind of CRs described by the descriptor func (d *resourceDescriptor) GroupKind() *metav1.GroupKind { - return &resourceGK + return &GroupKind } // EmptyRuntimeObject returns an empty object prototype that may be used in diff --git a/pkg/resource/user/descriptor.go b/pkg/resource/user/descriptor.go index 434ff847..7c6e9fb7 100644 --- a/pkg/resource/user/descriptor.go +++ b/pkg/resource/user/descriptor.go @@ -31,7 +31,8 @@ const ( ) var ( - resourceGK = metav1.GroupKind{ + GroupVersionResource = svcapitypes.GroupVersion.WithResource("users") + GroupKind = metav1.GroupKind{ Group: "elasticache.services.k8s.aws", Kind: "User", } @@ -45,7 +46,7 @@ type resourceDescriptor struct { // GroupKind returns a Kubernetes metav1.GroupKind struct that describes the // API Group and Kind of CRs described by the descriptor func (d *resourceDescriptor) GroupKind() *metav1.GroupKind { - return &resourceGK + return &GroupKind } // EmptyRuntimeObject returns an empty object prototype that may be used in diff --git a/pkg/resource/user_group/descriptor.go b/pkg/resource/user_group/descriptor.go index da80abbe..9fbc2e47 100644 --- a/pkg/resource/user_group/descriptor.go +++ b/pkg/resource/user_group/descriptor.go @@ -31,7 +31,8 @@ const ( ) var ( - resourceGK = metav1.GroupKind{ + GroupVersionResource = svcapitypes.GroupVersion.WithResource("usergroups") + GroupKind = metav1.GroupKind{ Group: "elasticache.services.k8s.aws", Kind: "UserGroup", } @@ -45,7 +46,7 @@ type resourceDescriptor struct { // GroupKind returns a Kubernetes metav1.GroupKind struct that describes the // API Group and Kind of CRs described by the descriptor func (d *resourceDescriptor) GroupKind() *metav1.GroupKind { - return &resourceGK + return &GroupKind } // EmptyRuntimeObject returns an empty object prototype that may be used in