mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
One plugin per dir.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user