-
Notifications
You must be signed in to change notification settings - Fork 43
Fix cache parameter group test failure #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kumargauravsharma
merged 1 commit into
aws-controllers-k8s:main
from
echen-98:test-failures
Oct 25, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
...ource/replication_group/testdata/replication_group/cr/rg_cmd_create_completed_latest.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| apiVersion: elasticache.services.k8s.aws/v1alpha1 | ||
| kind: ReplicationGroup | ||
| # omitted metadata | ||
| spec: | ||
| atRestEncryptionEnabled: false | ||
| cacheNodeType: cache.t3.micro | ||
| cacheParameterGroupName: "default.redis5.0" | ||
| engine: redis | ||
| numNodeGroups: 1 | ||
| preferredMaintenanceWindow: "wed:08:00-wed:09:00" | ||
| replicasPerNodeGroup: 1 | ||
| replicationGroupDescription: cluster-mode disabled RG | ||
| replicationGroupID: rg-cmd | ||
| snapshotRetentionLimit: 0 | ||
| snapshotWindow: "10:00-11:00" | ||
| transitEncryptionEnabled: false | ||
| status: | ||
| ackResourceMetadata: | ||
| arn: arn:aws:elasticache:us-east-1:012345678910:replicationgroup:rg-cmd | ||
| ownerAccountID: "" | ||
| allowedScaleUpModifications: | ||
| - cache.m3.2xlarge | ||
| - cache.m3.large | ||
| - cache.m3.medium | ||
| - cache.m3.xlarge | ||
| - cache.m4.10xlarge | ||
| - cache.m4.2xlarge | ||
| - cache.m4.4xlarge | ||
| - cache.m4.large | ||
| - cache.m4.xlarge | ||
| - cache.m5.12xlarge | ||
| - cache.m5.24xlarge | ||
| - cache.m5.2xlarge | ||
| - cache.m5.4xlarge | ||
| - cache.m5.large | ||
| - cache.m5.xlarge | ||
| - cache.m6g.large | ||
| - cache.r3.2xlarge | ||
| - cache.r3.4xlarge | ||
| - cache.r3.8xlarge | ||
| - cache.r3.large | ||
| - cache.r3.xlarge | ||
| - cache.r4.16xlarge | ||
| - cache.r4.2xlarge | ||
| - cache.r4.4xlarge | ||
| - cache.r4.8xlarge | ||
| - cache.r4.large | ||
| - cache.r4.xlarge | ||
| - cache.r5.12xlarge | ||
| - cache.r5.24xlarge | ||
| - cache.r5.2xlarge | ||
| - cache.r5.4xlarge | ||
| - cache.r5.large | ||
| - cache.r5.xlarge | ||
| - cache.r6g.2xlarge | ||
| - cache.r6g.4xlarge | ||
| - cache.r6g.8xlarge | ||
| - cache.r6g.large | ||
| - cache.r6g.xlarge | ||
| - cache.t2.medium | ||
| - cache.t2.micro | ||
| - cache.t2.small | ||
| - cache.t3.medium | ||
| - cache.t3.small | ||
| authTokenEnabled: false | ||
| automaticFailover: disabled | ||
| clusterEnabled: false | ||
| conditions: | ||
| - status: "True" | ||
| type: ACK.ResourceSynced | ||
| description: cluster-mode disabled RG | ||
| events: | ||
| - date: "2021-03-30T20:12:00Z" | ||
| message: Replication group rg-cmd created | ||
| globalReplicationGroupInfo: {} | ||
| memberClusters: | ||
| - rg-cmd-001 | ||
| - rg-cmd-002 | ||
| multiAZ: disabled | ||
| nodeGroups: | ||
| - nodeGroupID: "0001" | ||
| nodeGroupMembers: | ||
| - cacheClusterID: rg-cmd-001 | ||
| cacheNodeID: "0001" | ||
| currentRole: primary | ||
| preferredAvailabilityZone: us-east-1b | ||
| readEndpoint: | ||
| address: rg-cmd-001.xxxxxx.0001.use1.cache.amazonaws.com | ||
| port: 6379 | ||
| - cacheClusterID: rg-cmd-002 | ||
| cacheNodeID: "0001" | ||
| currentRole: replica | ||
| preferredAvailabilityZone: us-east-1d | ||
| readEndpoint: | ||
| address: rg-cmd-002.xxxxxx.0001.use1.cache.amazonaws.com | ||
| port: 6379 | ||
| primaryEndpoint: | ||
| address: rg-cmd.xxxxxx.ng.0001.use1.cache.amazonaws.com | ||
| port: 6379 | ||
| readerEndpoint: | ||
| address: rg-cmd-ro.xxxxxx.ng.0001.use1.cache.amazonaws.com | ||
| port: 6379 | ||
| status: available | ||
| pendingModifiedValues: {} | ||
| status: available |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if
ko.Spec.CacheParameterGroupNamewas non-nil and different fromlatestCacheCluster.CacheParameterGroup.CacheParameterGroupName, why would we overwriteko.Spec.CacheParameterGroupNamehere? This smells funny...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention is just to retrieve the cache parameter group currently associated to the replication group. That information comes from the
DescribeCacheClustersAPI since it is not present in theDescribeReplicationGroupsAPI response.If
ko.Spec.CacheParameterGroupNameis non-nil and gets overwritten, that's precisely what we want because the original value was copied over fromdesired, the latest value is different from that, and the controller will go on to detect a diff and invoke a Modify call with the desiredCacheParameterGroupName.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aws-controllers-k8s/community#846 (comment)
This falls under "case 3" of spec fields as I mentioned in this issue a while back