Skip to content

Commit 385c03a

Browse files
committed
late_initialize DBCluster and DBInstance fields that get defaulted by AWS
Some spec fields get default values from AWS after they are created. These defaults cause the controller to keep requeuing, trying to set them to null. With these changes, we late initialize these fields, ensuring they are defaulted if the user does not define them
1 parent d9fef91 commit 385c03a

File tree

8 files changed

+139
-8
lines changed

8 files changed

+139
-8
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2025-11-29T03:44:25Z"
3-
build_hash: 23c7074fa310ad1ccb38946775397c203b49f024
2+
build_date: "2025-12-11T00:02:14Z"
3+
build_hash: 5c8b9050006ef6c7d3a97c279e7b1bc163f20a0a
44
go_version: go1.25.4
5-
version: v0.56.0
5+
version: v0.56.0-3-g5c8b905
66
api_directory_checksum: 90b0d1adcc91f4a1b1f1b436e3ac0c30d9271678
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: 23c3c400e5913ebaa0047af70fda453b065ce321
10+
file_checksum: 760e376d79ebb1ea840b830b62f92c3142300d62
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ resources:
225225
compare:
226226
# We have a custom comparison function...
227227
is_ignored: true
228+
DatabaseInsightsMode:
229+
late_initialize: {}
228230
renames:
229231
operations:
230232
CreateDBCluster:
@@ -355,6 +357,26 @@ resources:
355357
late_initialize: {}
356358
NetworkType:
357359
late_initialize: {}
360+
AutoMinorVersionUpgrade:
361+
late_initialize: {}
362+
CACertificateIdentifier:
363+
late_initialize: {}
364+
DatabaseInsightsMode:
365+
late_initialize: {}
366+
LicenseModel:
367+
late_initialize: {}
368+
MultiAZ:
369+
late_initialize: {}
370+
PreferredBackupWindow:
371+
late_initialize: {}
372+
PreferredMaintenanceWindow:
373+
late_initialize: {}
374+
StorageEncrypted:
375+
late_initialize: {}
376+
StorageThroughput:
377+
late_initialize: {}
378+
StorageType:
379+
late_initialize: {}
358380
# Used by restore db instance from db snapshot
359381
DBSnapshotIdentifier:
360382
from:

generator.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ resources:
225225
compare:
226226
# We have a custom comparison function...
227227
is_ignored: true
228+
DatabaseInsightsMode:
229+
late_initialize: {}
228230
renames:
229231
operations:
230232
CreateDBCluster:
@@ -355,6 +357,26 @@ resources:
355357
late_initialize: {}
356358
NetworkType:
357359
late_initialize: {}
360+
AutoMinorVersionUpgrade:
361+
late_initialize: {}
362+
CACertificateIdentifier:
363+
late_initialize: {}
364+
DatabaseInsightsMode:
365+
late_initialize: {}
366+
LicenseModel:
367+
late_initialize: {}
368+
MultiAZ:
369+
late_initialize: {}
370+
PreferredBackupWindow:
371+
late_initialize: {}
372+
PreferredMaintenanceWindow:
373+
late_initialize: {}
374+
StorageEncrypted:
375+
late_initialize: {}
376+
StorageThroughput:
377+
late_initialize: {}
378+
StorageType:
379+
late_initialize: {}
358380
# Used by restore db instance from db snapshot
359381
DBSnapshotIdentifier:
360382
from:

helm/templates/deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ spec:
5151
- "$(AWS_REGION)"
5252
- --aws-endpoint-url
5353
- "$(AWS_ENDPOINT_URL)"
54+
{{- if .Values.aws.identity_endpoint_url }}
55+
- --aws-identity-endpoint-url
56+
- "$(AWS_IDENTITY_ENDPOINT_URL)"
57+
{{- end }}
58+
{{- if .Values.aws.allow_unsafe_aws_endpoint_urls }}
59+
- --allow-unsafe-aws-endpoint-urls
60+
{{- end }}
5461
{{- if .Values.log.enable_development_logging }}
5562
- --enable-development-logging
5663
{{- end }}
@@ -109,6 +116,8 @@ spec:
109116
value: {{ .Values.aws.region }}
110117
- name: AWS_ENDPOINT_URL
111118
value: {{ .Values.aws.endpoint_url | quote }}
119+
- name: AWS_IDENTITY_ENDPOINT_URL
120+
value: {{ .Values.aws.identity_endpoint_url | quote }}
112121
- name: ACK_WATCH_NAMESPACE
113122
value: {{ include "ack-rds-controller.watch-namespace" . }}
114123
- name: ACK_WATCH_SELECTORS

helm/values.schema.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,16 @@
171171
"region": {
172172
"type": "string"
173173
},
174-
"endpoint": {
174+
"endpoint_url": {
175175
"type": "string"
176176
},
177+
"identity_endpoint_url": {
178+
"type": "string"
179+
},
180+
"allow_unsafe_aws_endpoint_urls": {
181+
"type": "boolean",
182+
"default": false
183+
},
177184
"credentials": {
178185
"description": "AWS credentials information",
179186
"properties": {

helm/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ aws:
9090
# If specified, use the AWS region for AWS API calls
9191
region: ""
9292
endpoint_url: ""
93+
identity_endpoint_url: ""
94+
allow_unsafe_aws_endpoint_urls: false
9395
credentials:
9496
# If specified, Secret with shared credentials file to use.
9597
secretName: ""

pkg/resource/db_cluster/manager.go

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

pkg/resource/db_instance/manager.go

Lines changed: 61 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)