Skip to content

Commit 8470d19

Browse files
authored
Fix detection of hostname resolution failure (#1318)
Signed-off-by: Matej Vašek <[email protected]>
1 parent 9a23973 commit 8470d19

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/docker/pusher.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,10 @@ func (n *Pusher) pushImage(ctx context.Context, f fn.Function, credentials Crede
201201
if err == nil {
202202
return digest, nil
203203
}
204-
if strings.Contains(err.Error(), "no such host") {
204+
errStr := err.Error()
205+
if strings.Contains(errStr, "no such host") ||
206+
strings.Contains(errStr, "failure in name resolution") ||
207+
regexp.MustCompile(`lookup .*: server misbehaving`).MatchString(errStr) {
205208
// push with custom transport to be able to push into cluster private registries
206209
return n.push(ctx, f, credentials, output)
207210
}

0 commit comments

Comments
 (0)