Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow for different postgres versions #38

Merged
merged 1 commit into from
May 9, 2019
Merged

allow for different postgres versions #38

merged 1 commit into from
May 9, 2019

Conversation

pb82
Copy link
Contributor

@pb82 pb82 commented May 9, 2019

Allow the script to work with different postgres versions. It will default to 9.6 if POSTGRES_VERSION is not set in the secret.

Verification steps:

  1. Make sure backup is installed in your cluster
  2. Delete the 3scale-postgres-backup cronjob in order to avoid confusion (not strictly required)
  3. build an image from this branch and run:
oc new-app \
-f backup-job-template.yaml \
-p 'COMPONENT=postgres' \
-p 'COMPONENT_SECRET_NAME=threescale-postgres-secret' \
-p 'COMPONENT_SECRET_NAMESPACE=openshift-integreatly-backups' \
-p 'BACKEND_SECRET_NAME=s3-credentials' \
-p 'IMAGE=docker.io/pb82/backup-container-image:latest' \
-p 'NAME=3scale-postgres-backup' \
-p 'PRODUCT_NAME=3scale'
  1. It should fail with the error that the pg_dump version does not match the database version. You can check the logs by getting the pods first and then using oc logs <backup job pod name>
  2. Now edit the secret: oc edit secret threescale-postgres-secret
  3. and add a POSTGRES_VERSION: MTAK to the data (MTAK is base64 for 10).
  4. Delete the job and recreate it
  5. Check the logs again. This time the pg dump should work. The job will likely still fail because the encryption secret is missing or invalid. But the important part is that the database dump works.

@pb82 pb82 requested review from matskiv and odra May 9, 2019 12:40
@odra
Copy link
Contributor

odra commented May 9, 2019

giving it a try in my cluster

Copy link
Member

@matskiv matskiv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected. 👍
I didn't test the restoration because it's really time consuming, by I will suggest it to QE as test case for the release.

@pb82 pb82 merged commit 3274958 into master May 9, 2019
@pb82 pb82 deleted the INTLY-2023 branch May 9, 2019 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants