From 88aec95628ee066d36a02e855974b95532fa99d9 Mon Sep 17 00:00:00 2001 From: Jingfang Liu Date: Fri, 27 Jul 2018 11:02:44 -0700 Subject: [PATCH] remove commented code update multibases/README.md --- examples/multibases/README.md | 8 ++++++-- pkg/resource/resid.go | 7 ------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/examples/multibases/README.md b/examples/multibases/README.md index 4098736ef..86a8aa0b9 100644 --- a/examples/multibases/README.md +++ b/examples/multibases/README.md @@ -1,8 +1,12 @@ # Demo: multibases with a common base -When managing application in different environment, many Kustomize users have seen this scenario. There is a base _Kustomization_ for this application. On top of this base, there are several variants such as dev, staging and production variants. In each of those variants, a different _namePrefix_ is applied. Users sometimes need to create another _kustomization_ compsing all three variants, applying the same _namePrefix_, _commonLables_ or _commonAnnotations_ and deploying them together with one `kubectl` command. +`kustomize` encourages defining multiple variants - e.g. dev, staging and prod, as overlays on a common base. -Kustomize supports composing multiple variants like that in the same `kustomization.yaml`. This demo shows how this works with a pod object. +It's possible to create an additional overlay to compose these variants together - just declare the overlays as the bases of a new kustomization. + +This is also a means to apply a common label or annotation across the variants, if for some reason the base isn't under your control. It also allows one to define a left-most namePrefix across the variants - something that cannot be done by modifying the common base. + +The following demonstrates this using a base that's just one pod. Define a place to work: diff --git a/pkg/resource/resid.go b/pkg/resource/resid.go index 861875bf4..00c2f35cc 100644 --- a/pkg/resource/resid.go +++ b/pkg/resource/resid.go @@ -46,13 +46,6 @@ func NewResId(g schema.GroupVersionKind, n string) ResId { // String of ResId based on GVK, name and prefix func (n ResId) String() string { - //var fields []string - //for _, s := range []string{n.gvk.Group, n.gvk.Version, n.gvk.Kind, n.prefix, n.name} { - // if s != "" { - // fields = append(fields, s) - // } - //} - //return strings.Join(fields, "_") + ".yaml" fields := []string{n.gvk.Group, n.gvk.Version, n.gvk.Kind, n.prefix, n.name} return strings.Join(fields, "_") + ".yaml" }