Skip to content

Commit

Permalink
vrg: ensure hook is specified in the correct format
Browse files Browse the repository at this point in the history
Co-Authored-by: Annaraya Narasagond <[email protected]>
Signed-off-by: Raghavendra Talur <[email protected]>
(cherry picked from commit 73d5ee8)
  • Loading branch information
raghavendra-talur committed Dec 16, 2024
1 parent cbfbeb4 commit 8038f33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/controller/vrg_kubeobjects.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,8 @@ func getResourceAndConvertToRecoverGroup(
}

func validateAndGetHookDetails(name string) (string, string, error) {
if !strings.Contains(name, "/") {
return "", "", errors.New("invalid format of hook name provided ")
if strings.Count(name, "/") != 1 {
return "", "", errors.New("invalid format: hook name provided should be of the form part1/part2")
}

parts := strings.Split(name, "/")
Expand Down

0 comments on commit 8038f33

Please sign in to comment.