Skip to content

Commit dff3233

Browse files
authored
fix storageType delta (#210)
Fixes: ``` When the StorageType parameter for a DBCluster is explicitly set to its default value ("aurora"), the AWS RDS API doesn't return this field in the response. However, when set to a non-default value (like "aurora-iopt1"), the API does return the field. This inconsistency causes problems with the controller's delta comparison logic.``` Description of changes: Modified the `delta_pre_compare` hook to default the StorageType field to "aurora" when it's nil in the latest resource state. This addresses the issue where the AWS RDS API doesn't return the StorageType field when it's set to the default value "aurora". By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 630ac10 commit dff3233

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ack_generate_info:
2-
build_date: "2025-02-20T18:29:28Z"
2+
build_date: "2025-03-07T22:57:51Z"
33
build_hash: a326346bd3a6973254d247c9ab2dc76790c36241
44
go_version: go1.24.0
55
version: v0.43.2

pkg/resource/db_cluster/delta.go

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
11
compareTags(delta, a, b)
2+
3+
// Handle special case for StorageType field for Aurora engines
4+
// When StorageType is set to "aurora" (default), the API doesn't return it
5+
6+
isAuroraEngine := (b.ko.Spec.Engine != nil && (*b.ko.Spec.Engine == "aurora-mysql" || *b.ko.Spec.Engine == "aurora-postgresql"))
7+
8+
if isAuroraEngine && (a.ko.Spec.StorageType != nil && *a.ko.Spec.StorageType == "aurora" && b.ko.Spec.StorageType == nil) {
9+
b.ko.Spec.StorageType = aws.String("aurora")
10+
}
11+
212
compareSecretReferenceChanges(delta, a, b)

0 commit comments

Comments
 (0)