Merge pull request #64113 from juanvallejo/jvallejo/remove-uneeded-factory-methods

Automatic merge from submit-queue (batch tested with PRs 63151, 63795, 63553, 64068, 64113). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove LabelsForObject and ResolveImage from factory

**Release note**:
```release-note
NONE
```

Removes the `ResolveImage` and `LabelsForObject` methods from factory_client_access, which are not needed.

cc @soltysh
This commit is contained in:
Kubernetes Submit Queue
2018-05-21 21:41:24 -07:00
committed by GitHub
5 changed files with 13 additions and 72 deletions

View File

@@ -50,7 +50,7 @@ type SetImageOptions struct {
All bool
Output string
Local bool
ResolveImage func(in string) (string, error)
ResolveImage ImageResolver
PrintObj printers.ResourcePrinterFunc
Recorder genericclioptions.Recorder
@@ -138,7 +138,7 @@ func (o *SetImageOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args [
o.UpdatePodSpecForObject = polymorphichelpers.UpdatePodSpecForObjectFn
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)")
@@ -310,3 +310,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
}