-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64bc44f
commit 664802b
Showing
10 changed files
with
139 additions
and
15 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
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,18 @@ | ||
apiVersion: dataprotection.kubeblocks.io/v1alpha1 | ||
kind: BackupRepo | ||
metadata: | ||
name: my-repo | ||
annotations: | ||
dataprotection.kubeblocks.io/is-default-repo: "true" | ||
spec: | ||
storageProviderRef: s3 | ||
pvReclaimPolicy: Retain | ||
volumeCapacity: 100Gi | ||
config: | ||
bucket: test-kb-backup | ||
mountOptions: "" | ||
endpoint: "" | ||
region: cn-zhangjiakou | ||
credential: | ||
name: oss-credential-for-backuprepo | ||
namespace: kb-system |
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,18 @@ | ||
apiVersion: dataprotection.kubeblocks.io/v1alpha1 | ||
kind: BackupRepo | ||
metadata: | ||
name: my-repo | ||
annotations: | ||
dataprotection.kubeblocks.io/is-default-repo: "true" | ||
spec: | ||
storageProviderRef: s3 | ||
pvReclaimPolicy: Retain | ||
volumeCapacity: 100Gi | ||
config: | ||
bucket: smoke-test-hl | ||
endpoint: "" | ||
mountOptions: --memory-limit 1000 --dir-mode 0777 --file-mode 0666 | ||
region: us-west-2 | ||
credential: | ||
name: s3-credential-for-backuprepo | ||
namespace: kb-system |
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,67 @@ | ||
package smoketest | ||
|
||
import ( | ||
"log" | ||
"os" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
|
||
. "github.com/apecloud/kubeblocks/test/e2e" | ||
e2eutil "github.com/apecloud/kubeblocks/test/e2e/util" | ||
) | ||
|
||
func Config() { | ||
BeforeEach(func() { | ||
}) | ||
|
||
AfterEach(func() { | ||
}) | ||
|
||
dir, err := os.Getwd() | ||
if err != nil { | ||
log.Println(err) | ||
} | ||
|
||
Context("Configure running e2e information", func() { | ||
It("create a secret to save the access key and ", func() { | ||
accessKey := e2eutil.ExecCommand("aws configure get aws_access_key_id") | ||
secretKey := e2eutil.ExecCommand("aws configure get aws_secret_access_key") | ||
createSecret := "kubectl create secret generic " + ConfigType + "-credential-for-backuprepo \\\n" + | ||
" -n kb-system \\\n" + | ||
" --from-literal=accessKeyId=" + e2eutil.StringStrip(accessKey) + " \\\n" + | ||
" --from-literal=secretAccessKey=" + e2eutil.StringStrip(secretKey) | ||
b := e2eutil.ExecuteCommand(createSecret) | ||
Expect(b).Should(BeTrue()) | ||
}) | ||
|
||
It(" configure backup-repo", func() { | ||
var yaml string | ||
if ConfigType == "oss" { | ||
yaml = dir + "/testdata/config/backuprepo_oss.yaml" | ||
} else { | ||
yaml = dir + "/testdata/config/backuprepo_s3.yaml" | ||
} | ||
b := e2eutil.OpsYaml(yaml, "create") | ||
Expect(b).Should(BeTrue()) | ||
}) | ||
}) | ||
} | ||
|
||
func DeleteConfig() { | ||
BeforeEach(func() { | ||
}) | ||
|
||
AfterEach(func() { | ||
}) | ||
|
||
Context("delete e2e config resources", func() { | ||
It("delete secret and backuprepo", func() { | ||
deleteSecret := e2eutil.ExecuteCommand("kubectl delete secret " + ConfigType + "-credential-for-backuprepo -n kb-system") | ||
Expect(deleteSecret).Should(BeTrue()) | ||
deleteBr := e2eutil.ExecuteCommand("kubectl delete backuprepo my-repo") | ||
Expect(deleteBr).Should(BeTrue()) | ||
}) | ||
|
||
}) | ||
} |
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,13 @@ | ||
apiVersion: dataprotection.kubeblocks.io/v1alpha1 | ||
kind: Backup | ||
metadata: | ||
name: backup-mysql-cluster | ||
spec: | ||
backupPolicyName: mysql-cluster-mysql-backup-policy | ||
retentionPeriod: 7d | ||
backupMethod: xtrabackup | ||
deletionPolicy: Retain | ||
status: | ||
duration: 60s | ||
backupRepoName: my-repo | ||
phase: Completed |
This file was deleted.
Oops, something went wrong.
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