Skip to content

Commit b608b63

Browse files
author
Tenglong Gu
committed
Ignore several fields for rds modify call when no delta
1 parent f411187 commit b608b63

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
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: "2022-06-08T02:04:16Z"
2+
build_date: "2022-06-13T22:52:20Z"
33
build_hash: 6acf40fe3e3cfd97b799ef7cbf1e89e01c3db8f7
44
go_version: go1.18.2
55
version: v0.18.4-15-g6acf40f

pkg/resource/db_instance/sdk.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/hooks/db_instance/sdk_update_post_build_request.go.tpl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,18 @@
66
if !delta.DifferentAt("Spec.DBSubnetGroupName") {
77
input.DBSubnetGroupName = nil
88
}
9+
10+
// RDS will not compare diff value and accept any modify db call
11+
// for below values, MonitoringInterval, CACertificateIdentifier
12+
// and user master password
13+
// hence if there is no delta between desired
14+
// and latest, exclude it from ModifyDBInstanceRequest
15+
if !delta.DifferentAt("Spec.MonitoringInterval") {
16+
input.MonitoringInterval = nil
17+
}
18+
if !delta.DifferentAt("Spec.CACertificateIdentifier") {
19+
input.CACertificateIdentifier = nil
20+
}
21+
if !delta.DifferentAt("Spec.MasterUserPassword.Name") {
22+
input.MasterUserPassword = nil
23+
}

0 commit comments

Comments
 (0)