Files
kustomize/plugin/builtin/SecretGenerator.go
jregan fe67bcdb8b Cut more ties to k8sdeps
Add tests for all the plugins.
2019-05-22 14:17:36 -07:00

35 lines
825 B
Go

// Code generated by pluginator on SecretGenerator; DO NOT EDIT.
package builtin
import (
"sigs.k8s.io/kustomize/pkg/ifc"
"sigs.k8s.io/kustomize/pkg/resmap"
"sigs.k8s.io/kustomize/pkg/types"
"sigs.k8s.io/yaml"
)
type SecretGeneratorPlugin struct {
ldr ifc.Loader
rf *resmap.Factory
types.GeneratorOptions
types.SecretArgs
}
func NewSecretGeneratorPlugin() *SecretGeneratorPlugin {
return &SecretGeneratorPlugin{}
}
func (p *SecretGeneratorPlugin) Config(
ldr ifc.Loader, rf *resmap.Factory, config []byte) (err error) {
p.GeneratorOptions = types.GeneratorOptions{}
p.SecretArgs = types.SecretArgs{}
err = yaml.Unmarshal(config, p)
p.ldr = ldr
p.rf = rf
return
}
func (p *SecretGeneratorPlugin) Generate() (resmap.ResMap, error) {
return p.rf.FromSecretArgs(p.ldr, &p.GeneratorOptions, p.SecretArgs)
}