diff --git a/charts/postgres-operator/crds/operatorconfigurations.yaml b/charts/postgres-operator/crds/operatorconfigurations.yaml index f6d1f5912..d5af19e2d 100644 --- a/charts/postgres-operator/crds/operatorconfigurations.yaml +++ b/charts/postgres-operator/crds/operatorconfigurations.yaml @@ -130,13 +130,6 @@ spec: major_version_upgrade: type: object properties: - allowed_major_upgrade_versions: - type: array - items: - type: string - default: - - "12" - - "13" major_version_upgrade_mode: type: string default: "off" diff --git a/charts/postgres-operator/values-crd.yaml b/charts/postgres-operator/values-crd.yaml index a81ccf466..f9b1000f9 100644 --- a/charts/postgres-operator/values-crd.yaml +++ b/charts/postgres-operator/values-crd.yaml @@ -59,10 +59,6 @@ configUsers: super_username: postgres configMajorVersionUpgrade: - # to allow major version upgrades only to certain Postgres versions - allowed_major_upgrade_versions: - - "12" - - "13" # "off": no upgrade, "manual": manifest triggers action, "full": minimal version violation triggers too major_version_upgrade_mode: "off" # minimal Postgres major version that will not automatically be upgraded diff --git a/charts/postgres-operator/values.yaml b/charts/postgres-operator/values.yaml index df65c00f3..482df042a 100644 --- a/charts/postgres-operator/values.yaml +++ b/charts/postgres-operator/values.yaml @@ -61,8 +61,6 @@ configUsers: super_username: postgres configMajorVersionUpgrade: - # to allow major version upgrades only to certain Postgres versions - allowed_major_upgrade_versions: "12,13" # "off": no upgrade, "manual": manifest triggers action, "full": minimal version violation triggers too major_version_upgrade_mode: "off" # minimal Postgres major version that will not automatically be upgraded diff --git a/docs/administrator.md b/docs/administrator.md index c74729ea1..878e53fa2 100644 --- a/docs/administrator.md +++ b/docs/administrator.md @@ -32,8 +32,8 @@ In-place major version upgrades can be configured to be executed by the operator with the `major_version_upgrade_mode` option. By default it is set to `off` which means the cluster version will not change when increased in the manifest. Still, a rolling update would be triggered updating the -`PGVERSION` variable. But `configure_spilo` will notice the version mismatch -and start the old version again. +`PGVERSION` variable. But Spilo's [`configure_spilo`](https://github.com/zalando/spilo/blob/master/postgres-appliance/scripts/configure_spilo.py) +script will notice the version mismatch and start the old version again. In this scenario the major version could then be run by a user from within the master pod. Exec into the container and run: diff --git a/docs/reference/operator_parameters.md b/docs/reference/operator_parameters.md index a1b72b5ff..13402d15f 100644 --- a/docs/reference/operator_parameters.md +++ b/docs/reference/operator_parameters.md @@ -193,11 +193,6 @@ CRD-configuration, they are grouped under the `major_version_upgrade` key. which violate the configured allowed `minimal_major_version` when `major_version_upgrade_mode` is set to `"full"`. The default is `"13"`. -* **allowed_major_upgrade_versions** - Allow major version upgrades only to certain Postgres versions. - The default is `["12", "13"]`. - - ## Kubernetes resources Parameters to configure cluster-related Kubernetes objects created by the diff --git a/manifests/configmap.yaml b/manifests/configmap.yaml index a7d891e6d..02803123a 100644 --- a/manifests/configmap.yaml +++ b/manifests/configmap.yaml @@ -6,7 +6,6 @@ data: # additional_pod_capabilities: "SYS_NICE" # additional_secret_mount: "some-secret-name" # additional_secret_mount_path: "/some/dir" - # allowed_major_upgrade_versions: "12,13" api_port: "8080" aws_region: eu-central-1 cluster_domain: cluster.local diff --git a/manifests/operatorconfiguration.crd.yaml b/manifests/operatorconfiguration.crd.yaml index 26ea989bd..2c6d0ccac 100644 --- a/manifests/operatorconfiguration.crd.yaml +++ b/manifests/operatorconfiguration.crd.yaml @@ -126,13 +126,6 @@ spec: major_version_upgrade: type: object properties: - allowed_major_upgrade_versions: - type: array - items: - type: string - default: - - "12" - - "13" major_version_upgrade_mode: type: string default: "off" diff --git a/manifests/postgresql-operator-default-configuration.yaml b/manifests/postgresql-operator-default-configuration.yaml index fcfa15c11..535d9a4ea 100644 --- a/manifests/postgresql-operator-default-configuration.yaml +++ b/manifests/postgresql-operator-default-configuration.yaml @@ -27,9 +27,6 @@ configuration: replication_username: standby super_username: postgres major_version_upgrade: - allowed_major_upgrade_versions: - - "12" - - "13" major_version_upgrade_mode: "off" minimal_major_version: "9.5" target_major_version: "13" diff --git a/pkg/apis/acid.zalan.do/v1/crds.go b/pkg/apis/acid.zalan.do/v1/crds.go index 5d76ab444..ef376653d 100644 --- a/pkg/apis/acid.zalan.do/v1/crds.go +++ b/pkg/apis/acid.zalan.do/v1/crds.go @@ -968,14 +968,6 @@ var OperatorConfigCRDResourceValidation = apiextv1.CustomResourceValidation{ "major_version_upgrade": { Type: "object", Properties: map[string]apiextv1.JSONSchemaProps{ - "allowed_major_upgrade_versions": { - Type: "array", - Items: &apiextv1.JSONSchemaPropsOrArray{ - Schema: &apiextv1.JSONSchemaProps{ - Type: "string", - }, - }, - }, "major_version_upgrade_mode": { Type: "string", }, diff --git a/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go b/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go index 8d99ecd3c..5400e6f0e 100644 --- a/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go +++ b/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go @@ -46,7 +46,6 @@ type MajorVersionUpgradeConfiguration struct { MajorVersionUpgradeMode string `json:"major_version_upgrade_mode" default:"off"` // off - no actions, manual - manifest triggers action, full - manifest and minimal version violation trigger upgrade MinimalMajorVersion string `json:"minimal_major_version" default:"9.5"` TargetMajorVersion string `json:"target_major_version" default:"13"` - AllowedMajorUpgradeVersions []string `json:"allowed_major_upgrade_versions" default:"12,13"` } // KubernetesMetaConfiguration defines k8s conf required for all Postgres clusters and the operator itself diff --git a/pkg/apis/acid.zalan.do/v1/zz_generated.deepcopy.go b/pkg/apis/acid.zalan.do/v1/zz_generated.deepcopy.go index 19bcc091d..8da5eb6ba 100644 --- a/pkg/apis/acid.zalan.do/v1/zz_generated.deepcopy.go +++ b/pkg/apis/acid.zalan.do/v1/zz_generated.deepcopy.go @@ -312,11 +312,6 @@ func (in *MaintenanceWindow) DeepCopy() *MaintenanceWindow { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MajorVersionUpgradeConfiguration) DeepCopyInto(out *MajorVersionUpgradeConfiguration) { *out = *in - if in.AllowedMajorUpgradeVersions != nil { - in, out := &in.AllowedMajorUpgradeVersions, &out.AllowedMajorUpgradeVersions - *out = make([]string, len(*in)) - copy(*out, *in) - } return } @@ -385,7 +380,7 @@ func (in *OperatorConfigurationData) DeepCopyInto(out *OperatorConfigurationData } } out.PostgresUsersConfiguration = in.PostgresUsersConfiguration - in.MajorVersionUpgrade.DeepCopyInto(&out.MajorVersionUpgrade) + out.MajorVersionUpgrade = in.MajorVersionUpgrade in.Kubernetes.DeepCopyInto(&out.Kubernetes) out.PostgresPodResources = in.PostgresPodResources out.Timeouts = in.Timeouts diff --git a/pkg/controller/operator_config.go b/pkg/controller/operator_config.go index 38590ff8e..85890c022 100644 --- a/pkg/controller/operator_config.go +++ b/pkg/controller/operator_config.go @@ -58,7 +58,6 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur result.MajorVersionUpgradeMode = util.Coalesce(fromCRD.MajorVersionUpgrade.MajorVersionUpgradeMode, "off") result.MinimalMajorVersion = util.Coalesce(fromCRD.MajorVersionUpgrade.MinimalMajorVersion, "9.5") result.TargetMajorVersion = util.Coalesce(fromCRD.MajorVersionUpgrade.TargetMajorVersion, "13") - result.AllowedMajorUpgradeVersions = util.CoalesceStrArr(fromCRD.MajorVersionUpgrade.AllowedMajorUpgradeVersions, []string{"12", "13"}) // kubernetes config result.CustomPodAnnotations = fromCRD.Kubernetes.CustomPodAnnotations diff --git a/pkg/util/config/config.go b/pkg/util/config/config.go index a909f6989..10e2b35c0 100644 --- a/pkg/util/config/config.go +++ b/pkg/util/config/config.go @@ -209,7 +209,6 @@ type Config struct { MajorVersionUpgradeMode string `name:"major_version_upgrade_mode" default:"off"` MinimalMajorVersion string `name:"minimal_major_version" default:"9.5"` TargetMajorVersion string `name:"target_major_version" default:"13"` - AllowedMajorUpgradeVersions []string `name:"allowed_major_upgrade_versions" default:"12,13"` } // MustMarshal marshals the config or panics