osd: fix update OSDs logic for cancelled context
`updateExistingOSDs` should not wait and retry if the golang context got
cancelled. Else it would keep on retrying for 20 minutes before
exciting.
Signed-off-by: Santosh <sapillai@redhat.com>
(cherry picked from commit 33046734b3)
This commit is contained in:
1 parent
d533d908d1
commit
154615a121
1 file changed
+4
@@ -237,6 +237,10 @@ func WaitForDeploymentsToUpdate(
|
||||
waitFunc := func() (done bool, err error) {
|
||||
deployments, err := listFunc()
|
||||
if err != nil {
|
||||
// if the context got cancelled, then no need to wait or retry.
|
||||
if errors.Is(err, context.Canceled) {
|
||||
return true, errors.Wrap(err, "failed to list deployments due to context cancellation")
|
||||
}
|
||||
return false, errors.Wrap(err, "failed to list deployments")
|
||||
}
|
||||
if len(deployments.Items) < len(waitingOn) {
|
||||
|
||||
Reference in new issue
Block a user