Skip to content

Commit 51ccb82

Browse files
authored
late initialize fields that get defaulted by AWS (#255)
Issue [#2695](aws-controllers-k8s/community#2695) Description of changes: 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 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent b16a299 commit 51ccb82

File tree

4 files changed

+132
-24
lines changed

4 files changed

+132
-24
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2025-12-17T01:17:18Z"
3-
build_hash: 5c8b9050006ef6c7d3a97c279e7b1bc163f20a0a
4-
go_version: go1.25.1
5-
version: v0.56.0-3-g5c8b905
2+
build_date: "2025-12-24T22:38:26Z"
3+
build_hash: 43713d4546b29b09ac85cbb3da854425045237bd
4+
go_version: go1.25.4
5+
version: v0.56.0-4-g43713d4
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: dbdbedba659ba18ccd2545c0dfd21892fca6d071
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ resources:
319319
- InvalidParameterCombination
320320
fields:
321321
AvailabilityZone:
322-
late_initialize: {}
322+
late_initialize:
323+
skip_incomplete_check: {}
323324
is_immutable: true
324325
DBInstanceIdentifier:
325326
is_primary_key: true
@@ -328,7 +329,9 @@ resources:
328329
name: "STATUS"
329330
MasterUserPassword:
330331
is_secret: true
331-
KMSKeyId:
332+
KMSKeyID:
333+
late_initialize:
334+
skip_incomplete_check: {}
332335
references:
333336
resource: Key
334337
service_name: kms
@@ -352,9 +355,41 @@ resources:
352355
service_name: ec2
353356
path: Status.ID
354357
BackupTarget:
355-
late_initialize: {}
358+
late_initialize:
359+
skip_incomplete_check: {}
356360
NetworkType:
357-
late_initialize: {}
361+
late_initialize:
362+
skip_incomplete_check: {}
363+
AutoMinorVersionUpgrade:
364+
late_initialize:
365+
skip_incomplete_check: {}
366+
CACertificateIdentifier:
367+
late_initialize:
368+
skip_incomplete_check: {}
369+
DatabaseInsightsMode:
370+
late_initialize:
371+
skip_incomplete_check: {}
372+
LicenseModel:
373+
late_initialize:
374+
skip_incomplete_check: {}
375+
MultiAZ:
376+
late_initialize:
377+
skip_incomplete_check: {}
378+
PreferredBackupWindow:
379+
late_initialize:
380+
skip_incomplete_check: {}
381+
PreferredMaintenanceWindow:
382+
late_initialize:
383+
skip_incomplete_check: {}
384+
StorageEncrypted:
385+
late_initialize:
386+
skip_incomplete_check: {}
387+
StorageThroughput:
388+
late_initialize:
389+
skip_incomplete_check: {}
390+
StorageType:
391+
late_initialize:
392+
skip_incomplete_check: {}
358393
# Used by restore db instance from db snapshot
359394
DBSnapshotIdentifier:
360395
from:
@@ -397,6 +432,12 @@ resources:
397432
PerformanceInsightsRetentionPeriod:
398433
late_initialize:
399434
skip_incomplete_check: {}
435+
DatabaseInsightsMode:
436+
late_initialize:
437+
skip_incomplete_check: {}
438+
IOPS:
439+
late_initialize:
440+
skip_incomplete_check: {}
400441
Tags:
401442
compare:
402443
# We have a custom comparison function...

generator.yaml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ resources:
319319
- InvalidParameterCombination
320320
fields:
321321
AvailabilityZone:
322-
late_initialize: {}
322+
late_initialize:
323+
skip_incomplete_check: {}
323324
is_immutable: true
324325
DBInstanceIdentifier:
325326
is_primary_key: true
@@ -328,7 +329,9 @@ resources:
328329
name: "STATUS"
329330
MasterUserPassword:
330331
is_secret: true
331-
KMSKeyId:
332+
KMSKeyID:
333+
late_initialize:
334+
skip_incomplete_check: {}
332335
references:
333336
resource: Key
334337
service_name: kms
@@ -352,9 +355,41 @@ resources:
352355
service_name: ec2
353356
path: Status.ID
354357
BackupTarget:
355-
late_initialize: {}
358+
late_initialize:
359+
skip_incomplete_check: {}
356360
NetworkType:
357-
late_initialize: {}
361+
late_initialize:
362+
skip_incomplete_check: {}
363+
AutoMinorVersionUpgrade:
364+
late_initialize:
365+
skip_incomplete_check: {}
366+
CACertificateIdentifier:
367+
late_initialize:
368+
skip_incomplete_check: {}
369+
DatabaseInsightsMode:
370+
late_initialize:
371+
skip_incomplete_check: {}
372+
LicenseModel:
373+
late_initialize:
374+
skip_incomplete_check: {}
375+
MultiAZ:
376+
late_initialize:
377+
skip_incomplete_check: {}
378+
PreferredBackupWindow:
379+
late_initialize:
380+
skip_incomplete_check: {}
381+
PreferredMaintenanceWindow:
382+
late_initialize:
383+
skip_incomplete_check: {}
384+
StorageEncrypted:
385+
late_initialize:
386+
skip_incomplete_check: {}
387+
StorageThroughput:
388+
late_initialize:
389+
skip_incomplete_check: {}
390+
StorageType:
391+
late_initialize:
392+
skip_incomplete_check: {}
358393
# Used by restore db instance from db snapshot
359394
DBSnapshotIdentifier:
360395
from:
@@ -397,6 +432,12 @@ resources:
397432
PerformanceInsightsRetentionPeriod:
398433
late_initialize:
399434
skip_incomplete_check: {}
435+
DatabaseInsightsMode:
436+
late_initialize:
437+
skip_incomplete_check: {}
438+
IOPS:
439+
late_initialize:
440+
skip_incomplete_check: {}
400441
Tags:
401442
compare:
402443
# We have a custom comparison function...

pkg/resource/db_instance/manager.go

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

0 commit comments

Comments
 (0)