enable nameSuffix field of kustomization.yaml

This commit is contained in:
zoncoen
2018-11-15 19:04:11 +09:00
parent a094be45d9
commit 04a030bcf0
4 changed files with 24 additions and 11 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package resid
import (
"fmt"
"strings"
"sigs.k8s.io/kustomize/pkg/gvk"
@@ -134,6 +135,13 @@ func (n ResId) Name() string {
return n.name
}
// NameWithPrefixSuffix returns resource name with prefix and suffix.
func (n ResId) NameWithPrefixSuffix() string {
prefix := strings.Join(n.prefixList(), "")
suffix := strings.Join(n.suffixList(), "")
return fmt.Sprintf("%s%s%s", prefix, n.name, suffix)
}
// Prefix returns name prefix.
func (n ResId) Prefix() string {
return n.prefix