From 21edf8c85b0cbd4fc8d190cd76aa6f11a9aa05b2 Mon Sep 17 00:00:00 2001 From: deads2k Date: Tue, 5 Jul 2016 09:34:37 -0400 Subject: [PATCH] UPSTREAM: 28500: don't migrate files you can't access --- .../kubernetes/pkg/client/unversioned/clientcmd/loader.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/loader.go b/Godeps/_workspace/src/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/loader.go index 9707144701af..6afc03668468 100644 --- a/Godeps/_workspace/src/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/loader.go +++ b/Godeps/_workspace/src/k8s.io/kubernetes/pkg/client/unversioned/clientcmd/loader.go @@ -193,14 +193,17 @@ func (rules *ClientConfigLoadingRules) Migrate() error { if _, err := os.Stat(destination); err == nil { // if the destination already exists, do nothing continue + } else if os.IsPermission(err) { + // if we can't access the file, skip it + continue } else if !os.IsNotExist(err) { // if we had an error other than non-existence, fail return err } if sourceInfo, err := os.Stat(source); err != nil { - if os.IsNotExist(err) { - // if the source file doesn't exist, there's no work to do. + if os.IsNotExist(err) || os.IsPermission(err) { + // if the source file doesn't exist or we can't access it, there's no work to do. continue }