mirror of
https://github.com/rancher/rke.git
synced 2025-07-16 00:15:51 +00:00
handle new not found err in docker
This commit is contained in:
parent
dd4d19a945
commit
dd4faabd6c
@ -176,8 +176,8 @@ func FetchCertificatesFromHost(ctx context.Context, extraHosts []*hosts.Host, ho
|
||||
if err != nil && (!strings.HasPrefix(certName, "kube-etcd") &&
|
||||
!strings.Contains(certName, APIProxyClientCertName) &&
|
||||
!strings.Contains(certName, RequestHeaderCACertName)) {
|
||||
if strings.Contains(err.Error(), "no such file or directory") ||
|
||||
strings.Contains(err.Error(), "Could not find the file") {
|
||||
// IsErrNotFound doesn't catch this because it's a custom error
|
||||
if isFileNotFoundErr(err) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, err
|
||||
@ -280,3 +280,12 @@ func populateCertMap(tmpCerts map[string]CertificatePKI, localConfigPath string,
|
||||
|
||||
return certs
|
||||
}
|
||||
|
||||
func isFileNotFoundErr(e error) bool {
|
||||
if strings.Contains(e.Error(), "no such file or directory") ||
|
||||
strings.Contains(e.Error(), "Could not find the file") ||
|
||||
strings.Contains(e.Error(), "No such container:path:") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user