feat(crdb): use crdb native backup and s3 backup added (#1915)

* fix(zitadelctl): implement takedown command

* fix(zitadelctl): correct destroy flow

* fix(zitadelctl): correct backup commands to read crds beforehand

* fix: add of destroyfile

* fix: clean for userlist

* fix: change backup and restore to crdb native

* fix: timeout for delete pvc for cockroachdb

* fix: corrected unit tests

* fix: add ignored file for scale

* fix: correct handling of gitops in backup command

* feat: add s3 backup kind

* fix: backuplist for s3 and timeout for pv deletion

* fix(database): fix nil pointer with binary version

* fix(database): cleanup of errors which cam with merging of the s3 logic

* fix: correct unit tests

* fix: cleanup monitor output

Co-authored-by: Elio Bischof <[email protected]>

* fix: backup imagepullpolixy to ifnotpresent

Co-authored-by: Elio Bischof <[email protected]>
This commit is contained in:
Stefan Benz
2021-10-13 14:34:03 +02:00
committed by GitHub
co-authored by Elio Bischof
parent 591a460450
commit 425a8b5fd5
67 changed files with 3867 additions and 626 deletions
@@ -10,7 +10,6 @@ import (
"github.com/caos/orbos/pkg/secret"
"github.com/caos/orbos/pkg/tree"
"github.com/caos/zitadel/operator/database/kinds/backups/bucket/backup"
"github.com/caos/zitadel/operator/database/kinds/backups/bucket/clean"
"github.com/caos/zitadel/operator/database/kinds/backups/bucket/restore"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
@@ -27,6 +26,8 @@ func TestBucket_Secrets(t *testing.T) {
monitor := mntr.Monitor{}
namespace := "testNs2"
dbURL := "testDB"
dbPort := int32(80)
kindVersion := "v0"
kind := "BucketBackup"
componentLabels := labels.MustForComponent(labels.MustForAPI(labels.MustForOperator("testProd", "testOp", "testVersion"), "BucketBackup", kindVersion), "testComponent")
@@ -67,6 +68,8 @@ func TestBucket_Secrets(t *testing.T) {
nodeselector,
tolerations,
version,
dbURL,
dbPort,
features,
"",
)(
@@ -88,6 +91,8 @@ func TestBucket_AdaptBackup(t *testing.T) {
features := []string{backup.Normal}
saJson := "testSA"
dbURL := "testDB"
dbPort := int32(80)
bucketName := "testBucket2"
cron := "testCron2"
monitor := mntr.Monitor{}
@@ -137,6 +142,8 @@ func TestBucket_AdaptBackup(t *testing.T) {
nodeselector,
tolerations,
version,
dbURL,
dbPort,
features,
"",
)(
@@ -163,6 +170,8 @@ func TestBucket_AdaptInstantBackup(t *testing.T) {
cron := "testCron"
monitor := mntr.Monitor{}
namespace := "testNs"
dbURL := "testDB"
dbPort := int32(80)
componentLabels := labels.MustForComponent(labels.MustForAPI(labels.MustForOperator("testProd", "testOp", "testVersion"), "BucketBackup", "v0"), "testComponent")
k8sLabels := map[string]string{
@@ -209,6 +218,8 @@ func TestBucket_AdaptInstantBackup(t *testing.T) {
nodeselector,
tolerations,
version,
dbURL,
dbPort,
features,
"",
)(
@@ -254,6 +265,8 @@ func TestBucket_AdaptRestore(t *testing.T) {
backupName := "testName"
version := "testVersion"
saJson := "testSA"
dbURL := "testDB"
dbPort := int32(80)
desired := getDesiredTree(t, masterkey, &DesiredV0{
Common: tree.NewCommon("databases.caos.ch/BucketBackup", "v0", false),
@@ -282,6 +295,8 @@ func TestBucket_AdaptRestore(t *testing.T) {
nodeselector,
tolerations,
version,
dbURL,
dbPort,
features,
"",
)(
@@ -299,6 +314,7 @@ func TestBucket_AdaptRestore(t *testing.T) {
assert.NoError(t, ensure(client))
}
/*
func TestBucket_AdaptClean(t *testing.T) {
masterkey := "testMk"
client := kubernetesmock.NewMockClientInt(gomock.NewController(t))
@@ -327,6 +343,8 @@ func TestBucket_AdaptClean(t *testing.T) {
backupName := "testName"
version := "testVersion"
saJson := "testSA"
dbURL := "testDB"
dbPort := int32(80)
desired := getDesiredTree(t, masterkey, &DesiredV0{
Common: tree.NewCommon("databases.caos.ch/BucketBackup", "v0", false),
@@ -355,6 +373,8 @@ func TestBucket_AdaptClean(t *testing.T) {
nodeselector,
tolerations,
version,
dbURL,
dbPort,
features,
"",
)(
@@ -371,4 +391,4 @@ func TestBucket_AdaptClean(t *testing.T) {
assert.NotNil(t, ensure)
assert.NoError(t, err)
assert.NoError(t, ensure(client))
}
}*/