mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
move cmd/util/printing.go#PrintSuccess to factory_builder.go
This commit is contained in:
@@ -54,6 +54,7 @@ type ImageOptions struct {
|
||||
Cmd *cobra.Command
|
||||
ResolveImage func(in string) (string, error)
|
||||
|
||||
PrintSuccess func(mapper meta.RESTMapper, shortOutput bool, out io.Writer, resource, name string, dryRun bool, operation string)
|
||||
PrintObject func(cmd *cobra.Command, isLocal bool, mapper meta.RESTMapper, obj runtime.Object, out io.Writer) error
|
||||
UpdatePodSpecForObject func(obj runtime.Object, fn func(*v1.PodSpec) error) (bool, error)
|
||||
Resources []string
|
||||
@@ -116,6 +117,7 @@ func NewCmdImage(f cmdutil.Factory, out, err io.Writer) *cobra.Command {
|
||||
|
||||
func (o *ImageOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error {
|
||||
o.Mapper, _ = f.Object()
|
||||
o.PrintSuccess = f.PrintSuccess
|
||||
o.UpdatePodSpecForObject = f.UpdatePodSpecForObject
|
||||
o.Encoder = f.JSONEncoder()
|
||||
o.Decoder = f.Decoder(true)
|
||||
@@ -279,7 +281,7 @@ func (o *ImageOptions) Run() error {
|
||||
}
|
||||
continue
|
||||
}
|
||||
cmdutil.PrintSuccess(o.Mapper, o.ShortOutput, o.Out, info.Mapping.Resource, info.Name, o.DryRun, "image updated")
|
||||
o.PrintSuccess(o.Mapper, o.ShortOutput, o.Out, info.Mapping.Resource, info.Name, o.DryRun, "image updated")
|
||||
}
|
||||
return utilerrors.NewAggregate(allErrs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user