mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Assign options.Err in "set image"
There is a usage of options.Err in a Printf, but this option is never set. This patch passes the stderr into the command and assigns the option correctly.
This commit is contained in:
parent
01189549f3
commit
ea1063a263
@ -249,7 +249,7 @@ Find more information at https://github.com/kubernetes/kubernetes.`,
|
|||||||
NewCmdCreate(f, out),
|
NewCmdCreate(f, out),
|
||||||
NewCmdExposeService(f, out),
|
NewCmdExposeService(f, out),
|
||||||
NewCmdRun(f, in, out, err),
|
NewCmdRun(f, in, out, err),
|
||||||
set.NewCmdSet(f, out),
|
set.NewCmdSet(f, out, err),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@ var (
|
|||||||
set_example = dedent.Dedent(``)
|
set_example = dedent.Dedent(``)
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewCmdSet(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
func NewCmdSet(f cmdutil.Factory, out, err io.Writer) *cobra.Command {
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "set SUBCOMMAND",
|
Use: "set SUBCOMMAND",
|
||||||
@ -45,7 +45,7 @@ func NewCmdSet(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add subcommands
|
// add subcommands
|
||||||
cmd.AddCommand(NewCmdImage(f, out))
|
cmd.AddCommand(NewCmdImage(f, out, err))
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
@ -78,9 +78,10 @@ var (
|
|||||||
kubectl set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml`)
|
kubectl set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml`)
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewCmdImage(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
func NewCmdImage(f cmdutil.Factory, out, err io.Writer) *cobra.Command {
|
||||||
options := &ImageOptions{
|
options := &ImageOptions{
|
||||||
Out: out,
|
Out: out,
|
||||||
|
Err: err,
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
|
Loading…
Reference in New Issue
Block a user