mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-20 13:42:23 +00:00
* Refactor prefix filter into its own filter, decoupled from the prefixsuffix filter * Refactor prefix transformer into its own transformer, decoupled from the prefixsuffix transformer * Refactor suffix filter into its own filter, decoupled from the prefixsuffix filter * Refactor suffix transformer into its own transformer, decoupled from the prefixsuffix transformer * Add a default nameSuffix field spec in addition to the namePrefix * Remove the PrefixSuffixTransformer from the list of builtin transformers * Add a multi-transformer to builtinhelpers.TransformFactories * Remove the implementation of the prefixsuffixtransformer.PrefixSuffixTransformer * Resolve style and format related feedback from the pull request * Add test to test the legacy PrefixSuffixTransformer for BC purposes
41 lines
1.2 KiB
Go
41 lines
1.2 KiB
Go
// Copyright 2019 The Kubernetes Authors.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package builtinpluginconsts
|
|
|
|
import (
|
|
"bytes"
|
|
)
|
|
|
|
// GetDefaultFieldSpecs returns default fieldSpecs.
|
|
func GetDefaultFieldSpecs() []byte {
|
|
configData := [][]byte{
|
|
[]byte(namePrefixFieldSpecs),
|
|
[]byte(nameSuffixFieldSpecs),
|
|
[]byte(commonLabelFieldSpecs),
|
|
[]byte(commonAnnotationFieldSpecs),
|
|
[]byte(namespaceFieldSpecs),
|
|
[]byte(varReferenceFieldSpecs),
|
|
[]byte(nameReferenceFieldSpecs),
|
|
[]byte(imagesFieldSpecs),
|
|
[]byte(replicasFieldSpecs),
|
|
}
|
|
return bytes.Join(configData, []byte("\n"))
|
|
}
|
|
|
|
// GetDefaultFieldSpecsAsMap returns default fieldSpecs
|
|
// as a string->string map.
|
|
func GetDefaultFieldSpecsAsMap() map[string]string {
|
|
result := make(map[string]string)
|
|
result["nameprefix"] = namePrefixFieldSpecs
|
|
result["namesuffix"] = nameSuffixFieldSpecs
|
|
result["commonlabels"] = commonLabelFieldSpecs
|
|
result["commonannotations"] = commonAnnotationFieldSpecs
|
|
result["namespace"] = namespaceFieldSpecs
|
|
result["varreference"] = varReferenceFieldSpecs
|
|
result["namereference"] = nameReferenceFieldSpecs
|
|
result["images"] = imagesFieldSpecs
|
|
result["replicas"] = replicasFieldSpecs
|
|
return result
|
|
}
|