mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #27057 from janetkuo/kubectl-run-server-discovery
Automatic merge from submit-queue Don't ignore error when Discovery().ServerResources() in kubectl run Ref #27014 This doesn't fix the flake directly, but expose the error happened when the flake happens. @kubernetes/kubectl @caesarxuchao []()
This commit is contained in:
commit
5a5c490a43
@ -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