Skip to content

Commit e005223

Browse files
Merge pull request #1949 from rwsu/OCPBUGS-38975
OCPBUGS-38975: monitor should not exit for temp api disconnect
2 parents e3b2070 + 8a9474c commit e005223

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/cli/admin/nodeimage/monitor.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ package nodeimage
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"net"
8+
"net/url"
79
"strings"
810
"time"
911

@@ -220,6 +222,11 @@ func (o *MonitorOptions) isMonitoringDone(ctx context.Context) (bool, error) {
220222
if retry.IsHTTPClientError(err) {
221223
return false, nil
222224
}
225+
// api server may become temporarily unavailable, return false to retry
226+
var urlErr *url.Error
227+
if errors.As(err, &urlErr) {
228+
return false, nil
229+
}
223230
klog.V(2).Infof("pod should exist but is not found: %v", err)
224231
return false, err
225232
}

0 commit comments

Comments
 (0)