From 578a2f5fd2194563ff8fcbbb511279759611fd93 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Thu, 7 Oct 2021 17:17:35 +0200 Subject: [PATCH] don't be too hard to 9.5 --- charts/postgres-operator/crds/postgresqls.yaml | 1 + manifests/postgresql.crd.yaml | 1 + pkg/apis/acid.zalan.do/v1/crds.go | 3 +++ pkg/cluster/majorversionupgrade.go | 3 ++- ui/operator_ui/spiloutils.py | 2 +- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/charts/postgres-operator/crds/postgresqls.yaml b/charts/postgres-operator/crds/postgresqls.yaml index b5da81103..9ac4cfb3a 100644 --- a/charts/postgres-operator/crds/postgresqls.yaml +++ b/charts/postgres-operator/crds/postgresqls.yaml @@ -362,6 +362,7 @@ spec: version: type: string enum: + - "9.5" - "9.6" - "10" - "11" diff --git a/manifests/postgresql.crd.yaml b/manifests/postgresql.crd.yaml index 7465a23be..0f7524bcc 100644 --- a/manifests/postgresql.crd.yaml +++ b/manifests/postgresql.crd.yaml @@ -358,6 +358,7 @@ spec: version: type: string enum: + - "9.5" - "9.6" - "10" - "11" diff --git a/pkg/apis/acid.zalan.do/v1/crds.go b/pkg/apis/acid.zalan.do/v1/crds.go index 886387fb0..582b1379e 100644 --- a/pkg/apis/acid.zalan.do/v1/crds.go +++ b/pkg/apis/acid.zalan.do/v1/crds.go @@ -504,6 +504,9 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{ "version": { Type: "string", Enum: []apiextv1.JSON{ + { + Raw: []byte(`"9.5"`), + }, { Raw: []byte(`"9.6"`), }, diff --git a/pkg/cluster/majorversionupgrade.go b/pkg/cluster/majorversionupgrade.go index c0f868820..edb55c882 100644 --- a/pkg/cluster/majorversionupgrade.go +++ b/pkg/cluster/majorversionupgrade.go @@ -9,6 +9,7 @@ import ( // VersionMap Map of version numbers var VersionMap = map[string]int{ + "9.5": 90500, "9.6": 90600, "10": 100000, "11": 110000, @@ -33,7 +34,7 @@ func (c *Cluster) GetDesiredMajorVersionAsInt() int { func (c *Cluster) GetDesiredMajorVersion() string { if c.Config.OpConfig.MajorVersionUpgradeMode == "full" { - // current is 9.6, minimal is 11 allowing 11 to 14 clusters, everything below is upgraded + // e.g. current is 9.6, minimal is 11 allowing 11 to 14 clusters, everything below is upgraded if IsBiggerPostgresVersion(c.Spec.PgVersion, c.Config.OpConfig.MinimalMajorVersion) { c.logger.Infof("overwriting configured major version %s to %s", c.Spec.PgVersion, c.Config.OpConfig.TargetMajorVersion) return c.Config.OpConfig.TargetMajorVersion diff --git a/ui/operator_ui/spiloutils.py b/ui/operator_ui/spiloutils.py index 1fc7a1b8e..b9c599c44 100644 --- a/ui/operator_ui/spiloutils.py +++ b/ui/operator_ui/spiloutils.py @@ -308,7 +308,7 @@ def read_versions( if uid == 'wal' or defaulting(lambda: UUID(uid)) ] -BACKUP_VERSION_PREFIXES = ['', '9.6/', '10/', '11/', '12/', '13/', '14/'] +BACKUP_VERSION_PREFIXES = ['', '9.5/', '9.6/', '10/', '11/', '12/', '13/', '14/'] def read_basebackups( pg_cluster,