Skip to content

Commit f411187

Browse files
authored
Allow major version upgrade by setting AllowMajorVersionUpgrade to true (#83)
Fixes aws-controllers-k8s/community#1265 Issue #, if available: aws-controllers-k8s/community#1265 Description of changes: This PR is setting AllowMajorVersionUpgrade to true for both modify db instance and modify db cluster. This flag was designed as protect flag to avoid accidentally engine version upgrade, however this is not necessary for controller side. whenever customer make change to engine version, ACK controller should take instance to target engine version. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 0cf63b7 commit f411187

File tree

5 files changed

+25
-3
lines changed

5 files changed

+25
-3
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2022-06-02T18:10:06Z"
2+
build_date: "2022-06-08T02:04:16Z"
33
build_hash: 6acf40fe3e3cfd97b799ef7cbf1e89e01c3db8f7
44
go_version: go1.18.2
55
version: v0.18.4-15-g6acf40f
6-
api_directory_checksum: f8a740e73423e911df6a1b5fbcb9fbbb03cd9899
6+
api_directory_checksum: 4bdcfc19ab3ec6ae11525e6eb3a201e4a25b00fa
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.42.0
99
generator_config_info:
10-
file_checksum: c9f1d6ca4596ac8e84312495f50a8b901843744f
10+
file_checksum: a014f16db9e990ad756052e50cbce7d0d9b84c0b
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ operations:
3535
# makes to a resource's Spec to be reconciled by the ACK service
3636
# controller, not a different service.
3737
ApplyImmediately: true
38+
# We override the value of AllowMajorVersionUpgrade field in the modify
39+
# call since any engine version change should apply directly.
40+
# This flag was designed as a protect flag but not necessary in controller
41+
# side when customer need to make the engine version change
42+
AllowMajorVersionUpgrade: true
3843
DeleteDBCluster:
3944
override_values:
4045
# Clearly this is not ideal, but will suffice until we add custom hook
@@ -55,6 +60,11 @@ operations:
5560
# makes to a resource's Spec to be reconciled by the ACK service
5661
# controller, not a different service.
5762
ApplyImmediately: true
63+
# We override the value of the ApplyImmediately field in the modify
64+
# operations to "true" because we want changes that a Kubernetes user
65+
# makes to a resource's Spec to be reconciled by the ACK service
66+
# controller, not a different service.
67+
AllowMajorVersionUpgrade: true
5868
DeleteDBInstance:
5969
override_values:
6070
# Clearly this is not ideal, but will suffice until we add custom hook

generator.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ operations:
3535
# makes to a resource's Spec to be reconciled by the ACK service
3636
# controller, not a different service.
3737
ApplyImmediately: true
38+
# We override the value of AllowMajorVersionUpgrade field in the modify
39+
# call since any engine version change should apply directly.
40+
# This flag was designed as a protect flag but not necessary in controller
41+
# side when customer need to make the engine version change
42+
AllowMajorVersionUpgrade: true
3843
DeleteDBCluster:
3944
override_values:
4045
# Clearly this is not ideal, but will suffice until we add custom hook
@@ -55,6 +60,11 @@ operations:
5560
# makes to a resource's Spec to be reconciled by the ACK service
5661
# controller, not a different service.
5762
ApplyImmediately: true
63+
# We override the value of the ApplyImmediately field in the modify
64+
# operations to "true" because we want changes that a Kubernetes user
65+
# makes to a resource's Spec to be reconciled by the ACK service
66+
# controller, not a different service.
67+
AllowMajorVersionUpgrade: true
5868
DeleteDBInstance:
5969
override_values:
6070
# Clearly this is not ideal, but will suffice until we add custom hook

pkg/resource/db_cluster/custom_update.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ func (rm *resourceManager) newCustomUpdateRequestPayload(
542542
res := &svcsdk.ModifyDBClusterInput{}
543543

544544
res.SetApplyImmediately(true)
545+
res.SetAllowMajorVersionUpgrade(true)
545546
if r.ko.Spec.BacktrackWindow != nil && delta.DifferentAt("Spec.BacktrackWindow") {
546547
res.SetBacktrackWindow(*r.ko.Spec.BacktrackWindow)
547548
}

pkg/resource/db_instance/sdk.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)