Skip to content

Commit

Permalink
[QE] fix not catch error for oc login,#4101
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyLuLiu committed Jul 1, 2024
1 parent 926c78e commit ba0bb52
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/extended/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,14 @@ func LoginToOcCluster(options []string) error {
ocLoginAsAdminCommand = ocLoginAsAdminCommand + " " + option
}

return ExecuteCommand(ocLoginAsAdminCommand)
err = ExecuteCommand(ocLoginAsAdminCommand)

exitcode := GetLastCommandOutput("exitcode")
if exitcode != "0" {
stderr := GetLastCommandOutput("stderr")
return fmt.Errorf(stderr)
}
return err
}

// LoginToOcClusterSucceedsOrFails is a wrapper for LoginToOcCluster
Expand Down

0 comments on commit ba0bb52

Please sign in to comment.