Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add binlog deploy and check process #329

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change name to backupPVC
shuijing198799 committed Mar 19, 2019
commit 79dfe9a2594d31352bd4eac0880ba0df824f7bf9
14 changes: 7 additions & 7 deletions tests/actions.go
Original file line number Diff line number Diff line change
@@ -117,7 +117,7 @@ type OperatorInfo struct {
}

type TidbClusterInfo struct {
Name string
BackupPVC string
Namespace string
ClusterName string
OperatorTag string
@@ -859,7 +859,7 @@ func (oa *operatorActions) DeployAdHocBackup(info *TidbClusterInfo) error {
}()
sets := map[string]string{
"clusterName": info.ClusterName,
"name": info.Name,
"name": info.BackupPVC,
"mode": "backup",
"user": "root",
"password": info.Password,
@@ -893,7 +893,7 @@ func (oa *operatorActions) CheckAdHocBackup(info *TidbClusterInfo) error {
glog.Infof("deploy clean backup end cluster[%s] namespace[%s]", info.ClusterName, info.Namespace)
}()

jobName := fmt.Sprintf("%s-%s", info.ClusterName, info.Name)
jobName := fmt.Sprintf("%s-%s", info.ClusterName, info.BackupPVC)
fn := func() (bool, error) {
job, err := oa.kubeCli.BatchV1().Jobs(info.Namespace).Get(jobName, metav1.GetOptions{})
if err != nil {
@@ -923,7 +923,7 @@ func (oa *operatorActions) Restore(from *TidbClusterInfo, to *TidbClusterInfo) e
}()
sets := map[string]string{
"clusterName": to.ClusterName,
"name": to.Name,
"name": to.BackupPVC,
"mode": "restore",
"user": "root",
"password": to.Password,
@@ -957,7 +957,7 @@ func (oa *operatorActions) CheckRestore(from *TidbClusterInfo, to *TidbClusterIn
glog.Infof("check restore end cluster[%s] namespace[%s]", to.ClusterName, to.Namespace)
}()

jobName := fmt.Sprintf("%s-restore-%s", to.ClusterName, from.Name)
jobName := fmt.Sprintf("%s-restore-%s", to.ClusterName, from.BackupPVC)
fn := func() (bool, error) {
job, err := oa.kubeCli.BatchV1().Jobs(to.Namespace).Get(jobName, metav1.GetOptions{})
if err != nil {
@@ -1215,7 +1215,7 @@ func (oa *operatorActions) getBackupDir(info *TidbClusterInfo) (int, error) {
Name: "data",
VolumeSource: corev1.VolumeSource{
PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
ClaimName: info.Name,
ClaimName: info.BackupPVC,
},
},
},
@@ -1266,7 +1266,7 @@ func (oa *operatorActions) getBackupDir(info *TidbClusterInfo) (int, error) {
}

dirs := strings.Split(string(res), "\n")
glog.Infof("dirs in pod info name [%s] dir name [%s]", info.Name, strings.Join(dirs, ","))
glog.Infof("dirs in pod info name [%s] dir name [%s]", info.BackupPVC, strings.Join(dirs, ","))
return len(dirs), nil
}

2 changes: 1 addition & 1 deletion tests/backup/backupcase.go
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ func (bc *BackupCase) Run() error {
return err
}

bc.srcCluster.Name = "demo-scheduled-backup"
bc.srcCluster.BackupPVC = "demo-scheduled-backup"

err = bc.operator.DeployScheduledBackup(bc.srcCluster)
if err != nil {
4 changes: 2 additions & 2 deletions tests/cmd/e2e/main.go
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ func main() {
initSql := `"create database record;use record;create table test(t char(32))"`

clusterInfo := &tests.TidbClusterInfo{
Name: "test-backup",
BackupPVC: "test-backup",
Namespace: "tidb",
ClusterName: "demo",
OperatorTag: "master",
@@ -93,7 +93,7 @@ func main() {
}

restoreClusterInfo := &tests.TidbClusterInfo{
Name: "test-backup",
BackupPVC: "test-backup",
Namespace: "tidb",
ClusterName: "demo2",
OperatorTag: "master",