Skip to content

Commit

Permalink
fix: check if the specified backup method exists when creating a back…
Browse files Browse the repository at this point in the history
…up (#326)
  • Loading branch information
d976045024 committed May 7, 2024
1 parent 1edfd31 commit 3d5602e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/cluster/dataprotection.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ func (o *CreateBackupOptions) Validate() error {
}

// check if the backup method exists in backup policy
supportMethods, exist := backupPolicy.Spec.BackupMethods, false
for _, method := range supportMethods {
exist := false
for _, method := range backupPolicy.Spec.BackupMethods {
if o.BackupSpec.BackupMethod == method.Name {
exist = true
break
Expand Down

0 comments on commit 3d5602e

Please sign in to comment.