Skip to content

Commit 6b1e8e8

Browse files
authored
custom update code path for DBCluster (#24)
The ModifyDBCluster RDS API call will return an InvalidParameterValue error if the engine mode for the DBCluster is "serverless" and any of the following fields have been set on the ModifyDBClusterInput shape: * PreferredMaintenanceWindow * PreferredBackupWindow * Port This error is returned **even if the value of the field in the ModifyDBClusterInput shape matches the existing value of the DBCluster resource** To get around this issue, I've added a custom update method implementation for the DBCluster resource that builds the ModifyDBClusterInput shape and ONLY sets fields on that shape when the matching Spec field is not nil AND there is a difference detected between the latest observed value and the desired value for that field. Fixes Issue aws-controllers-k8s/community#917 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent d7d104f commit 6b1e8e8

File tree

6 files changed

+650
-595
lines changed

6 files changed

+650
-595
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
ack_generate_info:
2-
build_date: "2021-08-24T15:21:38Z"
2+
build_date: "2021-08-26T13:53:10Z"
33
build_hash: 11f7affb243007aa3ed1140e7093d8e0ab1252fd
44
go_version: go1.15.5 linux/amd64
55
version: v0.12.0
6-
api_directory_checksum: 4bda8793ed6390385882d640e1e7bf541a342c0f
6+
api_directory_checksum: 387f19255122f7e68716af4d6dbce0e7498cfe37
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.37.10
99
generator_config_info:
10-
file_checksum: bb80f830d61e1a1c6016fde6102463862f9dc8dd
10+
file_checksum: a925bf4c19337d7d6e61ae88861f00a1e94cf7a1
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation
14-
timestamp: 2021-08-24 15:21:45.484880224 +0000 UTC
14+
timestamp: 2021-08-26 13:53:17.093835611 +0000 UTC

apis/v1alpha1/generator.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ operations:
6464
primary_identifier_field_name: DBClusterIdentifier
6565
resources:
6666
DBCluster:
67+
update_operation:
68+
# We need a custom update implementation until the issue behind
69+
# https://github.com/aws-controllers-k8s/community/issues/917 is
70+
# resolved.
71+
custom_method_name: customUpdate
6772
hooks:
6873
sdk_update_pre_build_request:
6974
template_path: hooks/db_cluster/sdk_update_pre_build_request.go.tpl

generator.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ operations:
6464
primary_identifier_field_name: DBClusterIdentifier
6565
resources:
6666
DBCluster:
67+
update_operation:
68+
# We need a custom update implementation until the issue behind
69+
# https://github.com/aws-controllers-k8s/community/issues/917 is
70+
# resolved.
71+
custom_method_name: customUpdate
6772
hooks:
6873
sdk_update_pre_build_request:
6974
template_path: hooks/db_cluster/sdk_update_pre_build_request.go.tpl

0 commit comments

Comments
 (0)