From 0752a7c008ebf70105de221f59a3b1aa64d9c9d3 Mon Sep 17 00:00:00 2001 From: ci-robot Date: Thu, 2 Feb 2023 18:21:10 +0000 Subject: [PATCH] Update to ACK runtime `v0.23.0`, code-generator `v0.23.1` --- apis/v1alpha1/ack-generate-metadata.yaml | 10 +- apis/v1alpha1/cache_parameter_group.go | 1 + apis/v1alpha1/cache_subnet_group.go | 5 +- apis/v1alpha1/replication_group.go | 122 +++++++++--------- apis/v1alpha1/snapshot.go | 1 + apis/v1alpha1/types.go | 94 +++++++------- apis/v1alpha1/user.go | 1 + apis/v1alpha1/user_group.go | 1 + config/controller/deployment.yaml | 9 +- config/controller/kustomization.yaml | 2 +- config/controller/service.yaml | 2 +- .../services.k8s.aws_adoptedresources.yaml | 10 +- .../bases/services.k8s.aws_fieldexports.yaml | 9 +- go.mod | 4 +- go.sum | 15 +-- helm/Chart.yaml | 4 +- ...he.services.k8s.aws_cachesubnetgroups.yaml | 4 +- ...he.services.k8s.aws_replicationgroups.yaml | 36 +++--- helm/templates/NOTES.txt | 2 +- helm/templates/deployment.yaml | 7 +- helm/templates/metrics-service.yaml | 1 - helm/values.schema.json | 4 + helm/values.yaml | 7 +- pkg/common/delta.go | 2 +- pkg/resource/cache_parameter_group/tags.go | 10 +- pkg/resource/cache_subnet_group/tags.go | 10 +- pkg/resource/replication_group/delta_util.go | 3 +- .../replication_group/post_set_output.go | 11 +- pkg/resource/replication_group/tags.go | 10 +- pkg/resource/snapshot/tags.go | 10 +- pkg/resource/user/tags.go | 10 +- pkg/resource/user_group/tags.go | 10 +- pkg/testutil/test_suite_runner.go | 20 +-- 33 files changed, 229 insertions(+), 218 deletions(-) diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index 5ed02447..4df98e0a 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,9 +1,9 @@ ack_generate_info: - build_date: "2022-10-20T18:12:15Z" - build_hash: 5ee0ac052c54f008dff50f6f5ebb73f2cf3a0bd7 - go_version: go1.18.1 - version: v0.20.1-4-g5ee0ac0 -api_directory_checksum: b23d56789f6d360f338415c3242f27df04e79403 + build_date: "2023-02-02T18:21:00Z" + build_hash: b55ae8752ece381c383ffe5b388ed2147c6b30d8 + go_version: go1.19 + version: v0.23.1 +api_directory_checksum: 885f952f7ca2ce7a676b9bbf8eb262de71de6238 api_version: v1alpha1 aws_sdk_go_version: v1.44.93 generator_config_info: diff --git a/apis/v1alpha1/cache_parameter_group.go b/apis/v1alpha1/cache_parameter_group.go index 89904a35..a74dd72c 100644 --- a/apis/v1alpha1/cache_parameter_group.go +++ b/apis/v1alpha1/cache_parameter_group.go @@ -24,6 +24,7 @@ import ( // // Represents the output of a CreateCacheParameterGroup operation. type CacheParameterGroupSpec struct { + // The name of the cache parameter group family that the cache parameter group // can be used with. // diff --git a/apis/v1alpha1/cache_subnet_group.go b/apis/v1alpha1/cache_subnet_group.go index a313271b..813498e8 100644 --- a/apis/v1alpha1/cache_subnet_group.go +++ b/apis/v1alpha1/cache_subnet_group.go @@ -24,10 +24,11 @@ import ( // // Represents the output of one of the following operations: // -// * CreateCacheSubnetGroup +// - CreateCacheSubnetGroup // -// * ModifyCacheSubnetGroup +// - ModifyCacheSubnetGroup type CacheSubnetGroupSpec struct { + // A description for the cache subnet group. // +kubebuilder:validation:Required CacheSubnetGroupDescription *string `json:"cacheSubnetGroupDescription"` diff --git a/apis/v1alpha1/replication_group.go b/apis/v1alpha1/replication_group.go index 28c2f82f..c0cb2757 100644 --- a/apis/v1alpha1/replication_group.go +++ b/apis/v1alpha1/replication_group.go @@ -24,6 +24,7 @@ import ( // // Contains all of the attributes of a specific Redis replication group. type ReplicationGroupSpec struct { + // A flag that enables encryption at rest when set to true. // // You cannot modify the value of AtRestEncryptionEnabled after the replication @@ -46,13 +47,13 @@ type ReplicationGroupSpec struct { // // Password constraints: // - // * Must be only printable ASCII characters. + // - Must be only printable ASCII characters. // - // * Must be at least 16 characters and no more than 128 characters in length. + // - Must be at least 16 characters and no more than 128 characters in length. // - // * The only permitted printable special characters are !, &, #, $, ^, <, - // >, and -. Other printable special characters cannot be used in the AUTH - // token. + // - The only permitted printable special characters are !, &, #, $, ^, <, + // >, and -. Other printable special characters cannot be used in the AUTH + // token. // // For more information, see AUTH password (http://redis.io/commands/AUTH) at // http://redis.io/commands/AUTH. @@ -71,55 +72,55 @@ type ReplicationGroupSpec struct { // the current generation types provide more memory and computational power // at lower cost when compared to their equivalent previous generation counterparts. // - // * General purpose: Current generation: M6g node types (available only - // for Redis engine version 5.0.6 onward and for Memcached engine version - // 1.5.16 onward): cache.m6g.large, cache.m6g.xlarge, cache.m6g.2xlarge, - // cache.m6g.4xlarge, cache.m6g.8xlarge, cache.m6g.12xlarge, cache.m6g.16xlarge - // For region availability, see Supported Node Types (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion) - // M5 node types: cache.m5.large, cache.m5.xlarge, cache.m5.2xlarge, cache.m5.4xlarge, - // cache.m5.12xlarge, cache.m5.24xlarge M4 node types: cache.m4.large, cache.m4.xlarge, - // cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge T4g node types (available - // only for Redis engine version 5.0.6 onward and Memcached engine version - // 1.5.16 onward): cache.t4g.micro, cache.t4g.small, cache.t4g.medium T3 - // node types: cache.t3.micro, cache.t3.small, cache.t3.medium T2 node types: - // cache.t2.micro, cache.t2.small, cache.t2.medium Previous generation: (not - // recommended. Existing clusters are still supported but creation of new - // clusters is not supported for these types.) T1 node types: cache.t1.micro - // M1 node types: cache.m1.small, cache.m1.medium, cache.m1.large, cache.m1.xlarge - // M3 node types: cache.m3.medium, cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge - // - // * Compute optimized: Previous generation: (not recommended. Existing clusters - // are still supported but creation of new clusters is not supported for - // these types.) C1 node types: cache.c1.xlarge - // - // * Memory optimized with data tiering: Current generation: R6gd node types - // (available only for Redis engine version 6.2 onward). cache.r6gd.xlarge, - // cache.r6gd.2xlarge, cache.r6gd.4xlarge, cache.r6gd.8xlarge, cache.r6gd.12xlarge, - // cache.r6gd.16xlarge - // - // * Memory optimized: Current generation: R6g node types (available only - // for Redis engine version 5.0.6 onward and for Memcached engine version - // 1.5.16 onward). cache.r6g.large, cache.r6g.xlarge, cache.r6g.2xlarge, - // cache.r6g.4xlarge, cache.r6g.8xlarge, cache.r6g.12xlarge, cache.r6g.16xlarge - // For region availability, see Supported Node Types (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion) - // R5 node types: cache.r5.large, cache.r5.xlarge, cache.r5.2xlarge, cache.r5.4xlarge, - // cache.r5.12xlarge, cache.r5.24xlarge R4 node types: cache.r4.large, cache.r4.xlarge, - // cache.r4.2xlarge, cache.r4.4xlarge, cache.r4.8xlarge, cache.r4.16xlarge - // Previous generation: (not recommended. Existing clusters are still supported - // but creation of new clusters is not supported for these types.) M2 node - // types: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge R3 node types: - // cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, cache.r3.8xlarge + // - General purpose: Current generation: M6g node types (available only + // for Redis engine version 5.0.6 onward and for Memcached engine version + // 1.5.16 onward): cache.m6g.large, cache.m6g.xlarge, cache.m6g.2xlarge, + // cache.m6g.4xlarge, cache.m6g.8xlarge, cache.m6g.12xlarge, cache.m6g.16xlarge + // For region availability, see Supported Node Types (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion) + // M5 node types: cache.m5.large, cache.m5.xlarge, cache.m5.2xlarge, cache.m5.4xlarge, + // cache.m5.12xlarge, cache.m5.24xlarge M4 node types: cache.m4.large, cache.m4.xlarge, + // cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge T4g node types (available + // only for Redis engine version 5.0.6 onward and Memcached engine version + // 1.5.16 onward): cache.t4g.micro, cache.t4g.small, cache.t4g.medium T3 + // node types: cache.t3.micro, cache.t3.small, cache.t3.medium T2 node types: + // cache.t2.micro, cache.t2.small, cache.t2.medium Previous generation: (not + // recommended. Existing clusters are still supported but creation of new + // clusters is not supported for these types.) T1 node types: cache.t1.micro + // M1 node types: cache.m1.small, cache.m1.medium, cache.m1.large, cache.m1.xlarge + // M3 node types: cache.m3.medium, cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge + // + // - Compute optimized: Previous generation: (not recommended. Existing clusters + // are still supported but creation of new clusters is not supported for + // these types.) C1 node types: cache.c1.xlarge + // + // - Memory optimized with data tiering: Current generation: R6gd node types + // (available only for Redis engine version 6.2 onward). cache.r6gd.xlarge, + // cache.r6gd.2xlarge, cache.r6gd.4xlarge, cache.r6gd.8xlarge, cache.r6gd.12xlarge, + // cache.r6gd.16xlarge + // + // - Memory optimized: Current generation: R6g node types (available only + // for Redis engine version 5.0.6 onward and for Memcached engine version + // 1.5.16 onward). cache.r6g.large, cache.r6g.xlarge, cache.r6g.2xlarge, + // cache.r6g.4xlarge, cache.r6g.8xlarge, cache.r6g.12xlarge, cache.r6g.16xlarge + // For region availability, see Supported Node Types (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion) + // R5 node types: cache.r5.large, cache.r5.xlarge, cache.r5.2xlarge, cache.r5.4xlarge, + // cache.r5.12xlarge, cache.r5.24xlarge R4 node types: cache.r4.large, cache.r4.xlarge, + // cache.r4.2xlarge, cache.r4.4xlarge, cache.r4.8xlarge, cache.r4.16xlarge + // Previous generation: (not recommended. Existing clusters are still supported + // but creation of new clusters is not supported for these types.) M2 node + // types: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge R3 node types: + // cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, cache.r3.8xlarge // // Additional node type info // - // * All current generation instance types are created in Amazon VPC by default. + // - All current generation instance types are created in Amazon VPC by default. // - // * Redis append-only files (AOF) are not supported for T1 or T2 instances. + // - Redis append-only files (AOF) are not supported for T1 or T2 instances. // - // * Redis Multi-AZ with automatic failover is not supported on T1 instances. + // - Redis Multi-AZ with automatic failover is not supported on T1 instances. // - // * Redis configuration variables appendonly and appendfsync are not supported - // on Redis version 2.8.22 and later. + // - Redis configuration variables appendonly and appendfsync are not supported + // on Redis version 2.8.22 and later. CacheNodeType *string `json:"cacheNodeType,omitempty"` // The name of the parameter group to associate with this replication group. // If this argument is omitted, the default cache parameter group for the specified @@ -129,9 +130,9 @@ type ReplicationGroupSpec struct { // and want to use a default parameter group, we recommend that you specify // the parameter group by name. // - // * To create a Redis (cluster mode disabled) replication group, use CacheParameterGroupName=default.redis3.2. + // - To create a Redis (cluster mode disabled) replication group, use CacheParameterGroupName=default.redis3.2. // - // * To create a Redis (cluster mode enabled) replication group, use CacheParameterGroupName=default.redis3.2.cluster.on. + // - To create a Redis (cluster mode enabled) replication group, use CacheParameterGroupName=default.redis3.2.cluster.on. CacheParameterGroupName *string `json:"cacheParameterGroupName,omitempty"` // A list of cache security group names to associate with this replication group. CacheSecurityGroupNames []*string `json:"cacheSecurityGroupNames,omitempty"` @@ -220,19 +221,19 @@ type ReplicationGroupSpec struct { // // Valid values for ddd are: // - // * sun + // - sun // - // * mon + // - mon // - // * tue + // - tue // - // * wed + // - wed // - // * thu + // - thu // - // * fri + // - fri // - // * sat + // - sat // // Example: sun:23:00-mon:01:30 PreferredMaintenanceWindow *string `json:"preferredMaintenanceWindow,omitempty"` @@ -250,11 +251,12 @@ type ReplicationGroupSpec struct { // // Constraints: // - // * A name must contain from 1 to 40 alphanumeric characters or hyphens. + // - A name must contain from 1 to 40 alphanumeric characters or hyphens. + // + // - The first character must be a letter. // - // * The first character must be a letter. + // - A name cannot end with a hyphen or contain two consecutive hyphens. // - // * A name cannot end with a hyphen or contain two consecutive hyphens. // +kubebuilder:validation:Required ReplicationGroupID *string `json:"replicationGroupID"` // One or more Amazon VPC security groups associated with this replication group. diff --git a/apis/v1alpha1/snapshot.go b/apis/v1alpha1/snapshot.go index a5b92817..8b29231e 100644 --- a/apis/v1alpha1/snapshot.go +++ b/apis/v1alpha1/snapshot.go @@ -25,6 +25,7 @@ import ( // Represents a copy of an entire Redis cluster as of the time when the snapshot // was taken. type SnapshotSpec struct { + // The identifier of an existing cluster. The snapshot is created from this // cluster. CacheClusterID *string `json:"cacheClusterID,omitempty"` diff --git a/apis/v1alpha1/types.go b/apis/v1alpha1/types.go index 4067ebe4..ea28aaa0 100644 --- a/apis/v1alpha1/types.go +++ b/apis/v1alpha1/types.go @@ -86,55 +86,55 @@ type CacheEngineVersion struct { // the current generation types provide more memory and computational power // at lower cost when compared to their equivalent previous generation counterparts. // -// * General purpose: Current generation: M6g node types: (available only -// for Redis engine version 5.0.6 onward and for Memcached engine version -// 1.5.16 onward): cache.m6g.large, cache.m6g.xlarge, cache.m6g.2xlarge, -// cache.m6g.4xlarge, cache.m6g.8xlarge, cache.m6g.12xlarge, cache.m6g.16xlarge -// For region availability, see Supported Node Types (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion) -// M5 node types: cache.m5.large, cache.m5.xlarge, cache.m5.2xlarge, cache.m5.4xlarge, -// cache.m5.12xlarge, cache.m5.24xlarge M4 node types: cache.m4.large, cache.m4.xlarge, -// cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge T4g node types (available -// only for Redis engine version 5.0.6 onward and for Memcached engine version -// 1.5.16 onward): cache.t4g.micro, cache.t4g.small, cache.t4g.medium T3 -// node types: cache.t3.micro, cache.t3.small, cache.t3.medium T2 node types: -// cache.t2.micro, cache.t2.small, cache.t2.medium Previous generation: (not -// recommended. Existing clusters are still supported but creation of new -// clusters is not supported for these types.) T1 node types: cache.t1.micro -// M1 node types: cache.m1.small, cache.m1.medium, cache.m1.large, cache.m1.xlarge -// M3 node types: cache.m3.medium, cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge +// - General purpose: Current generation: M6g node types: (available only +// for Redis engine version 5.0.6 onward and for Memcached engine version +// 1.5.16 onward): cache.m6g.large, cache.m6g.xlarge, cache.m6g.2xlarge, +// cache.m6g.4xlarge, cache.m6g.8xlarge, cache.m6g.12xlarge, cache.m6g.16xlarge +// For region availability, see Supported Node Types (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion) +// M5 node types: cache.m5.large, cache.m5.xlarge, cache.m5.2xlarge, cache.m5.4xlarge, +// cache.m5.12xlarge, cache.m5.24xlarge M4 node types: cache.m4.large, cache.m4.xlarge, +// cache.m4.2xlarge, cache.m4.4xlarge, cache.m4.10xlarge T4g node types (available +// only for Redis engine version 5.0.6 onward and for Memcached engine version +// 1.5.16 onward): cache.t4g.micro, cache.t4g.small, cache.t4g.medium T3 +// node types: cache.t3.micro, cache.t3.small, cache.t3.medium T2 node types: +// cache.t2.micro, cache.t2.small, cache.t2.medium Previous generation: (not +// recommended. Existing clusters are still supported but creation of new +// clusters is not supported for these types.) T1 node types: cache.t1.micro +// M1 node types: cache.m1.small, cache.m1.medium, cache.m1.large, cache.m1.xlarge +// M3 node types: cache.m3.medium, cache.m3.large, cache.m3.xlarge, cache.m3.2xlarge // -// * Compute optimized: Previous generation: (not recommended. Existing clusters -// are still supported but creation of new clusters is not supported for -// these types.) C1 node types: cache.c1.xlarge +// - Compute optimized: Previous generation: (not recommended. Existing clusters +// are still supported but creation of new clusters is not supported for +// these types.) C1 node types: cache.c1.xlarge // -// * Memory optimized with data tiering: Current generation: R6gd node types -// (available only for Redis engine version 6.2 onward). cache.r6gd.xlarge, -// cache.r6gd.2xlarge, cache.r6gd.4xlarge, cache.r6gd.8xlarge, cache.r6gd.12xlarge, -// cache.r6gd.16xlarge +// - Memory optimized with data tiering: Current generation: R6gd node types +// (available only for Redis engine version 6.2 onward). cache.r6gd.xlarge, +// cache.r6gd.2xlarge, cache.r6gd.4xlarge, cache.r6gd.8xlarge, cache.r6gd.12xlarge, +// cache.r6gd.16xlarge // -// * Memory optimized: Current generation: R6g node types (available only -// for Redis engine version 5.0.6 onward and for Memcached engine version -// 1.5.16 onward). cache.r6g.large, cache.r6g.xlarge, cache.r6g.2xlarge, -// cache.r6g.4xlarge, cache.r6g.8xlarge, cache.r6g.12xlarge, cache.r6g.16xlarge -// For region availability, see Supported Node Types (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion) -// R5 node types: cache.r5.large, cache.r5.xlarge, cache.r5.2xlarge, cache.r5.4xlarge, -// cache.r5.12xlarge, cache.r5.24xlarge R4 node types: cache.r4.large, cache.r4.xlarge, -// cache.r4.2xlarge, cache.r4.4xlarge, cache.r4.8xlarge, cache.r4.16xlarge -// Previous generation: (not recommended. Existing clusters are still supported -// but creation of new clusters is not supported for these types.) M2 node -// types: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge R3 node types: -// cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, cache.r3.8xlarge +// - Memory optimized: Current generation: R6g node types (available only +// for Redis engine version 5.0.6 onward and for Memcached engine version +// 1.5.16 onward). cache.r6g.large, cache.r6g.xlarge, cache.r6g.2xlarge, +// cache.r6g.4xlarge, cache.r6g.8xlarge, cache.r6g.12xlarge, cache.r6g.16xlarge +// For region availability, see Supported Node Types (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion) +// R5 node types: cache.r5.large, cache.r5.xlarge, cache.r5.2xlarge, cache.r5.4xlarge, +// cache.r5.12xlarge, cache.r5.24xlarge R4 node types: cache.r4.large, cache.r4.xlarge, +// cache.r4.2xlarge, cache.r4.4xlarge, cache.r4.8xlarge, cache.r4.16xlarge +// Previous generation: (not recommended. Existing clusters are still supported +// but creation of new clusters is not supported for these types.) M2 node +// types: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge R3 node types: +// cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, cache.r3.8xlarge // // Additional node type info // -// * All current generation instance types are created in Amazon VPC by default. +// - All current generation instance types are created in Amazon VPC by default. // -// * Redis append-only files (AOF) are not supported for T1 or T2 instances. +// - Redis append-only files (AOF) are not supported for T1 or T2 instances. // -// * Redis Multi-AZ with automatic failover is not supported on T1 instances. +// - Redis Multi-AZ with automatic failover is not supported on T1 instances. // -// * Redis configuration variables appendonly and appendfsync are not supported -// on Redis version 2.8.22 and later. +// - Redis configuration variables appendonly and appendfsync are not supported +// on Redis version 2.8.22 and later. type CacheNode struct { CacheNodeCreateTime *metav1.Time `json:"cacheNodeCreateTime,omitempty"` CacheNodeID *string `json:"cacheNodeID,omitempty"` @@ -195,11 +195,11 @@ type CacheParameterGroup_SDK struct { // Represents the output of one of the following operations: // -// * AuthorizeCacheSecurityGroupIngress +// - AuthorizeCacheSecurityGroupIngress // -// * CreateCacheSecurityGroup +// - CreateCacheSecurityGroup // -// * RevokeCacheSecurityGroupIngress +// - RevokeCacheSecurityGroupIngress type CacheSecurityGroup struct { ARN *string `json:"arn,omitempty"` CacheSecurityGroupName *string `json:"cacheSecurityGroupName,omitempty"` @@ -215,9 +215,9 @@ type CacheSecurityGroupMembership struct { // Represents the output of one of the following operations: // -// * CreateCacheSubnetGroup +// - CreateCacheSubnetGroup // -// * ModifyCacheSubnetGroup +// - ModifyCacheSubnetGroup type CacheSubnetGroup_SDK struct { ARN *string `json:"arn,omitempty"` CacheSubnetGroupDescription *string `json:"cacheSubnetGroupDescription,omitempty"` @@ -302,8 +302,8 @@ type GlobalNodeGroup struct { // 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. +// - The GlobalReplicationGroupIdSuffix represents the name of the Global +// datastore, which is what you use to associate a secondary cluster. type GlobalReplicationGroup struct { ARN *string `json:"arn,omitempty"` AtRestEncryptionEnabled *bool `json:"atRestEncryptionEnabled,omitempty"` diff --git a/apis/v1alpha1/user.go b/apis/v1alpha1/user.go index aa3c175b..1be62ed7 100644 --- a/apis/v1alpha1/user.go +++ b/apis/v1alpha1/user.go @@ -24,6 +24,7 @@ import ( // type UserSpec struct { + // Access permissions string used for this user. // +kubebuilder:validation:Required AccessString *string `json:"accessString"` diff --git a/apis/v1alpha1/user_group.go b/apis/v1alpha1/user_group.go index 81e77e5d..1cd3b17f 100644 --- a/apis/v1alpha1/user_group.go +++ b/apis/v1alpha1/user_group.go @@ -24,6 +24,7 @@ import ( // type UserGroupSpec struct { + // The current supported value is Redis. // +kubebuilder:validation:Required Engine *string `json:"engine"` diff --git a/config/controller/deployment.yaml b/config/controller/deployment.yaml index 331c62a6..3b47cc8d 100644 --- a/config/controller/deployment.yaml +++ b/config/controller/deployment.yaml @@ -1,8 +1,6 @@ apiVersion: v1 kind: Namespace metadata: - labels: - control-plane: controller name: ack-system --- apiVersion: apps/v1 @@ -11,16 +9,17 @@ metadata: name: ack-elasticache-controller namespace: ack-system labels: - control-plane: controller + app.kubernetes.io/name: ack-elasticache-controller + app.kubernetes.io/part-of: ack-system spec: selector: matchLabels: - control-plane: controller + app.kubernetes.io/name: ack-elasticache-controller replicas: 1 template: metadata: labels: - control-plane: controller + app.kubernetes.io/name: ack-elasticache-controller spec: containers: - command: diff --git a/config/controller/kustomization.yaml b/config/controller/kustomization.yaml index cd9f7513..39f753e2 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/elasticache-controller - newTag: v0.0.20 + newTag: v0.0.21 diff --git a/config/controller/service.yaml b/config/controller/service.yaml index 3b855505..f85a3d13 100644 --- a/config/controller/service.yaml +++ b/config/controller/service.yaml @@ -5,7 +5,7 @@ metadata: namespace: ack-system spec: selector: - control-plane: controller + app.kubernetes.io/name: ack-elasticache-controller ports: - name: metricsport port: 8080 diff --git a/config/crd/common/bases/services.k8s.aws_adoptedresources.yaml b/config/crd/common/bases/services.k8s.aws_adoptedresources.yaml index f764dbbc..7dca541d 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 a435de84..4a7ab61b 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 f204fcda..1fa4d12f 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/aws-controllers-k8s/elasticache-controller -go 1.17 +go 1.19 require ( - github.com/aws-controllers-k8s/runtime v0.20.1 + github.com/aws-controllers-k8s/runtime v0.23.0 github.com/aws/aws-sdk-go v1.44.93 github.com/ghodss/yaml v1.0.0 github.com/go-logr/logr v1.2.0 diff --git a/go.sum b/go.sum index f7a9791e..99e41d1c 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.23.0 h1:xM/zKyFzqbSr4gN9/cMRyjUUEEezHB0inpcsSV5clkg= +github.com/aws-controllers-k8s/runtime v0.23.0/go.mod h1:vBsKxMSP7Ya2Mv5KPGadu6OuIESTX+YIZB/2dOV7gXo= 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= @@ -84,7 +84,6 @@ github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -164,7 +163,6 @@ github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -362,20 +360,16 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -502,7 +496,6 @@ go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= @@ -599,7 +592,6 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= 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-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -678,7 +670,6 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -695,7 +686,6 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -771,7 +761,6 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= diff --git a/helm/Chart.yaml b/helm/Chart.yaml index d2535ae1..35e7565c 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.20 -appVersion: v0.0.20 +version: v0.0.21 +appVersion: v0.0.21 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_cachesubnetgroups.yaml b/helm/crds/elasticache.services.k8s.aws_cachesubnetgroups.yaml index 239672d1..ddf6f43f 100644 --- a/helm/crds/elasticache.services.k8s.aws_cachesubnetgroups.yaml +++ b/helm/crds/elasticache.services.k8s.aws_cachesubnetgroups.yaml @@ -34,8 +34,8 @@ spec: type: object spec: description: "CacheSubnetGroupSpec defines the desired state of CacheSubnetGroup. - \n Represents the output of one of the following operations: \n * CreateCacheSubnetGroup - \n * ModifyCacheSubnetGroup" + \n Represents the output of one of the following operations: \n - CreateCacheSubnetGroup + \n - ModifyCacheSubnetGroup" properties: cacheSubnetGroupDescription: description: A description for the cache subnet group. diff --git a/helm/crds/elasticache.services.k8s.aws_replicationgroups.yaml b/helm/crds/elasticache.services.k8s.aws_replicationgroups.yaml index 6bc450eb..47055dfb 100644 --- a/helm/crds/elasticache.services.k8s.aws_replicationgroups.yaml +++ b/helm/crds/elasticache.services.k8s.aws_replicationgroups.yaml @@ -50,9 +50,9 @@ spec: protected server. \n AuthToken can be specified only on replication groups where TransitEncryptionEnabled is true. \n For HIPAA compliance, you must specify TransitEncryptionEnabled as true, an AuthToken, - and a CacheSubnetGroup. \n Password constraints: \n * Must be only - printable ASCII characters. \n * Must be at least 16 characters - and no more than 128 characters in length. \n * The only permitted + and a CacheSubnetGroup. \n Password constraints: \n - Must be only + printable ASCII characters. \n - Must be at least 16 characters + and no more than 128 characters in length. \n - The only permitted printable special characters are !, &, #, $, ^, <, >, and -. Other printable special characters cannot be used in the AUTH token. \n For more information, see AUTH password (http://redis.io/commands/AUTH) @@ -84,7 +84,7 @@ spec: node group (shard). \n The following node types are supported by ElastiCache. Generally speaking, the current generation types provide more memory and computational power at lower cost when compared - to their equivalent previous generation counterparts. \n * General + to their equivalent previous generation counterparts. \n - General purpose: Current generation: M6g node types (available only for Redis engine version 5.0.6 onward and for Memcached engine version 1.5.16 onward): cache.m6g.large, cache.m6g.xlarge, cache.m6g.2xlarge, @@ -102,14 +102,14 @@ spec: is not supported for these types.) T1 node types: cache.t1.micro M1 node types: cache.m1.small, cache.m1.medium, cache.m1.large, cache.m1.xlarge M3 node types: cache.m3.medium, cache.m3.large, - cache.m3.xlarge, cache.m3.2xlarge \n * Compute optimized: Previous + cache.m3.xlarge, cache.m3.2xlarge \n - Compute optimized: Previous generation: (not recommended. Existing clusters are still supported but creation of new clusters is not supported for these types.) - C1 node types: cache.c1.xlarge \n * Memory optimized with data tiering: + C1 node types: cache.c1.xlarge \n - Memory optimized with data tiering: Current generation: R6gd node types (available only for Redis engine version 6.2 onward). cache.r6gd.xlarge, cache.r6gd.2xlarge, cache.r6gd.4xlarge, cache.r6gd.8xlarge, cache.r6gd.12xlarge, cache.r6gd.16xlarge \n - * Memory optimized: Current generation: R6g node types (available + - Memory optimized: Current generation: R6g node types (available only for Redis engine version 5.0.6 onward and for Memcached engine version 1.5.16 onward). cache.r6g.large, cache.r6g.xlarge, cache.r6g.2xlarge, cache.r6g.4xlarge, cache.r6g.8xlarge, cache.r6g.12xlarge, cache.r6g.16xlarge @@ -122,11 +122,11 @@ spec: is not supported for these types.) M2 node types: cache.m2.xlarge, cache.m2.2xlarge, cache.m2.4xlarge R3 node types: cache.r3.large, cache.r3.xlarge, cache.r3.2xlarge, cache.r3.4xlarge, cache.r3.8xlarge - \n Additional node type info \n * All current generation instance - types are created in Amazon VPC by default. \n * Redis append-only - files (AOF) are not supported for T1 or T2 instances. \n * Redis + \n Additional node type info \n - All current generation instance + types are created in Amazon VPC by default. \n - Redis append-only + files (AOF) are not supported for T1 or T2 instances. \n - Redis Multi-AZ with automatic failover is not supported on T1 instances. - \n * Redis configuration variables appendonly and appendfsync are + \n - Redis configuration variables appendonly and appendfsync are not supported on Redis version 2.8.22 and later." type: string cacheParameterGroupName: @@ -135,9 +135,9 @@ spec: parameter group for the specified engine is used. \n If you are running Redis version 3.2.4 or later, only one node group (shard), and want to use a default parameter group, we recommend that you - specify the parameter group by name. \n * To create a Redis (cluster + specify the parameter group by name. \n - To create a Redis (cluster mode disabled) replication group, use CacheParameterGroupName=default.redis3.2. - \n * To create a Redis (cluster mode enabled) replication group, + \n - To create a Redis (cluster mode enabled) replication group, use CacheParameterGroupName=default.redis3.2.cluster.on." type: string cacheSecurityGroupNames: @@ -297,8 +297,8 @@ spec: the weekly time range during which maintenance on the cluster is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period. - \n Valid values for ddd are: \n * sun \n * mon \n * tue \n * wed - \n * thu \n * fri \n * sat \n Example: sun:23:00-mon:01:30" + \n Valid values for ddd are: \n - sun \n - mon \n - tue \n - wed + \n - thu \n - fri \n - sat \n Example: sun:23:00-mon:01:30" type: string primaryClusterID: description: "The identifier of the cluster that serves as the primary @@ -313,9 +313,9 @@ spec: type: integer replicationGroupID: description: "The replication group identifier. This parameter is - stored as a lowercase string. \n Constraints: \n * A name must contain - from 1 to 40 alphanumeric characters or hyphens. \n * The first - character must be a letter. \n * A name cannot end with a hyphen + stored as a lowercase string. \n Constraints: \n - A name must contain + from 1 to 40 alphanumeric characters or hyphens. \n - The first + character must be a letter. \n - A name cannot end with a hyphen or contain two consecutive hyphens." type: string securityGroupIDs: diff --git a/helm/templates/NOTES.txt b/helm/templates/NOTES.txt index 0f1228e1..469765f2 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.20". +This chart deploys "public.ecr.aws/aws-controllers-k8s/elasticache-controller:v0.0.21". 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 8cc8f687..80c0922d 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -10,7 +10,6 @@ metadata: app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} k8s-app: {{ include "app.name" . }} helm.sh/chart: {{ include "chart.name-version" . }} - control-plane: controller spec: replicas: 1 selector: @@ -55,6 +54,8 @@ spec: - "$(ACK_RESOURCE_TAGS)" - --watch-namespace - "$(ACK_WATCH_NAMESPACE)" + - --deletion-policy + - "$(DELETION_POLICY)" image: {{ .Values.image.repository }}:{{ .Values.image.tag }} imagePullPolicy: {{ .Values.image.pullPolicy }} name: controller @@ -74,6 +75,8 @@ spec: value: {{ .Values.aws.endpoint_url | quote }} - name: ACK_WATCH_NAMESPACE value: {{ include "watch-namespace" . }} + - name: DELETION_POLICY + value: {{ .Values.deletionPolicy }} - name: ACK_ENABLE_DEVELOPMENT_LOGGING value: {{ .Values.log.enable_development_logging | quote }} - name: ACK_LOG_LEVEL @@ -89,7 +92,7 @@ spec: - name: {{ .Values.aws.credentials.secretName }} mountPath: {{ include "aws.credentials.secret_mount_path" . }} readOnly: true - {{- end }} + {{- end }} securityContext: allowPrivilegeEscalation: false privileged: false diff --git a/helm/templates/metrics-service.yaml b/helm/templates/metrics-service.yaml index a010fa64..638858a3 100644 --- a/helm/templates/metrics-service.yaml +++ b/helm/templates/metrics-service.yaml @@ -11,7 +11,6 @@ metadata: app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} k8s-app: {{ include "app.name" . }} helm.sh/chart: {{ include "chart.name-version" . }} - control-plane: controller spec: selector: app.kubernetes.io/name: {{ include "app.name" . }} diff --git a/helm/values.schema.json b/helm/values.schema.json index 86a7580f..267c541c 100644 --- a/helm/values.schema.json +++ b/helm/values.schema.json @@ -203,6 +203,10 @@ "pattern": "(^$|^.*=.*$)" } }, + "deletionPolicy": { + "type": "string", + "enum": ["delete", "retain"] + }, "serviceAccount": { "description": "ServiceAccount settings", "properties": { diff --git a/helm/values.yaml b/helm/values.yaml index 4d8303e2..3349b618 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.20 + tag: v0.0.21 pullPolicy: IfNotPresent pullSecrets: [] @@ -78,6 +78,11 @@ resourceTags: - services.k8s.aws/controller-version=%CONTROLLER_SERVICE%-%CONTROLLER_VERSION% - services.k8s.aws/namespace=%K8S_NAMESPACE% +# Set to "retain" to keep all AWS resources intact even after the K8s resources +# have been deleted. By default, the ACK controller will delete the AWS resource +# before the K8s resource is removed. +deletionPolicy: delete + serviceAccount: # Specifies whether a service account should be created create: true diff --git a/pkg/common/delta.go b/pkg/common/delta.go index 7f367d00..3d1fffbc 100644 --- a/pkg/common/delta.go +++ b/pkg/common/delta.go @@ -16,7 +16,7 @@ package common import ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare" // remove the Difference corresponding to the given subject from the delta struct -//TODO: ideally this would have a common implementation in compare/delta.go +// TODO: ideally this would have a common implementation in compare/delta.go func RemoveFromDelta( delta *ackcompare.Delta, subject string, diff --git a/pkg/resource/cache_parameter_group/tags.go b/pkg/resource/cache_parameter_group/tags.go index 6fd51f82..b550a785 100644 --- a/pkg/resource/cache_parameter_group/tags.go +++ b/pkg/resource/cache_parameter_group/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/cache_subnet_group/tags.go b/pkg/resource/cache_subnet_group/tags.go index 68e88d3b..f722c7c7 100644 --- a/pkg/resource/cache_subnet_group/tags.go +++ b/pkg/resource/cache_subnet_group/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/replication_group/delta_util.go b/pkg/resource/replication_group/delta_util.go index 56acce4c..df697c84 100644 --- a/pkg/resource/replication_group/delta_util.go +++ b/pkg/resource/replication_group/delta_util.go @@ -72,7 +72,8 @@ func modifyDelta( // returns true if desired and latest engine versions match and false otherwise // precondition: both desiredEV and latestEV are non-nil // this handles the case where only the major EV is specified, e.g. "6.x" (or similar), but the latest -// version shows the minor version, e.g. "6.0.5" +// +// version shows the minor version, e.g. "6.0.5" func engineVersionsMatch( desiredEV string, latestEV string, diff --git a/pkg/resource/replication_group/post_set_output.go b/pkg/resource/replication_group/post_set_output.go index 3ba18bf0..21ea6af7 100644 --- a/pkg/resource/replication_group/post_set_output.go +++ b/pkg/resource/replication_group/post_set_output.go @@ -21,10 +21,10 @@ import ( ) /* - To be called in sdkFind, this function updates the replication group's Spec fields with the latest observed state - This requires extra processing of the API response as well as additional API calls, and is necessary because - sdkFind does not update many of these Spec fields by default. "resource" is a wrapper around "ko", the object - which will eventually be returned as "latest". +To be called in sdkFind, this function updates the replication group's Spec fields with the latest observed state +This requires extra processing of the API response as well as additional API calls, and is necessary because +sdkFind does not update many of these Spec fields by default. "resource" is a wrapper around "ko", the object +which will eventually be returned as "latest". */ func (rm *resourceManager) updateSpecFields( ctx context.Context, @@ -135,7 +135,8 @@ func setMaintenanceWindow( } // setCacheParameterGroup updates the cache parameter group associated with the replication group -// (if non-nil in API response) regardless of whether it was specified in desired +// +// (if non-nil in API response) regardless of whether it was specified in desired func setCacheParameterGroup( latestCacheCluster *svcsdk.CacheCluster, resource *resource, diff --git a/pkg/resource/replication_group/tags.go b/pkg/resource/replication_group/tags.go index 762e2baf..428d1b8d 100644 --- a/pkg/resource/replication_group/tags.go +++ b/pkg/resource/replication_group/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/snapshot/tags.go b/pkg/resource/snapshot/tags.go index b7491e61..9ba952cb 100644 --- a/pkg/resource/snapshot/tags.go +++ b/pkg/resource/snapshot/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/user/tags.go b/pkg/resource/user/tags.go index deae8e5c..5261cfa2 100644 --- a/pkg/resource/user/tags.go +++ b/pkg/resource/user/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/user_group/tags.go b/pkg/resource/user_group/tags.go index 22871897..d6aa58e4 100644 --- a/pkg/resource/user_group/tags.go +++ b/pkg/resource/user_group/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/testutil/test_suite_runner.go b/pkg/testutil/test_suite_runner.go index e4a8191c..6c120636 100644 --- a/pkg/testutil/test_suite_runner.go +++ b/pkg/testutil/test_suite_runner.go @@ -40,7 +40,7 @@ type fixtureContext struct { resourceManager acktypes.AWSResourceManager } -//TODO: remove if no longer used +// TODO: remove if no longer used // expectContext is runtime context for test scenario expectation fixture. type expectContext struct { latest acktypes.AWSResource @@ -100,15 +100,19 @@ func (runner *TestSuiteRunner) runTestScenario(scenarioName string, fixtureCxt * }) } -/* assertExpectations validates the actual outcome against the expected outcome. +/* + assertExpectations validates the actual outcome against the expected outcome. + There are two components to the expected outcome, corresponding to the return values of the resource manager's CRUD operation: - 1) the actual return value of type AWSResource ("expect.latest_state" in test_suite.yaml) - 2) the error ("expect.error" in test_suite.yaml) + 1. the actual return value of type AWSResource ("expect.latest_state" in test_suite.yaml) + 2. the error ("expect.error" in test_suite.yaml) + With each of these components, there are three possibilities in test_suite.yaml, which are interpreted as follows: - 1) the key does not exist, or was provided with no value: no explicit expectations, don't assert anything - 2) the key was provided with value "nil": explicit expectation; assert that the error or return value is nil - 3) the key was provided with value other than "nil": explicit expectation; assert that the value matches the - expected value + 1. the key does not exist, or was provided with no value: no explicit expectations, don't assert anything + 2. the key was provided with value "nil": explicit expectation; assert that the error or return value is nil + 3. the key was provided with value other than "nil": explicit expectation; assert that the value matches the + expected value + However, if neither expect.latest_state nor error are provided, assertExpectations will fail the test case. */ func (runner *TestSuiteRunner) assertExpectations(assert *assert.Assertions, expectation *Expect, actual acktypes.AWSResource, err error) {