Skip to content

Commit 805cb5d

Browse files
authored
Fix detection of hostname resolution failure (knative#2841)
It appears that newer version of docker outputs different error when registry hostname is not resolvable. Signed-off-by: Matej Vašek <[email protected]>
1 parent 4c4fd28 commit 805cb5d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/docker/pusher.go

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

0 commit comments

Comments
 (0)