@@ -134,7 +134,8 @@ func CreateBackup(request *msgs.CreateBackrestBackupRequest, ns string) msgs.Cre
134134
135135 //remove any previous backup job
136136
137- selector := config .LABEL_PG_CLUSTER + "=" + clusterName + "," + config .LABEL_BACKREST + "=true"
137+ //selector := config.LABEL_PG_CLUSTER + "=" + clusterName + "," + config.LABEL_BACKREST + "=true"
138+ selector := config .LABEL_BACKREST_COMMAND + "=" + crv1 .PgtaskBackrestBackup + "," + config .LABEL_PG_CLUSTER + "=" + clusterName + "," + config .LABEL_BACKREST + "=true"
138139 err = kubeapi .DeleteJobs (apiserver .Clientset , selector , ns )
139140 if err != nil {
140141 log .Error (err )
@@ -366,17 +367,17 @@ func getInfo(clusterName, storageType, podname, ns string) (string, error) {
366367 cmd = append (cmd , backrestInfoCommand )
367368
368369 log .Debugf ("command is %v " , cmd )
369-
370+
370371 var output string
371- if storageType != "s3" {
372+ if storageType != "s3" {
372373 outputLocal , stderr , err := kubeapi .ExecToPodThroughAPI (apiserver .RESTConfig , apiserver .Clientset , cmd , containername , podname , ns , nil )
373374 if err != nil {
374375 log .Error (err , stderr )
375376 return "" , err
376377 }
377378 output = "\n Storage Type: local\n " + outputLocal
378379 }
379-
380+
380381 if strings .Contains (storageType , "s3" ) {
381382 cmd = append (cmd , repoTypeFlagS3 )
382383 outputS3 , stderr , err := kubeapi .ExecToPodThroughAPI (apiserver .RESTConfig , apiserver .Clientset , cmd , containername , podname , ns , nil )
@@ -385,7 +386,7 @@ func getInfo(clusterName, storageType, podname, ns string) (string, error) {
385386 return "" , err
386387 }
387388 output = output + "\n Storage Type: s3\n " + outputS3
388- }
389+ }
389390
390391 log .Debug ("output=[" + output + "]" )
391392
0 commit comments