mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-22 12:58:46 +00:00
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:
co-authored by
Elio Bischof
parent
591a460450
commit
425a8b5fd5
@@ -0,0 +1,54 @@
|
||||
package s3
|
||||
|
||||
import (
|
||||
"github.com/caos/orbos/pkg/secret"
|
||||
)
|
||||
|
||||
func getSecretsMap(desiredKind *DesiredV0) (map[string]*secret.Secret, map[string]*secret.Existing) {
|
||||
|
||||
var (
|
||||
secrets = make(map[string]*secret.Secret, 0)
|
||||
existing = make(map[string]*secret.Existing, 0)
|
||||
)
|
||||
if desiredKind.Spec == nil {
|
||||
desiredKind.Spec = &Spec{}
|
||||
}
|
||||
|
||||
if desiredKind.Spec.AccessKeyID == nil {
|
||||
desiredKind.Spec.AccessKeyID = &secret.Secret{}
|
||||
}
|
||||
|
||||
if desiredKind.Spec.ExistingAccessKeyID == nil {
|
||||
desiredKind.Spec.ExistingAccessKeyID = &secret.Existing{}
|
||||
}
|
||||
|
||||
akikey := "accesskeyid"
|
||||
secrets[akikey] = desiredKind.Spec.AccessKeyID
|
||||
existing[akikey] = desiredKind.Spec.ExistingAccessKeyID
|
||||
|
||||
if desiredKind.Spec.SecretAccessKey == nil {
|
||||
desiredKind.Spec.SecretAccessKey = &secret.Secret{}
|
||||
}
|
||||
|
||||
if desiredKind.Spec.ExistingSecretAccessKey == nil {
|
||||
desiredKind.Spec.ExistingSecretAccessKey = &secret.Existing{}
|
||||
}
|
||||
|
||||
sakkey := "secretaccesskey"
|
||||
secrets[sakkey] = desiredKind.Spec.SecretAccessKey
|
||||
existing[sakkey] = desiredKind.Spec.ExistingSecretAccessKey
|
||||
|
||||
if desiredKind.Spec.SessionToken == nil {
|
||||
desiredKind.Spec.SessionToken = &secret.Secret{}
|
||||
}
|
||||
|
||||
if desiredKind.Spec.ExistingSessionToken == nil {
|
||||
desiredKind.Spec.ExistingSessionToken = &secret.Existing{}
|
||||
}
|
||||
|
||||
stkey := "sessiontoken"
|
||||
secrets[stkey] = desiredKind.Spec.SessionToken
|
||||
existing[stkey] = desiredKind.Spec.ExistingSessionToken
|
||||
|
||||
return secrets, existing
|
||||
}
|
||||
Reference in New Issue
Block a user