Skip to content

Commit 93790aa

Browse files
committed
doc: improve documenation for unsupported upgrades
1 parent 1d78d39 commit 93790aa

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

stackgres-k8s/install/helm/stackgres-operator/templates/check-upgrade.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{ $version := $deployment.metadata.labels.version }}
1010
{{ if not .Values.forceUpgradeFromUnsupportedVersion }}
1111
{{ if or (not (regexMatch "^(1\\.14|1\\.15|1\\.16)\\." $version)) (and (not (eq $version $chart.Version)) (regexMatch "(-alpha[0-9]|-beta[0-9])" $version)) }}
12-
{{ fail (print "Upgrading from version " $version " version is not supported. You may force upgrading from an unsupported version setting the parameter \"forceUpgradeFromUnsupportedVersion\" to \"true\". If you do so do it at your own risk. It has not been tested and some functionality may break. If you are conscious of the risk of such a dangerous action we recommend to perform security upgrades of all your SGCluster and SGShardedCluster as soon as possible after upgrading from an unsupported version of the operator upgrade") }}
12+
{{ fail (print "Upgrading from version " $version " version is not supported. You may force upgrading from an unsupported version setting the parameter \"forceUpgradeFromUnsupportedVersion\" to \"true\". If you do so do it at your own risk. It has not been tested and some or all functionalities may break. Before proceeding you will have to change the value of `stackgres.io/operatorVersion` annotation of all your SGClusters and SGShardedClusters to the target operator version you want to upgrade to and, as soon as possible after upgrading, perform a restart restart SGDbOps or SGShardedDbOps of all your SGClusters and SGShardedClusters. Before assuming the risk of such a dangerous action we strongly recommend to perform this operation in a staging environment as close as possible to your production environment.") }}
1313
{{ end }}
1414
{{ end }}
1515
{{ end }}
@@ -23,7 +23,11 @@
2323
{{ if (index $shardedcluster.metadata.annotations "stackgres.io/operatorVersion") }}
2424
{{ $version := (index $shardedcluster.metadata.annotations "stackgres.io/operatorVersion") }}
2525
{{ if (not (regexMatch "^(1\\.14|1\\.15|1\\.16)\\." $version)) }}
26-
{{ fail (print "Can not upgrade due to some SGShardedCluster still at version " $version ". You have to run a SGShardedDbOps of type securityUpgrade on those SGShardedClusters first.") }}
26+
{{ if not .Values.forceUpgradeFromUnsupportedVersion }}
27+
{{ fail (print "Can not upgrade due to some SGShardedCluster still at version " $version ". You have to run a SGShardedDbOps of type securityUpgrade on those SGShardedClusters first.") }}
28+
{{ else }}
29+
{{ fail (print "Can not upgrade due to some SGShardedCluster still at version " $version ". Before proceeding you will have to change the value of `stackgres.io/operatorVersion` annotation of all your SGShardedClusters to the target operator version you want to upgrade to and, as soon as possible after upgrading, perform a restart SGShardedDbOps of all your SGShardedClusters. Before assuming the risk of such a dangerous action we strongly recommend to perform this operation in a staging environment as close as possible to your production environment.") }}
30+
{{ end }}
2731
{{ end }}
2832
{{ end }}
2933
{{ end }}
@@ -38,7 +42,11 @@
3842
{{ if (index $cluster.metadata.annotations "stackgres.io/operatorVersion") }}
3943
{{ $version := (index $cluster.metadata.annotations "stackgres.io/operatorVersion") }}
4044
{{ if (not (regexMatch "^(1\\.14|1\\.15|1\\.16)\\." $version)) }}
41-
{{ fail (print "Can not upgrade due to some SGCluster still at version " $version ". You have to run a SGDbOps of type securityUpgrade on those SGClusters first.") }}
45+
{{ if not .Values.forceUpgradeFromUnsupportedVersion }}
46+
{{ fail (print "Can not upgrade due to some SGCluster still at version " $version ". You have to run a SGDbOps of type securityUpgrade on those SGClusters first.") }}
47+
{{ else }}
48+
{{ fail (print "Can not upgrade due to some SGCluster still at version " $version ". Before proceeding you will have to change the value of `stackgres.io/operatorVersion` annotation of all your SGClusters to the target operator version you want to upgrade to and, as soon as possible after upgrading, perform a restart SGDbOps of all your SGClusters. Before assuming the risk of such a dangerous action we strongly recommend to perform this operation in a staging environment as close as possible to your production environment.") }}
49+
{{ end }}
4250
{{ end }}
4351
{{ end }}
4452
{{ end }}

0 commit comments

Comments
 (0)