Skip to content

Commit 5f602da

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 5f602da

File tree

11 files changed

+184
-27
lines changed

11 files changed

+184
-27
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-12T18:06:45Z"
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: fbab0d4bb9fa74cc5e6e8d59465de73495fd73d7
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ resources:
225225
compare:
226226
# We have a custom comparison function...
227227
is_ignored: true
228+
DatabaseInsightsMode:
229+
late_initialize:
230+
skip_incomplete_check: {}
228231
renames:
229232
operations:
230233
CreateDBCluster:
@@ -319,7 +322,8 @@ resources:
319322
- InvalidParameterCombination
320323
fields:
321324
AvailabilityZone:
322-
late_initialize: {}
325+
late_initialize:
326+
skip_incomplete_check: {}
323327
is_immutable: true
324328
DBInstanceIdentifier:
325329
is_primary_key: true
@@ -328,7 +332,9 @@ resources:
328332
name: "STATUS"
329333
MasterUserPassword:
330334
is_secret: true
331-
KMSKeyId:
335+
KMSKeyID:
336+
late_initialize:
337+
skip_incomplete_check: {}
332338
references:
333339
resource: Key
334340
service_name: kms
@@ -352,9 +358,41 @@ resources:
352358
service_name: ec2
353359
path: Status.ID
354360
BackupTarget:
355-
late_initialize: {}
361+
late_initialize:
362+
skip_incomplete_check: {}
356363
NetworkType:
357-
late_initialize: {}
364+
late_initialize:
365+
skip_incomplete_check: {}
366+
AutoMinorVersionUpgrade:
367+
late_initialize:
368+
skip_incomplete_check: {}
369+
CACertificateIdentifier:
370+
late_initialize:
371+
skip_incomplete_check: {}
372+
DatabaseInsightsMode:
373+
late_initialize:
374+
skip_incomplete_check: {}
375+
LicenseModel:
376+
late_initialize:
377+
skip_incomplete_check: {}
378+
MultiAZ:
379+
late_initialize:
380+
skip_incomplete_check: {}
381+
PreferredBackupWindow:
382+
late_initialize:
383+
skip_incomplete_check: {}
384+
PreferredMaintenanceWindow:
385+
late_initialize:
386+
skip_incomplete_check: {}
387+
StorageEncrypted:
388+
late_initialize:
389+
skip_incomplete_check: {}
390+
StorageThroughput:
391+
late_initialize:
392+
skip_incomplete_check: {}
393+
StorageType:
394+
late_initialize:
395+
skip_incomplete_check: {}
358396
# Used by restore db instance from db snapshot
359397
DBSnapshotIdentifier:
360398
from:
@@ -397,6 +435,12 @@ resources:
397435
PerformanceInsightsRetentionPeriod:
398436
late_initialize:
399437
skip_incomplete_check: {}
438+
DatabaseInsightsMode:
439+
late_initialize:
440+
skip_incomplete_check: {}
441+
IOPS:
442+
late_initialize:
443+
skip_incomplete_check: {}
400444
Tags:
401445
compare:
402446
# We have a custom comparison function...

config/crd/common/bases/services.k8s.aws_iamroleselectors.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ spec:
6363
required:
6464
- names
6565
type: object
66+
resourceLabelSelector:
67+
description: LabelSelector is a label query over a set of resources.
68+
properties:
69+
matchLabels:
70+
additionalProperties:
71+
type: string
72+
type: object
73+
required:
74+
- matchLabels
75+
type: object
6676
resourceTypeSelector:
6777
items:
6878
properties:

config/crd/common/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
55
resources:
6-
- bases/services.k8s.aws_iamroleselectors.yaml
76
- bases/services.k8s.aws_fieldexports.yaml
7+
- bases/services.k8s.aws_iamroleselectors.yaml

generator.yaml

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ resources:
225225
compare:
226226
# We have a custom comparison function...
227227
is_ignored: true
228+
DatabaseInsightsMode:
229+
late_initialize:
230+
skip_incomplete_check: {}
228231
renames:
229232
operations:
230233
CreateDBCluster:
@@ -319,7 +322,8 @@ resources:
319322
- InvalidParameterCombination
320323
fields:
321324
AvailabilityZone:
322-
late_initialize: {}
325+
late_initialize:
326+
skip_incomplete_check: {}
323327
is_immutable: true
324328
DBInstanceIdentifier:
325329
is_primary_key: true
@@ -328,7 +332,9 @@ resources:
328332
name: "STATUS"
329333
MasterUserPassword:
330334
is_secret: true
331-
KMSKeyId:
335+
KMSKeyID:
336+
late_initialize:
337+
skip_incomplete_check: {}
332338
references:
333339
resource: Key
334340
service_name: kms
@@ -352,9 +358,41 @@ resources:
352358
service_name: ec2
353359
path: Status.ID
354360
BackupTarget:
355-
late_initialize: {}
361+
late_initialize:
362+
skip_incomplete_check: {}
356363
NetworkType:
357-
late_initialize: {}
364+
late_initialize:
365+
skip_incomplete_check: {}
366+
AutoMinorVersionUpgrade:
367+
late_initialize:
368+
skip_incomplete_check: {}
369+
CACertificateIdentifier:
370+
late_initialize:
371+
skip_incomplete_check: {}
372+
DatabaseInsightsMode:
373+
late_initialize:
374+
skip_incomplete_check: {}
375+
LicenseModel:
376+
late_initialize:
377+
skip_incomplete_check: {}
378+
MultiAZ:
379+
late_initialize:
380+
skip_incomplete_check: {}
381+
PreferredBackupWindow:
382+
late_initialize:
383+
skip_incomplete_check: {}
384+
PreferredMaintenanceWindow:
385+
late_initialize:
386+
skip_incomplete_check: {}
387+
StorageEncrypted:
388+
late_initialize:
389+
skip_incomplete_check: {}
390+
StorageThroughput:
391+
late_initialize:
392+
skip_incomplete_check: {}
393+
StorageType:
394+
late_initialize:
395+
skip_incomplete_check: {}
358396
# Used by restore db instance from db snapshot
359397
DBSnapshotIdentifier:
360398
from:
@@ -397,6 +435,12 @@ resources:
397435
PerformanceInsightsRetentionPeriod:
398436
late_initialize:
399437
skip_incomplete_check: {}
438+
DatabaseInsightsMode:
439+
late_initialize:
440+
skip_incomplete_check: {}
441+
IOPS:
442+
late_initialize:
443+
skip_incomplete_check: {}
400444
Tags:
401445
compare:
402446
# We have a custom comparison function...

helm/crds/services.k8s.aws_iamroleselectors.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ spec:
6363
required:
6464
- names
6565
type: object
66+
resourceLabelSelector:
67+
description: LabelSelector is a label query over a set of resources.
68+
properties:
69+
matchLabels:
70+
additionalProperties:
71+
type: string
72+
type: object
73+
required:
74+
- matchLabels
75+
type: object
6676
resourceTypeSelector:
6777
items:
6878
properties:

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: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)