remove LabelsForObject and ResolveImage from factory
This commit is contained in:
@@ -49,7 +49,7 @@ type SetImageOptions struct {
|
||||
All bool
|
||||
Output string
|
||||
Local bool
|
||||
ResolveImage func(in string) (string, error)
|
||||
ResolveImage ImageResolver
|
||||
|
||||
PrintObj printers.ResourcePrinterFunc
|
||||
Recorder genericclioptions.Recorder
|
||||
@@ -137,7 +137,7 @@ func (o *SetImageOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args [
|
||||
o.UpdatePodSpecForObject = f.UpdatePodSpecForObject
|
||||
o.DryRun = cmdutil.GetDryRunFlag(cmd)
|
||||
o.Output = cmdutil.GetFlagString(cmd, "output")
|
||||
o.ResolveImage = f.ResolveImage
|
||||
o.ResolveImage = resolveImageFunc
|
||||
|
||||
if o.DryRun {
|
||||
o.PrintFlags.Complete("%s (dry run)")
|
||||
@@ -309,3 +309,13 @@ func hasWildcardKey(containerImages map[string]string) bool {
|
||||
_, ok := containerImages["*"]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ImageResolver is a func that receives an image name, and
|
||||
// resolves it to an appropriate / compatible image name.
|
||||
// Adds flexibility for future image resolving methods.
|
||||
type ImageResolver func(in string) (string, error)
|
||||
|
||||
// implements ImageResolver
|
||||
func resolveImageFunc(in string) (string, error) {
|
||||
return in, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user