One plugin per dir.

This commit is contained in:
jregan
2019-05-19 12:00:07 -07:00
parent 31534fe47d
commit 5653ae69e4
42 changed files with 612 additions and 626 deletions

View File

@@ -1,10 +1,5 @@
// +build plugin
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
//go:generate go run sigs.k8s.io/kustomize/cmd/pluginator
package main
// Code generated by pluginator on NameTransformer; DO NOT EDIT.
package builtin
import (
"sigs.k8s.io/kustomize/pkg/ifc"
@@ -15,15 +10,17 @@ import (
)
// Add the given prefix and suffix to the resource name.
type plugin struct {
type NameTransformerPlugin struct {
Prefix string `json:"prefix,omitempty" yaml:"prefix,omitempty"`
Suffix string `json:"suffix,omitempty" yaml:"suffix,omitempty"`
FieldSpecs []config.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
var KustomizePlugin plugin
func NewNameTransformerPlugin() *NameTransformerPlugin {
return &NameTransformerPlugin{}
}
func (p *plugin) Config(
func (p *NameTransformerPlugin) Config(
ldr ifc.Loader, rf *resmap.Factory, c []byte) (err error) {
p.Prefix = ""
p.Suffix = ""
@@ -31,7 +28,7 @@ func (p *plugin) Config(
return yaml.Unmarshal(c, p)
}
func (p *plugin) Transform(m resmap.ResMap) error {
func (p *NameTransformerPlugin) Transform(m resmap.ResMap) error {
t, err := transformers.NewNamePrefixSuffixTransformer(
p.Prefix,
p.Suffix,