-
Notifications
You must be signed in to change notification settings - Fork 68
K8SPG-586: Add delete-backups finalizer #989
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ca6bbe3
Implement delete-backups finalizer.
inelpandzic 64018fa
Merge branch 'main' into K8SPG-586-delete-backups-finalizer
inelpandzic 9e89c79
Fix pgbackrest command.
inelpandzic b6a740b
Merge branch 'main' into K8SPG-586-delete-backups-finalizer
inelpandzic 7df4578
Delete all PGBackup objects.
inelpandzic 8b0c1d1
Update pgbackrest command and finalizer exec order.
inelpandzic 82ee9f1
Update cr example.
inelpandzic d164cb6
Fix exec command.
inelpandzic ee4a70a
Add e2e test.
inelpandzic 3c04a87
Fix e2e test.
inelpandzic 2c4cfbb
Fix tests.
inelpandzic ff7357d
Merge branch 'main' into K8SPG-586-delete-backups-finalizer
inelpandzic 7634c62
Merge branch 'main' into K8SPG-586-delete-backups-finalizer
inelpandzic 04ff7a5
Merge branch 'main' into K8SPG-586-delete-backups-finalizer
inelpandzic bbe958a
Run stanza-delete only if stanza stop command succeeds.
inelpandzic 6f323f5
Merge branch 'main' into K8SPG-586-delete-backups-finalizer
inelpandzic 6b40cef
Merge branch 'main' into K8SPG-586-delete-backups-finalizer
hors 0e0b7cb
Merge branch 'main' into K8SPG-586-delete-backups-finalizer
inelpandzic 7a02763
Merge branch 'main' into K8SPG-586-delete-backups-finalizer
hors 092fab0
Fix build.
inelpandzic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,10 @@ | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestAssert | ||
| timeout: 30 | ||
| --- | ||
| kind: ConfigMap | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: 25-pg-backup-objects | ||
| data: | ||
| data: "0" |
19 changes: 19 additions & 0 deletions
19
e2e-tests/tests/demand-backup/25-delete-cluster-with-finalizer.yaml
This file contains hidden or 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,19 @@ | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestStep | ||
| commands: | ||
| - script: |- | ||
| set -o errexit | ||
| set -o xtrace | ||
|
|
||
| kubectl delete pg -n "${NAMESPACE}" demand-backup | ||
| sleep 15 | ||
|
|
||
| data=1 | ||
|
|
||
| res=$(kubectl -n "${NAMESPACE}" get pg-backup 2>&1 >/dev/null) | ||
|
|
||
| if [[ $res == *$(echo "No resources found in ${NAMESPACE} namespace.")* ]]; then | ||
| data=0 | ||
| fi | ||
|
|
||
| kubectl create configmap -n "${NAMESPACE}" 25-pg-backup-objects --from-literal=data="${data}" |
This file contains hidden or 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 hidden or 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,10 @@ | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestAssert | ||
| timeout: 30 | ||
| --- | ||
| kind: ConfigMap | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: 19-pg-backup-objects | ||
| data: | ||
| data: "0" |
19 changes: 19 additions & 0 deletions
19
e2e-tests/tests/scheduled-backup/19-delete-cluster-with-finalizer.yaml
This file contains hidden or 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,19 @@ | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestStep | ||
| commands: | ||
| - script: |- | ||
| set -o errexit | ||
| set -o xtrace | ||
|
|
||
| kubectl delete pg -n "${NAMESPACE}" scheduled-backup | ||
| sleep 15 | ||
|
|
||
| data=1 | ||
|
|
||
| res=$(kubectl -n "${NAMESPACE}" get pg-backup 2>&1 >/dev/null) | ||
|
|
||
| if [[ $res == *$(echo "No resources found in ${NAMESPACE} namespace.")* ]]; then | ||
| data=0 | ||
| fi | ||
|
|
||
| kubectl create configmap -n "${NAMESPACE}" 19-pg-backup-objects --from-literal=data="${data}" |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.