Fix ordered resources cmd Stdout already set error

Signed-off-by: Ming <mqiu@vmware.com>
pull/4975/head
Ming 2022-06-09 03:52:34 +00:00
parent de9ee22e26
commit c2ddc6ead4
1 changed files with 1 additions and 1 deletions

View File

@ -234,8 +234,8 @@ func checkRestorePhase(ctx context.Context, veleroCLI string, veleroNamespace st
}
func checkSchedulePhase(ctx context.Context, veleroCLI, veleroNamespace, scheduleName string) error {
checkCMD := exec.CommandContext(ctx, veleroCLI, "--namespace", veleroNamespace, "schedule", "get", scheduleName, "-ojson")
return wait.PollImmediate(time.Second*5, time.Minute*2, func() (bool, error) {
checkCMD := exec.CommandContext(ctx, veleroCLI, "--namespace", veleroNamespace, "schedule", "get", scheduleName, "-ojson")
jsonBuf, err := CMDExecWithOutput(checkCMD)
if err != nil {
return false, err