Skip to content

Commit 2e699a9

Browse files
authored
Prevent incorrect DB Cluster engine version patching during updates (#214)
fixes: aws-controllers-k8s/community#2380 Description of changes: When `ModifyDBCluster` is called for an engine version update, the API response might still reflect the *old* version while the update is in progress asynchronously. Previously, we patched `ko` with this potentially outdated version from the response. This caused the next reconciliation to incorrectly see a mismatch between the desired (new) version and the patched (old) version, leading to unnecessary downgrade attempts. **Fix:** The `customUpdate` function does not patch `EngineVersion` **Example:** 1. **User Spec:** `EngineVersion: "11.0"` 2. **Current State:** `EngineVersion: "10.0"` 3. `ModifyDBCluster` is called to update to `11.0`. 4. **API Response:** (while updating) `EngineVersion: "10.0"` 5. **Old Behavior:** `ko.Spec.EngineVersion` patched to `10.0`. Next reconcile might try to downgrade. 6. **New Behavior:** desired is set and not patched to ko during the update By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 9091218 commit 2e699a9

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

pkg/resource/db_cluster/custom_update.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,6 @@ func (rm *resourceManager) customUpdate(
324324
} else {
325325
ko.Spec.EngineMode = nil
326326
}
327-
if resp.DBCluster.EngineVersion != nil {
328-
ko.Spec.EngineVersion = resp.DBCluster.EngineVersion
329-
} else {
330-
ko.Spec.EngineVersion = nil
331-
}
332327
if resp.DBCluster.GlobalWriteForwardingRequested != nil {
333328
ko.Status.GlobalWriteForwardingRequested = resp.DBCluster.GlobalWriteForwardingRequested
334329
} else {

0 commit comments

Comments
 (0)