-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #831 from k8up-io/cli-snapshot-restore
Cli snapshot restore
- Loading branch information
Showing
14 changed files
with
603 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package restore | ||
|
||
import ( | ||
"math/rand" | ||
"time" | ||
) | ||
|
||
func RandomStringGenerator(n int) string { | ||
var characters = []rune("abcdefghijklmnopqrstuvwxyz1234567890") | ||
rand.Seed(time.Now().UnixNano()) | ||
b := make([]rune, n) | ||
for i := range b { | ||
b[i] = characters[rand.Intn(len(characters))] | ||
} | ||
return string(b) | ||
} |
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 @@ | ||
package restore | ||
|
||
var ( | ||
Cfg = &RestoreConfig{} | ||
) | ||
|
||
type RestoreConfig struct { | ||
// spec.restoreMethod.folder.claimName | ||
ClaimName string | ||
Kubeconfig string | ||
Namespace string | ||
// metadata.name | ||
RestoreName string | ||
// spec.podSecurityContext.runAsUser | ||
RunAsUser int64 | ||
// one of restore methods s3 || pvc | ||
RestoreMethod string | ||
// spec.snapshot | ||
Snapshot string | ||
// spec.backend.repoPasswordSecretRef.name | ||
SecretRef string | ||
// spec.backend.repoPasswordSecretRef.key | ||
SecretRefKey string | ||
|
||
// spec.backend.s3.endpoint | ||
S3Endpoint string | ||
// spec.backend.s3.bucket | ||
S3Bucket string | ||
// spec.backend.s3.accessKeyIDSecretRef.name && spec.backend.s3.secretAccessKeySecretRef.name | ||
S3SecretRef string | ||
// spec.backend.s3.accessKeyIDSecretRef.key | ||
S3SecretRefUsernameKey string | ||
// spec.backend.s3.secretAccessKeySecretRef.key | ||
S3SecretRefPasswordKey string | ||
|
||
// spec.restoreMethod.s3.endpoint | ||
RestoreToS3Endpoint string | ||
// spec.restoreMethod.s3.bucket | ||
RestoreToS3Bucket string | ||
// spec.restoreMethod.s3.accessKeyIDSecretRef.name && spec.restoreMethod.s3.secretAccessKeySecretRef.name | ||
RestoreToS3Secret string | ||
// spec.restoreMethod.s3.accessKeyIDSecretRef.name | ||
RestoreToS3SecretUsernameKey string | ||
// spec.restoreMethod.s3.secretAccessKeySecretRef.name | ||
RestoreToS3SecretPasswordKey string | ||
} |
Oops, something went wrong.