mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Don't ignore error when Discovery().ServerResources() in kubectl run
This commit is contained in:
parent
d53ddbe6e6
commit
75c3cbcbfb
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user