add ResolveImage function to CLI factory

This commit is contained in:
Michal Fojtik
2016-09-20 14:19:01 +02:00
parent 98c4c73c71
commit 737b32772e
3 changed files with 46 additions and 17 deletions

View File

@@ -135,6 +135,10 @@ type Factory interface {
Pauser(info *resource.Info) (bool, error)
// Resumer resumes a paused object inside the info ie. it will be reconciled by its controller.
Resumer(info *resource.Info) (bool, error)
// ResolveImage resolves the image names. For kubernetes this function is just
// passthrough but it allows to perform more sophisticated image name resolving for
// third-party vendors.
ResolveImage(imageName string) (string, error)
// Returns a schema that can validate objects stored on disk.
Validator(validate bool, cacheDir string) (validation.Schema, error)
// SwaggerSchema returns the schema declaration for the provided group version kind.
@@ -654,6 +658,10 @@ func (f *factory) Pauser(info *resource.Info) (bool, error) {
}
}
func (f *factory) ResolveImage(name string) (string, error) {
return name, nil
}
func (f *factory) Resumer(info *resource.Info) (bool, error) {
switch obj := info.Object.(type) {
case *extensions.Deployment: