-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require a Postgres version when creating a PostgresCluster
This change adds a new flag 'pg-major-version' to the 'create postgrescluster' command to allow a specific Postgres version to be used for the PostgresCluster. The new flag is required and does not default to a particular version. As before, the image used by the cluster will be pulled from the corresponding 'RELATED_IMAGE' value set in the environment. KUTTL test updates are also included, along with a bump to Postgres 15 and a timeout adjustment. Issue: PGO-446
- Loading branch information
Showing
13 changed files
with
72 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
testing/kuttl/e2e/create/01--check_version_validation.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
# Verify the error when the Postgres version given is too low. | ||
TOO_LOW=$(kubectl-pgo create postgrescluster --pg-major-version=1 toolow 2>&1) | ||
if [[ "${TOO_LOW}" != "Error:"*"Invalid value"* ]]; then | ||
printf 'Expected invalid value error, got %q\n' "${TOO_LOW}" | ||
exit 1 | ||
fi | ||
# Verify the error when the Postgres version given is too high. | ||
TOO_HIGH=$(kubectl-pgo create postgrescluster --pg-major-version=100 toohigh 2>&1) | ||
if [[ "${TOO_HIGH}" != "Error:"*"Invalid value"* ]]; then | ||
printf 'Expected invalid value error, got %q\n' "${TOO_HIGH}" | ||
exit 1 | ||
fi | ||
# Verify the error when the Postgres version is not an integer. | ||
NOT_INT=$(kubectl-pgo create postgrescluster --pg-major-version=15.1 notint 2>&1) | ||
if [[ "${NOT_INT}" != "Error: invalid argument"* ]]; then | ||
printf 'Expected invalid argument error, got %q\n' "${NOT_INT}" | ||
exit 1 | ||
fi | ||
# Verify the error when the Postgres version is not a number. | ||
NOT_NUM=$(kubectl-pgo create postgrescluster --pg-major-version=x notnum 2>&1) | ||
if [[ "${NOT_NUM}" != "Error: invalid argument"* ]]; then | ||
printf 'Expected invalid argument error, got %q\n' "${NOT_NUM}" | ||
exit 1 | ||
fi | ||
# Verify the error when the Postgres version flag is not provided. | ||
MISSING=$(kubectl-pgo create postgrescluster missing 2>&1) | ||
if [[ "${MISSING}" != "Error: required flag"* ]]; then | ||
printf 'Expected required flag error, got %q\n' "${MISSING}" | ||
exit 1 | ||
fi | ||
# Verify the error when the Postgres version value is empty. | ||
NOT_SET=$(kubectl-pgo create postgrescluster --pg-major-version= notset 2>&1) | ||
if [[ "${NOT_SET}" != "Error: invalid argument"* ]]; then | ||
printf 'Expected invalid argument error, got %q\n' "${NOT_SET}" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters