Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions helper/resource/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,9 @@ func (conf *StateChangeConf) WaitForStateContext(ctx context.Context) (interface
return nil, ctx.Err()
case <-timeout:
log.Printf("[WARN] WaitForState timeout after %s", conf.Timeout)
log.Printf("[WARN] WaitForState starting %s refresh grace period", refreshGracePeriod)

// cancel the goroutine and start our grace period timer
// cancel the goroutine
close(cancelCh)
timeout := time.After(refreshGracePeriod)

// we need a for loop and a label to break on, because we may have
// an extra response value to read, but still want to wait for the
// channel to close.
Expand All @@ -254,9 +251,6 @@ func (conf *StateChangeConf) WaitForStateContext(ctx context.Context) (interface
case <-ctx.Done():
log.Println("[ERROR] Context cancelation detected, abandoning grace period")
break forSelect
case <-timeout:
log.Println("[ERROR] WaitForState exceeded refresh grace period")
break forSelect
}
}

Expand Down