Skip to content

Commit

Permalink
Merge pull request kubernetes#8679 from jlowdermilk/rolling-update-stdin
Browse files Browse the repository at this point in the history
Make rolling-update actually parse filenames from stdin
  • Loading branch information
saad-ali committed May 27, 2015
2 parents 441b690 + e1936d5 commit ee82d46
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/kubectl/cmd/rollingupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg
return err
}
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)
if !ok {
if _, kind, err := typer.ObjectVersionAndKind(obj); err == nil {
Expand Down

0 comments on commit ee82d46

Please sign in to comment.