Don't ignore error when Discovery().ServerResources() in kubectl run

This commit is contained in:
Janet Kuo 2016-06-08 10:34:09 -07:00
parent d53ddbe6e6
commit 75c3cbcbfb

View File

@ -155,9 +155,9 @@ func Run(f *cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer, cmd *cob
return err
}
resourcesList, err := client.Discovery().ServerResources()
// ServerResources ignores errors for old servers do not expose discovery
if err != nil {
// this cover the cases where old servers do not expose discovery
resourcesList = nil
return fmt.Errorf("failed to discover supported resources: %v", err)
}
switch restartPolicy {
case api.RestartPolicyAlways: