mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
fix kubectl rolling update empty file cause panic issue
This commit is contained in:
parent
4d896cd3b2
commit
0949e08336
@ -220,6 +220,9 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg
|
||||
if len(list.Items) > 1 {
|
||||
return cmdutil.UsageError(cmd, "%s specifies multiple items", filename)
|
||||
}
|
||||
if len(list.Items) == 0 {
|
||||
return cmdutil.UsageError(cmd, "please make sure %s exists and is not empty", filename)
|
||||
}
|
||||
obj = list.Items[0]
|
||||
}
|
||||
newRc, ok = obj.(*api.ReplicationController)
|
||||
|
Loading…
Reference in New Issue
Block a user