mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Make rolling-update actually parse filenames from stdin
This commit is contained in:
parent
c743011e19
commit
e1936d57f8
@ -161,6 +161,14 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
var ok bool
|
var ok bool
|
||||||
|
// Handle filename input from stdin. The resource builder always returns an api.List
|
||||||
|
// when creating resource(s) from a stream.
|
||||||
|
if list, ok := obj.(*api.List); ok {
|
||||||
|
if len(list.Items) > 1 {
|
||||||
|
return cmdutil.UsageError(cmd, "%s specifies multiple items", filename)
|
||||||
|
}
|
||||||
|
obj = list.Items[0]
|
||||||
|
}
|
||||||
newRc, ok = obj.(*api.ReplicationController)
|
newRc, ok = obj.(*api.ReplicationController)
|
||||||
if !ok {
|
if !ok {
|
||||||
if _, kind, err := typer.ObjectVersionAndKind(obj); err == nil {
|
if _, kind, err := typer.ObjectVersionAndKind(obj); err == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user