mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +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
|
||||
}
|
||||
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