Fix kubectl api-versions caching

This commit is contained in:
Jordan Liggitt 2017-06-24 00:53:10 -04:00
parent 886e04f1ff
commit fe8b5e9263
No known key found for this signature in database
GPG Key ID: 24E7ADF9A3B42012
2 changed files with 6 additions and 1 deletions

View File

@ -55,6 +55,9 @@ func RunApiVersions(f cmdutil.Factory, w io.Writer) error {
return err
}
// Always request fresh data from the server
discoveryclient.Invalidate()
groupList, err := discoveryclient.ServerGroups()
if err != nil {
return fmt.Errorf("Couldn't get available api versions from server: %v\n", err)

View File

@ -116,11 +116,13 @@ func RunVersion(f cmdutil.Factory, out io.Writer, cmd *cobra.Command) error {
func retrieveServerVersion(f cmdutil.Factory) (*apimachineryversion.Info, error) {
discoveryClient, err := f.DiscoveryClient()
if err != nil {
return nil, err
}
// Always request fresh data from the server
discoveryClient.Invalidate()
serverVersion, err := discoveryClient.ServerVersion()
if err != nil {
return nil, err