Skip to content

Commit

Permalink
wip: fix test
Browse files Browse the repository at this point in the history
Signed-off-by: kouki <kouworld0123@gmail.com>
  • Loading branch information
kmdkuk committed Oct 19, 2023
1 parent cd0042d commit eedf619
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
9 changes: 9 additions & 0 deletions e2e/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ var _ = Context("backup", func() {

It("should construct a source cluster", func() {
kubectlSafe(fillTemplate(backupYAML), "apply", "-f", "-")
secjson := kubectlSafe(nil, "get", "secret", "-o", "json", "minio-cert")
sec := &corev1.Secret{}
json.Unmarshal(secjson, sec)
sec.SetNamespace("backup")
secjson, err := json.Marshal(sec)
Expect(err).NotTo(HaveOccurred())
kubectlSafe(secjson, "apply", "-f", "-")
// kubectl get secrets -o yaml minio-cert | yq '.data."ca.crt"' | base64 -d > ca.crt
// kubectl create secret at backup ns
Eventually(func() error {
cluster, err := getCluster("backup", "source")
if err != nil {
Expand Down
8 changes: 8 additions & 0 deletions e2e/testdata/backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,18 @@ spec:
value: minioadmin
- name: AWS_SECRET_ACCESS_KEY
value: minioadmin
volumeMounts:
- mountPath: /minio-cert
name: minio-cert
volumes:
- name: minio-cert
secret:
secretName: minio-cert
bucketConfig:
bucketName: moco
endpointURL: https://minio.default.svc:9000
usePathStyle: true
caCertFilePath: /minio-cert/ca.crt
workVolume:
emptyDir: {}
---
Expand Down
36 changes: 22 additions & 14 deletions e2e/testdata/restore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,34 @@ spec:
jobConfig:
serviceAccountName: backup-owner
env:
- name: AWS_ACCESS_KEY_ID
value: minioadmin
- name: AWS_SECRET_ACCESS_KEY
value: minioadmin
- name: AWS_ACCESS_KEY_ID
value: minioadmin
- name: AWS_SECRET_ACCESS_KEY
value: minioadmin
volumeMounts:
- mountPath: /minio-cert
name: minio-cert
volumes:
- name: minio-cert
secret:
secretName: minio-cert
bucketConfig:
bucketName: moco
endpointURL: http://minio.default.svc:9000
endpointURL: https://minio.default.svc:9000
usePathStyle: true
caCertFilePath: /minio-cert/ca.crt
workVolume:
emptyDir: {}
podTemplate:
spec:
containers:
- name: mysqld
image: ghcr.io/cybozu-go/moco/mysql:{{ .MySQLVersion }}
- name: mysqld
image: ghcr.io/cybozu-go/moco/mysql:{{ .MySQLVersion }}
volumeClaimTemplates:
- metadata:
name: mysql-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
- metadata:
name: mysql-data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi

0 comments on commit eedf619

Please sign in to comment.