Commit 60c5985d authored by k8s-merge-robot's avatar k8s-merge-robot Committed by GitHub

Merge pull request #28500 from deads2k/migration

Automatic merge from submit-queue don't migrate files you can't access If you can't access a file, you shouldn't try to migrate it. Ref https://github.com/openshift/origin/issues/9581 @fabianofranz
parents b7ca6634 1b74a120
......@@ -230,14 +230,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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment