From 805cb5dcc571e8bde74b421e99f2d61566ad73ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Va=C5=A1ek?= Date: Mon, 26 May 2025 21:15:17 +0200 Subject: [PATCH] Fix detection of hostname resolution failure (#2841) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It appears that newer version of docker outputs different error when registry hostname is not resolvable. Signed-off-by: Matej VaĊĦek --- pkg/docker/pusher.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/docker/pusher.go b/pkg/docker/pusher.go index ead6c176d..f6f6499c6 100644 --- a/pkg/docker/pusher.go +++ b/pkg/docker/pusher.go @@ -202,7 +202,9 @@ func (n *Pusher) pushImage(ctx context.Context, f fn.Function, credentials Crede return digest, nil } errStr := err.Error() - if strings.Contains(errStr, "no such host") || strings.Contains(errStr, "failure in name resolution") { + if strings.Contains(errStr, "no such host") || + strings.Contains(errStr, "failure in name resolution") || + regexp.MustCompile(`lookup .*: server misbehaving`).MatchString(errStr) { // push with custom transport to be able to push into cluster private registries return n.push(ctx, f, credentials, output) }