mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +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
|
return err
|
||||||
}
|
}
|
||||||
resourcesList, err := client.Discovery().ServerResources()
|
resourcesList, err := client.Discovery().ServerResources()
|
||||||
|
// ServerResources ignores errors for old servers do not expose discovery
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// this cover the cases where old servers do not expose discovery
|
return fmt.Errorf("failed to discover supported resources: %v", err)
|
||||||
resourcesList = nil
|
|
||||||
}
|
}
|
||||||
switch restartPolicy {
|
switch restartPolicy {
|
||||||
case api.RestartPolicyAlways:
|
case api.RestartPolicyAlways:
|
||||||
|
Loading…
Reference in New Issue
Block a user