Skip to content

fix: ignore field setting in sdkUpdate DBInstance #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apis/v1alpha1/ack-generate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ack_generate_info:
build_date: "2025-05-13T05:10:16Z"
build_date: "2025-05-13T22:48:25Z"
build_hash: 55bf57b2806c33a7fcd074be403f26ce3f8e58db
go_version: go1.24.2
go_version: go1.24.3
version: v0.46.2
api_directory_checksum: 52968d74358773de28be65be320d1bfb9c91e0bf
api_version: v1alpha1
aws_sdk_go_version: v1.32.6
generator_config_info:
file_checksum: ced2b68c703e2daf7b04da8f84f6ad6c95114fb9
file_checksum: a84060264f0186147ecf4328bdc4e0f484b91268
original_file_name: generator.yaml
last_modification:
reason: API generation
56 changes: 54 additions & 2 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ resources:
hooks:
delta_pre_compare:
template_path: hooks/db_instance/delta_pre_compare.go.tpl
# sdk_delete_post_request:
# code: return r, fmt.Errorf("wait for delete")
Comment on lines +301 to +302
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure I understand the two approaches.

In this PR you selectively ignored certain fields for the DBInstance which were receiving out of date values from the Update response. The alternative you're asking about is to completely ignore the update response for every field as a way of ensuring that no other fields are erroneously updated with out of date values from the Update response. Is that correct?

sdk_create_pre_build_request:
template_path: hooks/db_instance/sdk_create_pre_build_request.go.tpl
sdk_create_post_set_output:
Expand All @@ -308,8 +310,8 @@ resources:
template_path: hooks/db_instance/sdk_update_pre_build_request.go.tpl
sdk_update_post_build_request:
template_path: hooks/db_instance/sdk_update_post_build_request.go.tpl
sdk_update_post_set_output:
template_path: hooks/db_instance/sdk_update_post_set_output.go.tpl
sdk_update_pre_set_output:
template_path: hooks/db_instance/sdk_update_pre_set_output.go.tpl
sdk_delete_pre_build_request:
template_path: hooks/db_instance/sdk_delete_pre_build_request.go.tpl
sdk_delete_post_build_request:
Expand All @@ -327,11 +329,61 @@ resources:
is_immutable: true
DBInstanceIdentifier:
is_primary_key: true
set:
- method: Update
ignore: true
DBInstanceStatus:
print:
name: "STATUS"
MasterUserPassword:
is_secret: true
set:
- method: Update
ignore: true
AllocatedStorage:
set:
- method: Update
ignore: true
BackupRetentionPeriod:
set:
- method: Update
ignore: true
CACertificateIdentifier:
set:
- method: Update
ignore: true
DBInstanceClass:
set:
- method: Update
ignore: true
EngineVersion:
set:
- method: Update
ignore: true
Iops:
set:
- method: Update
ignore: true
MultiAZ:
set:
- method: Update
ignore: true
Port:
set:
- method: Update
ignore: true
PubliclyAccessible:
set:
- method: Update
ignore: true
StorageThroughput:
set:
- method: Update
ignore: true
StorageType:
set:
- method: Update
ignore: true
KmsKeyId:
references:
resource: Key
Expand Down
56 changes: 54 additions & 2 deletions generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ resources:
hooks:
delta_pre_compare:
template_path: hooks/db_instance/delta_pre_compare.go.tpl
# sdk_delete_post_request:
# code: return r, fmt.Errorf("wait for delete")
sdk_create_pre_build_request:
template_path: hooks/db_instance/sdk_create_pre_build_request.go.tpl
sdk_create_post_set_output:
Expand All @@ -308,8 +310,8 @@ resources:
template_path: hooks/db_instance/sdk_update_pre_build_request.go.tpl
sdk_update_post_build_request:
template_path: hooks/db_instance/sdk_update_post_build_request.go.tpl
sdk_update_post_set_output:
template_path: hooks/db_instance/sdk_update_post_set_output.go.tpl
sdk_update_pre_set_output:
template_path: hooks/db_instance/sdk_update_pre_set_output.go.tpl
sdk_delete_pre_build_request:
template_path: hooks/db_instance/sdk_delete_pre_build_request.go.tpl
sdk_delete_post_build_request:
Expand All @@ -327,11 +329,61 @@ resources:
is_immutable: true
DBInstanceIdentifier:
is_primary_key: true
set:
- method: Update
ignore: true
DBInstanceStatus:
print:
name: "STATUS"
MasterUserPassword:
is_secret: true
set:
- method: Update
ignore: true
AllocatedStorage:
set:
- method: Update
ignore: true
BackupRetentionPeriod:
set:
- method: Update
ignore: true
CACertificateIdentifier:
set:
- method: Update
ignore: true
DBInstanceClass:
set:
- method: Update
ignore: true
EngineVersion:
set:
- method: Update
ignore: true
Iops:
set:
- method: Update
ignore: true
MultiAZ:
set:
- method: Update
ignore: true
Port:
set:
- method: Update
ignore: true
PubliclyAccessible:
set:
- method: Update
ignore: true
StorageThroughput:
set:
- method: Update
ignore: true
StorageType:
set:
- method: Update
ignore: true
KmsKeyId:
references:
resource: Key
Expand Down
Loading