mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
remove mapper dependency - PrintSuccess
This commit is contained in:
@@ -440,7 +440,7 @@ func (o *EnvOptions) RunEnv(f cmdutil.Factory) error {
|
||||
continue
|
||||
}
|
||||
|
||||
f.PrintSuccess(o.Mapper, o.ShortOutput, o.Out, info.Mapping.Resource, info.Name, false, "env updated")
|
||||
f.PrintSuccess(o.ShortOutput, o.Out, info.Mapping.Resource, info.Name, false, "env updated")
|
||||
}
|
||||
return utilerrors.NewAggregate(allErrs)
|
||||
}
|
||||
|
||||
@@ -54,7 +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)
|
||||
PrintSuccess func(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
|
||||
@@ -278,7 +278,7 @@ func (o *ImageOptions) Run() error {
|
||||
}
|
||||
continue
|
||||
}
|
||||
o.PrintSuccess(o.Mapper, o.ShortOutput, o.Out, info.Mapping.Resource, info.Name, o.DryRun, "image updated")
|
||||
o.PrintSuccess(o.ShortOutput, o.Out, info.Mapping.Resource, info.Name, o.DryRun, "image updated")
|
||||
}
|
||||
return utilerrors.NewAggregate(allErrs)
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ type ResourcesOptions struct {
|
||||
Requests string
|
||||
ResourceRequirements v1.ResourceRequirements
|
||||
|
||||
PrintSuccess func(mapper meta.RESTMapper, shortOutput bool, out io.Writer, resource, name string, dryRun bool, operation string)
|
||||
PrintSuccess func(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
|
||||
@@ -269,7 +269,7 @@ func (o *ResourcesOptions) Run() error {
|
||||
}
|
||||
continue
|
||||
}
|
||||
o.PrintSuccess(o.Mapper, shortOutput, o.Out, info.Mapping.Resource, info.Name, false, "resource requirements updated")
|
||||
o.PrintSuccess(shortOutput, o.Out, info.Mapping.Resource, info.Name, false, "resource requirements updated")
|
||||
}
|
||||
return utilerrors.NewAggregate(allErrs)
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ type SelectorOptions struct {
|
||||
selector *metav1.LabelSelector
|
||||
|
||||
out io.Writer
|
||||
PrintSuccess func(mapper meta.RESTMapper, shortOutput bool, out io.Writer, resource, name string, dryRun bool, operation string)
|
||||
PrintSuccess func(shortOutput bool, out io.Writer, resource, name string, dryRun bool, operation string)
|
||||
PrintObject func(obj runtime.Object) error
|
||||
ClientForMapping func(mapping *meta.RESTMapping) (resource.RESTClient, error)
|
||||
|
||||
@@ -218,7 +218,7 @@ func (o *SelectorOptions) RunSelector() error {
|
||||
if len(o.output) > 0 && !shortOutput {
|
||||
return o.PrintObject(patched)
|
||||
}
|
||||
o.PrintSuccess(o.mapper, shortOutput, o.out, info.Mapping.Resource, info.Name, o.dryrun, "selector updated")
|
||||
o.PrintSuccess(shortOutput, o.out, info.Mapping.Resource, info.Name, o.dryrun, "selector updated")
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ type serviceAccountConfig struct {
|
||||
local bool
|
||||
PrintObject func(cmd *cobra.Command, isLocal bool, mapper meta.RESTMapper, obj runtime.Object, out io.Writer) error
|
||||
updatePodSpecForObject func(runtime.Object, func(*v1.PodSpec) error) (bool, error)
|
||||
printSuccess func(mapper meta.RESTMapper, shortOutput bool, out io.Writer, resource, name string, dryRun bool, operation string)
|
||||
printSuccess func(shortOutput bool, out io.Writer, resource, name string, dryRun bool, operation string)
|
||||
infos []*resource.Info
|
||||
serviceAccountName string
|
||||
}
|
||||
@@ -192,7 +192,7 @@ func (saConfig *serviceAccountConfig) Run() error {
|
||||
}
|
||||
continue
|
||||
}
|
||||
saConfig.printSuccess(saConfig.mapper, saConfig.shortOutput, saConfig.out, info.Mapping.Resource, info.Name, saConfig.dryRun, "serviceaccount updated")
|
||||
saConfig.printSuccess(saConfig.shortOutput, saConfig.out, info.Mapping.Resource, info.Name, saConfig.dryRun, "serviceaccount updated")
|
||||
}
|
||||
return utilerrors.NewAggregate(patchErrs)
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ func (o *SubjectOptions) Run(f cmdutil.Factory, fn updateSubjects) error {
|
||||
if len(o.Output) > 0 && !shortOutput {
|
||||
return o.PrintObject(o.Mapper, info.AsVersioned(), o.Out)
|
||||
}
|
||||
f.PrintSuccess(o.Mapper, shortOutput, o.Out, info.Mapping.Resource, info.Name, false, "subjects updated")
|
||||
f.PrintSuccess(shortOutput, o.Out, info.Mapping.Resource, info.Name, false, "subjects updated")
|
||||
}
|
||||
return utilerrors.NewAggregate(allErrs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user