Skip to content

Commit

Permalink
fix: modify msg format (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
d976045024 committed May 7, 2024
1 parent 6172d1a commit b3c6e13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/cmd/cluster/dataprotection.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,17 @@ func (o *CreateBackupOptions) Validate() error {
}

// check if the backup method exists in backup policy
exist, methods := false, make([]string, 0)
exist, availableMethods := false, make([]string, 0)
for _, method := range backupPolicy.Spec.BackupMethods {
methods = append(methods, method.Name)
availableMethods = append(availableMethods, method.Name)
if o.BackupSpec.BackupMethod == method.Name {
exist = true
break
}
}
if !exist {
return fmt.Errorf("specified backup method %s does not exist in backup policy %s, available methods: [%s]\n",
o.BackupSpec.BackupMethod, backupPolicy.Name, strings.Join(methods, ", "))
o.BackupSpec.BackupMethod, backupPolicy.Name, strings.Join(availableMethods, ", "))
}

// TODO: check if pvc exists
Expand Down

0 comments on commit b3c6e13

Please sign in to comment.