mirror of https://github.com/knative/func.git
Fix detection of hostname resolution failure (#2841)
It appears that newer version of docker outputs different error when registry hostname is not resolvable. Signed-off-by: Matej Vašek <mvasek@redhat.com>
This commit is contained in:
parent
4c4fd28c23
commit
805cb5dcc5
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue