diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index 6f4b8f8d..42148a23 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:34:25Z" - build_hash: cccec82a27ddd880095383360df1fdc8f530842f + build_date: "2022-02-02T21:33:24Z" + build_hash: 8f02d7700eaa65a51e99c37d296056def0b70647 go_version: go1.17.5 - version: v0.16.3 -api_directory_checksum: 225442ca880d4df705d9b73f8711f2143a3db4b0 + version: v0.16.4 +api_directory_checksum: bef5d547b18c317b14122df45cf63430cc32264b api_version: v1alpha1 -aws_sdk_go_version: v1.38.52 +aws_sdk_go_version: v1.42.0 generator_config_info: file_checksum: 23f444fb86eaa5c1acb4d4f51430e606e7ee554a original_file_name: generator.yaml diff --git a/apis/v1alpha1/replication_group.go b/apis/v1alpha1/replication_group.go index 5e353f86..77df43f0 100644 --- a/apis/v1alpha1/replication_group.go +++ b/apis/v1alpha1/replication_group.go @@ -388,6 +388,9 @@ type ReplicationGroupStatus struct { // or during the next maintenance window. // +kubebuilder:validation:Optional PendingModifiedValues *ReplicationGroupPendingModifiedValues `json:"pendingModifiedValues,omitempty"` + // The date and time when the cluster was created. + // +kubebuilder:validation:Optional + ReplicationGroupCreateTime *metav1.Time `json:"replicationGroupCreateTime,omitempty"` // The cluster ID that is used as the daily snapshot source for the replication // group. // +kubebuilder:validation:Optional diff --git a/apis/v1alpha1/types.go b/apis/v1alpha1/types.go index 9257fabd..5ef49798 100644 --- a/apis/v1alpha1/types.go +++ b/apis/v1alpha1/types.go @@ -288,9 +288,9 @@ type GlobalNodeGroup struct { } // Consists of a primary cluster that accepts writes and an associated secondary -// cluster that resides in a different AWS region. The secondary cluster accepts -// only reads. The primary cluster automatically replicates updates to the secondary -// cluster. +// cluster that resides in a different Amazon region. The secondary cluster +// accepts only reads. The primary cluster automatically replicates updates +// to the secondary cluster. // // * The GlobalReplicationGroupIdSuffix represents the name of the Global // datastore, which is what you use to associate a secondary cluster. @@ -316,7 +316,7 @@ type GlobalReplicationGroupInfo struct { } // A member of a Global datastore. It contains the Replication Group Id, the -// AWS region and the role of the replication group. +// Amazon region and the role of the replication group. type GlobalReplicationGroupMember struct { AutomaticFailover *string `json:"automaticFailover,omitempty"` ReplicationGroupID *string `json:"replicationGroupID,omitempty"` @@ -529,14 +529,15 @@ type ReplicationGroup_SDK struct { NodeGroups []*NodeGroup `json:"nodeGroups,omitempty"` // The settings to be applied to the Redis replication group, either immediately // or during the next maintenance window. - PendingModifiedValues *ReplicationGroupPendingModifiedValues `json:"pendingModifiedValues,omitempty"` - ReplicationGroupID *string `json:"replicationGroupID,omitempty"` - SnapshotRetentionLimit *int64 `json:"snapshotRetentionLimit,omitempty"` - SnapshotWindow *string `json:"snapshotWindow,omitempty"` - SnapshottingClusterID *string `json:"snapshottingClusterID,omitempty"` - Status *string `json:"status,omitempty"` - TransitEncryptionEnabled *bool `json:"transitEncryptionEnabled,omitempty"` - UserGroupIDs []*string `json:"userGroupIDs,omitempty"` + PendingModifiedValues *ReplicationGroupPendingModifiedValues `json:"pendingModifiedValues,omitempty"` + ReplicationGroupCreateTime *metav1.Time `json:"replicationGroupCreateTime,omitempty"` + ReplicationGroupID *string `json:"replicationGroupID,omitempty"` + SnapshotRetentionLimit *int64 `json:"snapshotRetentionLimit,omitempty"` + SnapshotWindow *string `json:"snapshotWindow,omitempty"` + SnapshottingClusterID *string `json:"snapshottingClusterID,omitempty"` + Status *string `json:"status,omitempty"` + TransitEncryptionEnabled *bool `json:"transitEncryptionEnabled,omitempty"` + UserGroupIDs []*string `json:"userGroupIDs,omitempty"` } // Represents the output of a PurchaseReservedCacheNodesOffering operation. diff --git a/apis/v1alpha1/user_group.go b/apis/v1alpha1/user_group.go index 7178bfa7..67cdf8f7 100644 --- a/apis/v1alpha1/user_group.go +++ b/apis/v1alpha1/user_group.go @@ -50,7 +50,7 @@ type UserGroupStatus struct { // resource // +kubebuilder:validation:Optional Conditions []*ackv1alpha1.Condition `json:"conditions"` - // A list of updates being applied to the user groups. + // A list of updates being applied to the user group. // +kubebuilder:validation:Optional PendingChanges *UserGroupPendingChanges `json:"pendingChanges,omitempty"` // A list of replication groups that the user group can access. diff --git a/apis/v1alpha1/zz_generated.deepcopy.go b/apis/v1alpha1/zz_generated.deepcopy.go index 0743b5c2..3e8e2180 100644 --- a/apis/v1alpha1/zz_generated.deepcopy.go +++ b/apis/v1alpha1/zz_generated.deepcopy.go @@ -2448,6 +2448,10 @@ func (in *ReplicationGroupStatus) DeepCopyInto(out *ReplicationGroupStatus) { *out = new(ReplicationGroupPendingModifiedValues) (*in).DeepCopyInto(*out) } + if in.ReplicationGroupCreateTime != nil { + in, out := &in.ReplicationGroupCreateTime, &out.ReplicationGroupCreateTime + *out = (*in).DeepCopy() + } if in.SnapshottingClusterID != nil { in, out := &in.SnapshottingClusterID, &out.SnapshottingClusterID *out = new(string) @@ -2581,6 +2585,10 @@ func (in *ReplicationGroup_SDK) DeepCopyInto(out *ReplicationGroup_SDK) { *out = new(ReplicationGroupPendingModifiedValues) (*in).DeepCopyInto(*out) } + if in.ReplicationGroupCreateTime != nil { + in, out := &in.ReplicationGroupCreateTime, &out.ReplicationGroupCreateTime + *out = (*in).DeepCopy() + } if in.ReplicationGroupID != nil { in, out := &in.ReplicationGroupID, &out.ReplicationGroupID *out = new(string) diff --git a/config/controller/deployment.yaml b/config/controller/deployment.yaml index b6aa4c84..367096a9 100644 --- a/config/controller/deployment.yaml +++ b/config/controller/deployment.yaml @@ -61,6 +61,7 @@ spec: drop: - ALL terminationGracePeriodSeconds: 10 + serviceAccountName: ack-elasticache-controller hostIPC: false hostNetwork: false hostPID: false diff --git a/config/controller/kustomization.yaml b/config/controller/kustomization.yaml index c9db683f..da21699b 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-elasticache-controller - newTag: latest + newName: public.ecr.aws/aws-controllers-k8s/elasticache-controller + newTag: v0.0.12 diff --git a/config/crd/bases/elasticache.services.k8s.aws_replicationgroups.yaml b/config/crd/bases/elasticache.services.k8s.aws_replicationgroups.yaml index 327ff857..bd34f00b 100644 --- a/config/crd/bases/elasticache.services.k8s.aws_replicationgroups.yaml +++ b/config/crd/bases/elasticache.services.k8s.aws_replicationgroups.yaml @@ -704,6 +704,10 @@ spec: type: array type: object type: object + replicationGroupCreateTime: + description: The date and time when the cluster was created. + format: date-time + type: string snapshottingClusterID: description: The cluster ID that is used as the daily snapshot source for the replication group. diff --git a/config/crd/bases/elasticache.services.k8s.aws_usergroups.yaml b/config/crd/bases/elasticache.services.k8s.aws_usergroups.yaml index b1117c1c..1ac985f2 100644 --- a/config/crd/bases/elasticache.services.k8s.aws_usergroups.yaml +++ b/config/crd/bases/elasticache.services.k8s.aws_usergroups.yaml @@ -129,7 +129,7 @@ spec: type: object type: array pendingChanges: - description: A list of updates being applied to the user groups. + description: A list of updates being applied to the user group. properties: userIDsToAdd: items: diff --git a/config/rbac/cluster-role-binding.yaml b/config/rbac/cluster-role-binding.yaml index 06cc2e69..59119225 100644 --- a/config/rbac/cluster-role-binding.yaml +++ b/config/rbac/cluster-role-binding.yaml @@ -8,5 +8,5 @@ roleRef: name: ack-elasticache-controller subjects: - kind: ServiceAccount - name: default + name: ack-elasticache-controller namespace: ack-system diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index 08df5b9a..eb7df60a 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 00000000..fb30bb04 --- /dev/null +++ b/config/rbac/service-account.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: ack-elasticache-controller + namespace: ack-system diff --git a/go.mod b/go.mod index a881a177..b77654c1 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/aws-controllers-k8s/elasticache-controller go 1.17 require ( - github.com/aws-controllers-k8s/runtime v0.16.3 - github.com/aws/aws-sdk-go v1.38.52 + github.com/aws-controllers-k8s/runtime v0.16.4 + github.com/aws/aws-sdk-go v1.42.0 github.com/ghodss/yaml v1.0.0 github.com/go-logr/logr v1.2.0 github.com/google/go-cmp v0.5.5 diff --git a/go.sum b/go.sum index 1ceda0ed..90cde524 100644 --- a/go.sum +++ b/go.sum @@ -64,11 +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/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= +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= @@ -594,6 +593,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 12866eca..d4945300 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 name: elasticache-chart description: A Helm chart for the ACK service controller for Amazon ElastiCache (ElastiCache) -version: v0.0.11 -appVersion: v0.0.11 +version: v0.0.12 +appVersion: v0.0.12 home: https://github.com/aws-controllers-k8s/elasticache-controller icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png sources: diff --git a/helm/crds/elasticache.services.k8s.aws_replicationgroups.yaml b/helm/crds/elasticache.services.k8s.aws_replicationgroups.yaml index 327ff857..bd34f00b 100644 --- a/helm/crds/elasticache.services.k8s.aws_replicationgroups.yaml +++ b/helm/crds/elasticache.services.k8s.aws_replicationgroups.yaml @@ -704,6 +704,10 @@ spec: type: array type: object type: object + replicationGroupCreateTime: + description: The date and time when the cluster was created. + format: date-time + type: string snapshottingClusterID: description: The cluster ID that is used as the daily snapshot source for the replication group. diff --git a/helm/crds/elasticache.services.k8s.aws_usergroups.yaml b/helm/crds/elasticache.services.k8s.aws_usergroups.yaml index b1117c1c..1ac985f2 100644 --- a/helm/crds/elasticache.services.k8s.aws_usergroups.yaml +++ b/helm/crds/elasticache.services.k8s.aws_usergroups.yaml @@ -129,7 +129,7 @@ spec: type: object type: array pendingChanges: - description: A list of updates being applied to the user groups. + description: A list of updates being applied to the user group. properties: userIDsToAdd: items: diff --git a/helm/templates/NOTES.txt b/helm/templates/NOTES.txt index fd039ffb..25e3d75c 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/elasticache-controller:v0.0.11". +This chart deploys "public.ecr.aws/aws-controllers-k8s/elasticache-controller:v0.0.12". 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 65464464..ce90c609 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -4,7 +4,7 @@ image: repository: public.ecr.aws/aws-controllers-k8s/elasticache-controller - tag: v0.0.11 + tag: v0.0.12 pullPolicy: IfNotPresent pullSecrets: [] diff --git a/pkg/resource/cache_parameter_group/manager.go b/pkg/resource/cache_parameter_group/manager.go index c4bf5816..8281712d 100644 --- a/pkg/resource/cache_parameter_group/manager.go +++ b/pkg/resource/cache_parameter_group/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/elasticache/elasticacheiface" ) +var ( + _ = ackutil.InStrings +) + // +kubebuilder:rbac:groups=elasticache.services.k8s.aws,resources=cacheparametergroups,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=elasticache.services.k8s.aws,resources=cacheparametergroups/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/cache_subnet_group/manager.go b/pkg/resource/cache_subnet_group/manager.go index 60833726..7d97165f 100644 --- a/pkg/resource/cache_subnet_group/manager.go +++ b/pkg/resource/cache_subnet_group/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/elasticache/elasticacheiface" ) +var ( + _ = ackutil.InStrings +) + // +kubebuilder:rbac:groups=elasticache.services.k8s.aws,resources=cachesubnetgroups,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=elasticache.services.k8s.aws,resources=cachesubnetgroups/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/replication_group/manager.go b/pkg/resource/replication_group/manager.go index 0556f548..de759533 100644 --- a/pkg/resource/replication_group/manager.go +++ b/pkg/resource/replication_group/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/elasticache/elasticacheiface" ) +var ( + _ = ackutil.InStrings +) + // +kubebuilder:rbac:groups=elasticache.services.k8s.aws,resources=replicationgroups,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=elasticache.services.k8s.aws,resources=replicationgroups/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/replication_group/sdk.go b/pkg/resource/replication_group/sdk.go index eabe6f53..76f8367b 100644 --- a/pkg/resource/replication_group/sdk.go +++ b/pkg/resource/replication_group/sdk.go @@ -371,6 +371,11 @@ func (rm *resourceManager) sdkFind( } else { ko.Status.PendingModifiedValues = nil } + if elem.ReplicationGroupCreateTime != nil { + ko.Status.ReplicationGroupCreateTime = &metav1.Time{*elem.ReplicationGroupCreateTime} + } else { + ko.Status.ReplicationGroupCreateTime = nil + } if elem.ReplicationGroupId != nil { ko.Spec.ReplicationGroupID = elem.ReplicationGroupId } else { @@ -402,13 +407,13 @@ func (rm *resourceManager) sdkFind( ko.Spec.TransitEncryptionEnabled = nil } if elem.UserGroupIds != nil { - f23 := []*string{} - for _, f23iter := range elem.UserGroupIds { - var f23elem string - f23elem = *f23iter - f23 = append(f23, &f23elem) + f24 := []*string{} + for _, f24iter := range elem.UserGroupIds { + var f24elem string + f24elem = *f24iter + f24 = append(f24, &f24elem) } - ko.Spec.UserGroupIDs = f23 + ko.Spec.UserGroupIDs = f24 } else { ko.Spec.UserGroupIDs = nil } @@ -803,6 +808,11 @@ func (rm *resourceManager) sdkCreate( } else { ko.Status.PendingModifiedValues = nil } + if resp.ReplicationGroup.ReplicationGroupCreateTime != nil { + ko.Status.ReplicationGroupCreateTime = &metav1.Time{*resp.ReplicationGroup.ReplicationGroupCreateTime} + } else { + ko.Status.ReplicationGroupCreateTime = nil + } if resp.ReplicationGroup.ReplicationGroupId != nil { ko.Spec.ReplicationGroupID = resp.ReplicationGroup.ReplicationGroupId } else { @@ -834,13 +844,13 @@ func (rm *resourceManager) sdkCreate( ko.Spec.TransitEncryptionEnabled = nil } if resp.ReplicationGroup.UserGroupIds != nil { - f23 := []*string{} - for _, f23iter := range resp.ReplicationGroup.UserGroupIds { - var f23elem string - f23elem = *f23iter - f23 = append(f23, &f23elem) + f24 := []*string{} + for _, f24iter := range resp.ReplicationGroup.UserGroupIds { + var f24elem string + f24elem = *f24iter + f24 = append(f24, &f24elem) } - ko.Spec.UserGroupIDs = f23 + ko.Spec.UserGroupIDs = f24 } else { ko.Spec.UserGroupIDs = nil } @@ -1450,6 +1460,11 @@ func (rm *resourceManager) sdkUpdate( } else { ko.Status.PendingModifiedValues = nil } + if resp.ReplicationGroup.ReplicationGroupCreateTime != nil { + ko.Status.ReplicationGroupCreateTime = &metav1.Time{*resp.ReplicationGroup.ReplicationGroupCreateTime} + } else { + ko.Status.ReplicationGroupCreateTime = nil + } if resp.ReplicationGroup.ReplicationGroupId != nil { ko.Spec.ReplicationGroupID = resp.ReplicationGroup.ReplicationGroupId } else { @@ -1481,13 +1496,13 @@ func (rm *resourceManager) sdkUpdate( ko.Spec.TransitEncryptionEnabled = nil } if resp.ReplicationGroup.UserGroupIds != nil { - f23 := []*string{} - for _, f23iter := range resp.ReplicationGroup.UserGroupIds { - var f23elem string - f23elem = *f23iter - f23 = append(f23, &f23elem) + f24 := []*string{} + for _, f24iter := range resp.ReplicationGroup.UserGroupIds { + var f24elem string + f24elem = *f24iter + f24 = append(f24, &f24elem) } - ko.Spec.UserGroupIDs = f23 + ko.Spec.UserGroupIDs = f24 } else { ko.Spec.UserGroupIDs = nil } @@ -2123,6 +2138,11 @@ func (rm *resourceManager) setReplicationGroupOutput( } else { ko.Status.PendingModifiedValues = nil } + if resp.ReplicationGroup.ReplicationGroupCreateTime != nil { + ko.Status.ReplicationGroupCreateTime = &metav1.Time{*resp.ReplicationGroup.ReplicationGroupCreateTime} + } else { + ko.Status.ReplicationGroupCreateTime = nil + } if resp.ReplicationGroup.ReplicationGroupId != nil { ko.Spec.ReplicationGroupID = resp.ReplicationGroup.ReplicationGroupId } else { @@ -2154,13 +2174,13 @@ func (rm *resourceManager) setReplicationGroupOutput( ko.Spec.TransitEncryptionEnabled = nil } if resp.ReplicationGroup.UserGroupIds != nil { - f23 := []*string{} - for _, f23iter := range resp.ReplicationGroup.UserGroupIds { - var f23elem string - f23elem = *f23iter - f23 = append(f23, &f23elem) + f24 := []*string{} + for _, f24iter := range resp.ReplicationGroup.UserGroupIds { + var f24elem string + f24elem = *f24iter + f24 = append(f24, &f24elem) } - ko.Spec.UserGroupIDs = f23 + ko.Spec.UserGroupIDs = f24 } else { ko.Spec.UserGroupIDs = nil } diff --git a/pkg/resource/snapshot/manager.go b/pkg/resource/snapshot/manager.go index 444bf9a3..2af15620 100644 --- a/pkg/resource/snapshot/manager.go +++ b/pkg/resource/snapshot/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/elasticache/elasticacheiface" ) +var ( + _ = ackutil.InStrings +) + // +kubebuilder:rbac:groups=elasticache.services.k8s.aws,resources=snapshots,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=elasticache.services.k8s.aws,resources=snapshots/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/user/manager.go b/pkg/resource/user/manager.go index 909d9a56..94e41d44 100644 --- a/pkg/resource/user/manager.go +++ b/pkg/resource/user/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/elasticache/elasticacheiface" ) +var ( + _ = ackutil.InStrings +) + // +kubebuilder:rbac:groups=elasticache.services.k8s.aws,resources=users,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=elasticache.services.k8s.aws,resources=users/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/user_group/manager.go b/pkg/resource/user_group/manager.go index 2a74e885..9693f541 100644 --- a/pkg/resource/user_group/manager.go +++ b/pkg/resource/user_group/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/elasticache/elasticacheiface" ) +var ( + _ = ackutil.InStrings +) + // +kubebuilder:rbac:groups=elasticache.services.k8s.aws,resources=usergroups,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=elasticache.services.k8s.aws,resources=usergroups/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(