diff --git a/config/crd/bases/postgres-operator.crunchydata.com_pgupgrades.yaml b/config/crd/bases/postgres-operator.crunchydata.com_pgupgrades.yaml index d4c9f95bad..53d72671bc 100644 --- a/config/crd/bases/postgres-operator.crunchydata.com_pgupgrades.yaml +++ b/config/crd/bases/postgres-operator.crunchydata.com_pgupgrades.yaml @@ -963,6 +963,7 @@ spec: type: object fromPostgresVersion: description: The major version of PostgreSQL before the upgrade. + format: int32 maximum: 17 minimum: 11 type: integer @@ -984,7 +985,7 @@ spec: description: |- The image pull secrets used to pull from a private registry. Changing this value causes all running PGUpgrade pods to restart. - https://k8s.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry items: description: |- LocalObjectReference contains enough information to let you locate the @@ -1002,6 +1003,13 @@ spec: type: object x-kubernetes-map-type: atomic type: array + jobs: + description: |- + The number of simultaneous processes pg_upgrade should use. + More info: https://www.postgresql.org/docs/current/pgupgrade.html + format: int32 + minimum: 0 + type: integer metadata: description: Metadata contains metadata for custom resources properties: @@ -1015,14 +1023,14 @@ spec: type: object type: object postgresClusterName: - description: The name of the cluster to be updated + description: The name of the Postgres cluster to upgrade. minLength: 1 type: string priorityClassName: description: |- Priority class name for the PGUpgrade pod. Changing this value causes PGUpgrade pod to restart. - More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/ + More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption type: string resources: description: Resource requirements for the PGUpgrade container. @@ -1083,13 +1091,9 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - toPostgresImage: - description: |- - The image name to use for PostgreSQL containers after upgrade. - When omitted, the value comes from an operator environment variable. - type: string toPostgresVersion: description: The major version of PostgreSQL to be upgraded to. + format: int32 maximum: 17 minimum: 11 type: integer @@ -1134,11 +1138,30 @@ spec: type: string type: object type: array + transferMethod: + description: |- + The method pg_upgrade should use to transfer files to the new cluster. + More info: https://www.postgresql.org/docs/current/pgupgrade.html + enum: + - Clone + - Copy + - CopyFileRange + - Link + maxLength: 15 + type: string required: - fromPostgresVersion - postgresClusterName - toPostgresVersion type: object + x-kubernetes-validations: + - rule: self.fromPostgresVersion < self.toPostgresVersion + - message: Only Copy or Link before PostgreSQL 12 + rule: '!has(self.transferMethod) || (self.toPostgresVersion < 12 ? self.transferMethod + in ["Copy","Link"] : true)' + - message: Only Clone, Copy, or Link before PostgreSQL 17 + rule: '!has(self.transferMethod) || (self.toPostgresVersion < 17 ? self.transferMethod + in ["Clone","Copy","Link"] : true)' status: description: PGUpgradeStatus defines the observed state of PGUpgrade properties: diff --git a/internal/controller/pgupgrade/jobs.go b/internal/controller/pgupgrade/jobs.go index bb669d00a2..4879209734 100644 --- a/internal/controller/pgupgrade/jobs.go +++ b/internal/controller/pgupgrade/jobs.go @@ -5,8 +5,10 @@ package pgupgrade import ( + "cmp" "context" "fmt" + "math" "strings" appsv1 "k8s.io/api/apps/v1" @@ -35,9 +37,16 @@ func pgUpgradeJob(upgrade *v1beta1.PGUpgrade) metav1.ObjectMeta { // upgradeCommand returns an entrypoint that prepares the filesystem for // and performs a PostgreSQL major version upgrade using pg_upgrade. -func upgradeCommand(oldVersion, newVersion int, fetchKeyCommand string, availableCPUs int) []string { - // Use multiple CPUs when three or more are available. - argJobs := fmt.Sprintf(` --jobs=%d`, max(1, availableCPUs-1)) +func upgradeCommand(spec *v1beta1.PGUpgradeSettings, fetchKeyCommand string) []string { + argJobs := fmt.Sprintf(` --jobs=%d`, max(1, spec.Jobs)) + argMethod := cmp.Or(map[string]string{ + "Clone": ` --clone`, + "Copy": ` --copy`, + "CopyFileRange": ` --copy-file-range`, + }[spec.TransferMethod], ` --link`) + + oldVersion := spec.FromPostgresVersion + newVersion := spec.ToPostgresVersion // if the fetch key command is set for TDE, provide the value during initialization initdb := `/usr/pgsql-"${new_version}"/bin/initdb -k -D /pgdata/pg"${new_version}"` @@ -99,14 +108,14 @@ func upgradeCommand(oldVersion, newVersion int, fetchKeyCommand string, availabl `echo -e "Step 5: Running pg_upgrade check...\n"`, `time /usr/pgsql-"${new_version}"/bin/pg_upgrade --old-bindir /usr/pgsql-"${old_version}"/bin \`, `--new-bindir /usr/pgsql-"${new_version}"/bin --old-datadir /pgdata/pg"${old_version}"\`, - ` --new-datadir /pgdata/pg"${new_version}" --link --check` + argJobs, + ` --new-datadir /pgdata/pg"${new_version}" --check` + argMethod + argJobs, // Assuming the check completes successfully, the pg_upgrade command will // be run that actually prepares the upgraded pgdata directory. `echo -e "\nStep 6: Running pg_upgrade...\n"`, `time /usr/pgsql-"${new_version}"/bin/pg_upgrade --old-bindir /usr/pgsql-"${old_version}"/bin \`, `--new-bindir /usr/pgsql-"${new_version}"/bin --old-datadir /pgdata/pg"${old_version}" \`, - `--new-datadir /pgdata/pg"${new_version}" --link` + argJobs, + `--new-datadir /pgdata/pg"${new_version}"` + argMethod + argJobs, // Since we have cleared the Patroni cluster step by removing the EndPoints, we copy patroni.dynamic.json // from the old data dir to help retain PostgreSQL parameters you had set before. @@ -122,12 +131,12 @@ func upgradeCommand(oldVersion, newVersion int, fetchKeyCommand string, availabl // largestWholeCPU returns the maximum CPU request or limit as a non-negative // integer of CPUs. When resources lacks any CPU, the result is zero. -func largestWholeCPU(resources corev1.ResourceRequirements) int { +func largestWholeCPU(resources corev1.ResourceRequirements) int64 { // Read CPU quantities as millicores then divide to get the "floor." // NOTE: [resource.Quantity.Value] looks easier, but it rounds up. return max( - int(resources.Limits.Cpu().ScaledValue(resource.Milli)/1000), - int(resources.Requests.Cpu().ScaledValue(resource.Milli)/1000), + resources.Limits.Cpu().ScaledValue(resource.Milli)/1000, + resources.Requests.Cpu().ScaledValue(resource.Milli)/1000, 0) } @@ -180,10 +189,12 @@ func (r *PGUpgradeReconciler) generateUpgradeJob( job.Spec.BackoffLimit = initialize.Int32(0) job.Spec.Template.Spec.RestartPolicy = corev1.RestartPolicyNever - // When enabled, calculate the number of CPUs for pg_upgrade. - wholeCPUs := 0 - if feature.Enabled(ctx, feature.PGUpgradeCPUConcurrency) { - wholeCPUs = largestWholeCPU(upgrade.Spec.Resources) + settings := upgrade.Spec.PGUpgradeSettings.DeepCopy() + + // When jobs is undefined, use one less than the number of CPUs. + if settings.Jobs == 0 && feature.Enabled(ctx, feature.PGUpgradeCPUConcurrency) { + wholeCPUs := int32(min(math.MaxInt32, largestWholeCPU(upgrade.Spec.Resources))) + settings.Jobs = wholeCPUs - 1 } // Replace all containers with one that does the upgrade. @@ -198,11 +209,7 @@ func (r *PGUpgradeReconciler) generateUpgradeJob( VolumeMounts: database.VolumeMounts, // Use our upgrade command and the specified image and resources. - Command: upgradeCommand( - upgrade.Spec.FromPostgresVersion, - upgrade.Spec.ToPostgresVersion, - fetchKeyCommand, - wholeCPUs), + Command: upgradeCommand(settings, fetchKeyCommand), Image: pgUpgradeContainerImage(upgrade), ImagePullPolicy: upgrade.Spec.ImagePullPolicy, Resources: upgrade.Spec.Resources, diff --git a/internal/controller/pgupgrade/jobs_test.go b/internal/controller/pgupgrade/jobs_test.go index 7136fcf5ab..664c1c5346 100644 --- a/internal/controller/pgupgrade/jobs_test.go +++ b/internal/controller/pgupgrade/jobs_test.go @@ -23,13 +23,13 @@ import ( ) func TestLargestWholeCPU(t *testing.T) { - assert.Equal(t, 0, + assert.Equal(t, int64(0), largestWholeCPU(corev1.ResourceRequirements{}), "expected the zero value to be zero") for _, tt := range []struct { Name, ResourcesYAML string - Result int + Result int64 }{ { Name: "Negatives", ResourcesYAML: `{requests: {cpu: -3}, limits: {cpu: -5}}`, @@ -72,27 +72,53 @@ func TestUpgradeCommand(t *testing.T) { }) } - t.Run("CPUs", func(t *testing.T) { + t.Run("Jobs", func(t *testing.T) { for _, tt := range []struct { - CPUs int - Jobs string + Spec int32 + Args string }{ - {CPUs: 0, Jobs: "--jobs=1"}, - {CPUs: 1, Jobs: "--jobs=1"}, - {CPUs: 2, Jobs: "--jobs=1"}, - {CPUs: 3, Jobs: "--jobs=2"}, - {CPUs: 10, Jobs: "--jobs=9"}, + {Spec: -1, Args: "--jobs=1"}, + {Spec: 0, Args: "--jobs=1"}, + {Spec: 1, Args: "--jobs=1"}, + {Spec: 2, Args: "--jobs=2"}, + {Spec: 10, Args: "--jobs=10"}, } { - command := upgradeCommand(10, 11, "", tt.CPUs) + spec := &v1beta1.PGUpgradeSettings{Jobs: tt.Spec} + command := upgradeCommand(spec, "") assert.Assert(t, len(command) > 3) assert.DeepEqual(t, []string{"bash", "-ceu", "--"}, command[:3]) script := command[3] - assert.Assert(t, cmp.Contains(script, tt.Jobs)) + assert.Assert(t, cmp.Contains(script, tt.Args)) expectScript(t, script) } }) + + t.Run("Method", func(t *testing.T) { + for _, tt := range []struct { + Spec string + Args string + }{ + {Spec: "", Args: "--link"}, + {Spec: "mystery!", Args: "--link"}, + {Spec: "Link", Args: "--link"}, + {Spec: "Clone", Args: "--clone"}, + {Spec: "Copy", Args: "--copy"}, + {Spec: "CopyFileRange", Args: "--copy-file-range"}, + } { + spec := &v1beta1.PGUpgradeSettings{TransferMethod: tt.Spec} + command := upgradeCommand(spec, "") + assert.Assert(t, len(command) > 3) + assert.DeepEqual(t, []string{"bash", "-ceu", "--"}, command[:3]) + + script := command[3] + assert.Assert(t, cmp.Contains(script, tt.Args)) + + expectScript(t, script) + } + + }) } func TestGenerateUpgradeJob(t *testing.T) { @@ -194,7 +220,7 @@ spec: echo -e "Step 5: Running pg_upgrade check...\n" time /usr/pgsql-"${new_version}"/bin/pg_upgrade --old-bindir /usr/pgsql-"${old_version}"/bin \ --new-bindir /usr/pgsql-"${new_version}"/bin --old-datadir /pgdata/pg"${old_version}"\ - --new-datadir /pgdata/pg"${new_version}" --link --check --jobs=1 + --new-datadir /pgdata/pg"${new_version}" --check --link --jobs=1 echo -e "\nStep 6: Running pg_upgrade...\n" time /usr/pgsql-"${new_version}"/bin/pg_upgrade --old-bindir /usr/pgsql-"${old_version}"/bin \ --new-bindir /usr/pgsql-"${new_version}"/bin --old-datadir /pgdata/pg"${old_version}" \ diff --git a/internal/controller/pgupgrade/pgupgrade_controller.go b/internal/controller/pgupgrade/pgupgrade_controller.go index e1efb44e50..06a36574f0 100644 --- a/internal/controller/pgupgrade/pgupgrade_controller.go +++ b/internal/controller/pgupgrade/pgupgrade_controller.go @@ -153,6 +153,7 @@ func (r *PGUpgradeReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( setStatusToProgressingIfReasonWas("", upgrade) // The "from" version must be smaller than the "to" version. + // NOTE: CRD validation also rejects these values. // An invalid PGUpgrade should not be requeued. if upgrade.Spec.FromPostgresVersion >= upgrade.Spec.ToPostgresVersion { @@ -418,7 +419,7 @@ func (r *PGUpgradeReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( // Set the cluster status when we know the upgrade has completed successfully. // This will serve to help the user see that the upgrade has completed if they // are only watching the PostgresCluster - patch.Status.PostgresVersion = upgrade.Spec.ToPostgresVersion + patch.Status.PostgresVersion = int(upgrade.Spec.ToPostgresVersion) // Set the pgBackRest status for bootstrapping patch.Status.PGBackRest.Repos = []v1beta1.RepoStatus{} diff --git a/internal/feature/features.go b/internal/feature/features.go index c46f3de061..50169538b9 100644 --- a/internal/feature/features.go +++ b/internal/feature/features.go @@ -113,7 +113,7 @@ func NewGate() MutableGate { OpenTelemetryLogs: {Default: false, PreRelease: featuregate.Alpha}, OpenTelemetryMetrics: {Default: false, PreRelease: featuregate.Alpha}, PGBouncerSidecars: {Default: false, PreRelease: featuregate.Alpha}, - PGUpgradeCPUConcurrency: {Default: false, PreRelease: featuregate.Alpha}, + PGUpgradeCPUConcurrency: {Default: true, PreRelease: featuregate.Beta}, TablespaceVolumes: {Default: false, PreRelease: featuregate.Alpha}, VolumeSnapshots: {Default: false, PreRelease: featuregate.Alpha}, }); err != nil { diff --git a/internal/feature/features_test.go b/internal/feature/features_test.go index 70243a9794..93683de4f0 100644 --- a/internal/feature/features_test.go +++ b/internal/feature/features_test.go @@ -24,7 +24,7 @@ func TestDefaults(t *testing.T) { assert.Assert(t, false == gate.Enabled(OpenTelemetryLogs)) assert.Assert(t, false == gate.Enabled(OpenTelemetryMetrics)) assert.Assert(t, false == gate.Enabled(PGBouncerSidecars)) - assert.Assert(t, false == gate.Enabled(PGUpgradeCPUConcurrency)) + assert.Assert(t, true == gate.Enabled(PGUpgradeCPUConcurrency)) assert.Assert(t, false == gate.Enabled(TablespaceVolumes)) assert.Assert(t, false == gate.Enabled(VolumeSnapshots)) } diff --git a/internal/upgradecheck/http_test.go b/internal/upgradecheck/http_test.go index 6b6d419b4d..eb951f815f 100644 --- a/internal/upgradecheck/http_test.go +++ b/internal/upgradecheck/http_test.go @@ -67,7 +67,7 @@ func TestCheckForUpgrades(t *testing.T) { assert.Equal(t, data.RegistrationToken, "speakFriend") assert.Equal(t, data.BridgeClustersTotal, 2) assert.Equal(t, data.PGOClustersTotal, 2) - assert.Equal(t, data.FeatureGatesEnabled, "AutoCreateUserSchema=true,TablespaceVolumes=true") + assert.Equal(t, data.FeatureGatesEnabled, "AutoCreateUserSchema=true,PGUpgradeCPUConcurrency=true,TablespaceVolumes=true") } t.Run("success", func(t *testing.T) { diff --git a/pkg/apis/postgres-operator.crunchydata.com/v1beta1/pgupgrade_types.go b/pkg/apis/postgres-operator.crunchydata.com/v1beta1/pgupgrade_types.go index 8b87a7b2c7..e0bfe86d5d 100644 --- a/pkg/apis/postgres-operator.crunchydata.com/v1beta1/pgupgrade_types.go +++ b/pkg/apis/postgres-operator.crunchydata.com/v1beta1/pgupgrade_types.go @@ -15,9 +15,10 @@ type PGUpgradeSpec struct { // +optional Metadata *Metadata `json:"metadata,omitempty"` - // The name of the cluster to be updated - // +required + // The name of the Postgres cluster to upgrade. + // --- // +kubebuilder:validation:MinLength=1 + // +required PostgresClusterName string `json:"postgresClusterName"` // The image name to use for major PostgreSQL upgrades. @@ -42,38 +43,10 @@ type PGUpgradeSpec struct { // The image pull secrets used to pull from a private registry. // Changing this value causes all running PGUpgrade pods to restart. - // https://k8s.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + // https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry // +optional ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` - // TODO(benjaminjb): define webhook validation to make sure - // `fromPostgresVersion` is below `toPostgresVersion` - // or leverage other validation rules, such as the Common Expression Language - // rules currently in alpha as of Kubernetes 1.23 - // - https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation-rules - - // The major version of PostgreSQL before the upgrade. - // +kubebuilder:validation:Required - // +kubebuilder:validation:Minimum=11 - // +kubebuilder:validation:Maximum=17 - FromPostgresVersion int `json:"fromPostgresVersion"` - - // TODO(benjaminjb): define webhook validation to make sure - // `fromPostgresVersion` is below `toPostgresVersion` - // or leverage other validation rules, such as the Common Expression Language - // rules currently in alpha as of Kubernetes 1.23 - - // The major version of PostgreSQL to be upgraded to. - // +kubebuilder:validation:Required - // +kubebuilder:validation:Minimum=11 - // +kubebuilder:validation:Maximum=17 - ToPostgresVersion int `json:"toPostgresVersion"` - - // The image name to use for PostgreSQL containers after upgrade. - // When omitted, the value comes from an operator environment variable. - // +optional - ToPostgresImage string `json:"toPostgresImage,omitempty"` - // Resource requirements for the PGUpgrade container. // +optional Resources corev1.ResourceRequirements `json:"resources,omitempty"` @@ -88,7 +61,7 @@ type PGUpgradeSpec struct { // Priority class name for the PGUpgrade pod. Changing this // value causes PGUpgrade pod to restart. - // More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/ + // More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption // +optional PriorityClassName *string `json:"priorityClassName,omitempty"` @@ -96,6 +69,54 @@ type PGUpgradeSpec struct { // More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration // +optional Tolerations []corev1.Toleration `json:"tolerations,omitempty"` + + PGUpgradeSettings `json:",inline"` +} + +// Arguments and settings for the pg_upgrade tool. +// See: https://www.postgresql.org/docs/current/pgupgrade.html +// --- +// +kubebuilder:validation:XValidation:rule=`self.fromPostgresVersion < self.toPostgresVersion` +// +kubebuilder:validation:XValidation:rule=`!has(self.transferMethod) || (self.toPostgresVersion < 12 ? self.transferMethod in ["Copy","Link"] : true)`,message="Only Copy or Link before PostgreSQL 12" +// +kubebuilder:validation:XValidation:rule=`!has(self.transferMethod) || (self.toPostgresVersion < 17 ? self.transferMethod in ["Clone","Copy","Link"] : true)`,message="Only Clone, Copy, or Link before PostgreSQL 17" +type PGUpgradeSettings struct { + + // The major version of PostgreSQL before the upgrade. + // --- + // +kubebuilder:validation:Minimum=11 + // +kubebuilder:validation:Maximum=17 + // +required + FromPostgresVersion int32 `json:"fromPostgresVersion"` + + // The number of simultaneous processes pg_upgrade should use. + // More info: https://www.postgresql.org/docs/current/pgupgrade.html + // --- + // +kubebuilder:validation:Minimum=0 + // +optional + Jobs int32 `json:"jobs,omitempty"` + + // The major version of PostgreSQL to be upgraded to. + // --- + // +kubebuilder:validation:Minimum=11 + // +kubebuilder:validation:Maximum=17 + // +required + ToPostgresVersion int32 `json:"toPostgresVersion"` + + // The method pg_upgrade should use to transfer files to the new cluster. + // More info: https://www.postgresql.org/docs/current/pgupgrade.html + // --- + // Different versions of the tool have different methods. + // - Copy and Link forever: https://git.postgresql.org/gitweb/?p=postgresql.git;f=src/bin/pg_upgrade/pg_upgrade.h;hb=REL_10_0#l232 + // - Clone since 12: https://git.postgresql.org/gitweb/?p=postgresql.git;f=src/bin/pg_upgrade/pg_upgrade.h;hb=REL_12_0#l232 + // - CopyFileRange since 17: https://git.postgresql.org/gitweb/?p=postgresql.git;f=src/bin/pg_upgrade/pg_upgrade.h;hb=REL_17_0#l251 + // + // Kubernetes assumes the evaluation cost of an enum value is very large. + // TODO(k8s-1.29): Drop MaxLength after Kubernetes 1.29; https://issue.k8s.io/119511 + // +kubebuilder:validation:MaxLength=15 + // + // +kubebuilder:validation:Enum={Clone,Copy,CopyFileRange,Link} + // +optional + TransferMethod string `json:"transferMethod,omitempty"` } // PGUpgradeStatus defines the observed state of PGUpgrade diff --git a/pkg/apis/postgres-operator.crunchydata.com/v1beta1/zz_generated.deepcopy.go b/pkg/apis/postgres-operator.crunchydata.com/v1beta1/zz_generated.deepcopy.go index 70147d39bf..4e68cabafd 100644 --- a/pkg/apis/postgres-operator.crunchydata.com/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/postgres-operator.crunchydata.com/v1beta1/zz_generated.deepcopy.go @@ -1472,6 +1472,21 @@ func (in *PGUpgradeList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PGUpgradeSettings) DeepCopyInto(out *PGUpgradeSettings) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PGUpgradeSettings. +func (in *PGUpgradeSettings) DeepCopy() *PGUpgradeSettings { + if in == nil { + return nil + } + out := new(PGUpgradeSettings) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PGUpgradeSpec) DeepCopyInto(out *PGUpgradeSpec) { *out = *in @@ -1508,6 +1523,7 @@ func (in *PGUpgradeSpec) DeepCopyInto(out *PGUpgradeSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + out.PGUpgradeSettings = in.PGUpgradeSettings } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PGUpgradeSpec. diff --git a/testing/kuttl/e2e/major-upgrade/01--invalid-pgupgrade.yaml b/testing/kuttl/e2e/major-upgrade/01--invalid-pgupgrade.yaml deleted file mode 100644 index ea90f5718a..0000000000 --- a/testing/kuttl/e2e/major-upgrade/01--invalid-pgupgrade.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# This pgupgrade is invalid and should get that condition (even with no cluster) -apiVersion: postgres-operator.crunchydata.com/v1beta1 -kind: PGUpgrade -metadata: - name: major-upgrade-do-it -spec: - fromPostgresVersion: ${KUTTL_PG_VERSION} - toPostgresVersion: ${KUTTL_PG_VERSION} - postgresClusterName: major-upgrade diff --git a/testing/kuttl/e2e/major-upgrade/01-assert.yaml b/testing/kuttl/e2e/major-upgrade/01-assert.yaml deleted file mode 100644 index f4cef66aa7..0000000000 --- a/testing/kuttl/e2e/major-upgrade/01-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -apiVersion: postgres-operator.crunchydata.com/v1beta1 -kind: PGUpgrade -metadata: - name: major-upgrade-do-it -status: - conditions: - - type: "Progressing" - status: "False" - reason: "PGUpgradeInvalid" diff --git a/testing/kuttl/e2e/major-upgrade/20--cluster-with-invalid-version.yaml b/testing/kuttl/e2e/major-upgrade/20--cluster-with-invalid-version.yaml deleted file mode 100644 index 8d73277292..0000000000 --- a/testing/kuttl/e2e/major-upgrade/20--cluster-with-invalid-version.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# Create a cluster where the version does not match the pgupgrade's `from` -# TODO(benjaminjb): this isn't quite working out -# apiVersion: postgres-operator.crunchydata.com/v1beta1 -# kind: PostgresCluster -# metadata: -# name: major-upgrade -# spec: -# shutdown: true -# postgresVersion: ${KUTTL_PG_UPGRADE_TOO_EARLY_FROM_VERSION} -# instances: -# - dataVolumeClaimSpec: { accessModes: [ReadWriteOnce], resources: { requests: { storage: 1Gi } } } -# backups: -# pgbackrest: -# repos: -# - name: repo1 -# volume: -# volumeClaimSpec: { accessModes: [ReadWriteOnce], resources: { requests: { storage: 1Gi } } } diff --git a/testing/kuttl/e2e/major-upgrade/20-assert.yaml b/testing/kuttl/e2e/major-upgrade/20-assert.yaml deleted file mode 100644 index 2ea1486284..0000000000 --- a/testing/kuttl/e2e/major-upgrade/20-assert.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# # pgupgrade should exit since the cluster is already at the requested version -# apiVersion: postgres-operator.crunchydata.com/v1beta1 -# kind: PGUpgrade -# metadata: -# name: major-upgrade-do-it -# status: -# conditions: -# - type: "Progressing" -# status: "False" -# reason: "PGUpgradeInvalidForCluster" diff --git a/testing/kuttl/e2e/major-upgrade/21-delete-cluster.yaml b/testing/kuttl/e2e/major-upgrade/21-delete-cluster.yaml deleted file mode 100644 index 535c6311a4..0000000000 --- a/testing/kuttl/e2e/major-upgrade/21-delete-cluster.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# # Delete the existing cluster. -# apiVersion: kuttl.dev/v1beta1 -# kind: TestStep -# delete: -# - apiVersion: postgres-operator.crunchydata.com/v1beta1 -# kind: PostgresCluster -# name: major-upgrade