Merge pull request #46608 from fabianofranz/fixes_kubectl_cache_on_windows

Automatic merge from submit-queue (batch tested with PRs 46552, 46608, 46390, 46605, 46459)

Fixes kubectl cached discovery on Windows

Fixes https://github.com/kubernetes/kubectl/issues/18

The `kubectl` cached discovery makes use of `func (f *File) Chmod(mode FileMode) error` which is not supported and errors out on Windows, making `kubectl get` and potentially a number of other commands to fail miserably on that platform. `os.Chmod` by file name, on the other hand, does not error out and should be used instead.

**Release note**:

```release-note
NONE
```
@deads2k @brendandburns @kubernetes/sig-cli-pr-reviews
pull/6/head
Kubernetes Submit Queue 2017-05-30 08:41:54 -07:00 committed by GitHub
commit a07298ce54
1 changed files with 1 additions and 1 deletions

View File

@ -196,7 +196,7 @@ func (d *CachedDiscoveryClient) writeCachedFile(filename string, obj runtime.Obj
return err
}
err = f.Chmod(0755)
err = os.Chmod(f.Name(), 0755)
if err != nil {
return err
}