Commit 54f5a9b4 authored by Dr. Stefan Schimanski's avatar Dr. Stefan Schimanski

Disable swagger spec caching without /version

parent ac8aae58
......@@ -747,10 +747,11 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
dir := cacheDir
if len(dir) > 0 {
version, err := clientset.Discovery().ServerVersion()
if err != nil {
return nil, err
if err == nil {
dir = path.Join(cacheDir, version.String())
} else {
dir = "" // disable caching as a fallback
}
dir = path.Join(cacheDir, version.String())
}
fedClient, err := clients.FederationClientForVersion(nil)
if err != nil {
......
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