Skip to content

Commit 0ca9116

Browse files
Fix No modifications were requested issue during sdkUpdate for CacheSubnetGroup (#112)
**Description of changes:** - Encountered `InvalidParameterValue: No modifications were requested.` during `sdkUpdate` just after an adoption of an existing resource. I introduced a custom update for the `CacheSubnetGroup` resource in order to swallow the error during `sdkUpdate`. Waiting your comments/reviews in case there is a better approach to handle this issue. **For more context:** #111 (review) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 7200ca6 commit 0ca9116

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ack_generate_info:
2-
build_date: "2023-03-10T17:52:20Z"
2+
build_date: "2023-03-13T12:38:41Z"
33
build_hash: 910a8e0744a99c5c87d8c1615926985215a60d8c
44
go_version: go1.19
55
version: v0.24.3

pkg/resource/cache_subnet_group/sdk.go

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

2-
for _, subnetIdIter := range ko.Status.Subnets {
3-
if subnetIdIter.SubnetIdentifier != nil {
4-
ko.Spec.SubnetIDs = append(ko.Spec.SubnetIDs, subnetIdIter.SubnetIdentifier)
5-
}
6-
}
2+
subnets := make([]*string, 0, len(ko.Status.Subnets))
3+
for _, subnetIdIter := range ko.Status.Subnets {
4+
if subnetIdIter.SubnetIdentifier != nil {
5+
subnets = append(subnets, subnetIdIter.SubnetIdentifier)
6+
}
7+
}
8+
ko.Spec.SubnetIDs = subnets

0 commit comments

Comments
 (0)