Simplify some of the plugin testing code.

This commit is contained in:
Jeffrey Regan
2019-05-17 14:51:00 -07:00
parent f9c631e9ee
commit 3a85fcd365
23 changed files with 110 additions and 362 deletions

View File

@@ -9,14 +9,14 @@ import (
)
type ConfigMapGeneratorPlugin struct {
ldr ifc.Loader
rf *resmap.Factory
ldr ifc.Loader
rf *resmap.Factory
types.GeneratorOptions
types.ConfigMapArgs
}
func NewConfigMapGeneratorPlugin() *ConfigMapGeneratorPlugin {
return &ConfigMapGeneratorPlugin{}
return &ConfigMapGeneratorPlugin{}
}
func (p *ConfigMapGeneratorPlugin) Config(

View File

@@ -18,7 +18,7 @@ type ImageTagTransformerPlugin struct {
}
func NewImageTagTransformerPlugin() *ImageTagTransformerPlugin {
return &ImageTagTransformerPlugin{}
return &ImageTagTransformerPlugin{}
}
func (p *ImageTagTransformerPlugin) Config(
@@ -30,11 +30,10 @@ func (p *ImageTagTransformerPlugin) Config(
func (p *ImageTagTransformerPlugin) Transform(m resmap.ResMap) error {
argsList := make([]image.Image, 1)
argsList[0] = p.ImageTag
t, err := transformers.NewImageTransformer(argsList, p.FieldSpecs)
if err != nil {
return err
argsList[0] = p.ImageTag
t, err := transformers.NewImageTransformer(argsList, p.FieldSpecs)
if err != nil {
return err
}
return t.Transform(m)
return t.Transform(m)
}

View File

@@ -17,7 +17,7 @@ type NameTransformerPlugin struct {
}
func NewNameTransformerPlugin() *NameTransformerPlugin {
return &NameTransformerPlugin{}
return &NameTransformerPlugin{}
}
func (p *NameTransformerPlugin) Config(

View File

@@ -16,7 +16,7 @@ type SecretGeneratorPlugin struct {
}
func NewSecretGeneratorPlugin() *SecretGeneratorPlugin {
return &SecretGeneratorPlugin{}
return &SecretGeneratorPlugin{}
}
func (p *SecretGeneratorPlugin) Config(