diff --git a/pkg/commands/kustfile/kustomizationfile_test.go b/pkg/commands/kustfile/kustomizationfile_test.go index d78aab17d..3ad489304 100644 --- a/pkg/commands/kustfile/kustomizationfile_test.go +++ b/pkg/commands/kustfile/kustomizationfile_test.go @@ -241,7 +241,7 @@ patchesStrategicMerge: - pod.yaml # generator options generatorOptions: - disableHash: true + disableNameSuffixHash: true `) expected := []byte(` @@ -279,7 +279,7 @@ patchesStrategicMerge: - pod.yaml # generator options generatorOptions: - disableHash: true + disableNameSuffixHash: true `) fSys := fs.MakeFakeFS() fSys.WriteTestKustomizationWith(kustomizationContentWithComments) diff --git a/pkg/target/kusttarget.go b/pkg/target/kusttarget.go index 73e85cbc2..7472601e4 100644 --- a/pkg/target/kusttarget.go +++ b/pkg/target/kusttarget.go @@ -100,7 +100,7 @@ func (kt *KustTarget) MakeCustomizedResMap() (resmap.ResMap, error) { // resolveRefsToGeneratedResources fixes all name references. func (kt *KustTarget) resolveRefsToGeneratedResources(m resmap.ResMap) (resmap.ResMap, error) { - if kt.kustomization.GeneratorOptions == nil || !kt.kustomization.GeneratorOptions.DisableHash { + if kt.kustomization.GeneratorOptions == nil || !kt.kustomization.GeneratorOptions.DisableNameSuffixHash { err := kt.ptf.MakeHashTransformer().Transform(m) if err != nil { return nil, err diff --git a/pkg/target/kusttarget_test.go b/pkg/target/kusttarget_test.go index cb554fe3e..4bc6dc18a 100644 --- a/pkg/target/kusttarget_test.go +++ b/pkg/target/kusttarget_test.go @@ -261,9 +261,9 @@ func TestSecretTimeout(t *testing.T) { } } -func TestDisableHash(t *testing.T) { +func TestDisableNameSuffixHash(t *testing.T) { kt := makeKustTarget(t, makeLoader1(t)) - kt.kustomization.GeneratorOptions = &types.GeneratorOptions{DisableHash: true} + kt.kustomization.GeneratorOptions = &types.GeneratorOptions{DisableNameSuffixHash: true} actual, err := kt.MakeCustomizedResMap() if err != nil { t.Fatalf("unexpected Resources error %v", err) diff --git a/pkg/types/kustomization.go b/pkg/types/kustomization.go index 05c237438..bfa0037e3 100644 --- a/pkg/types/kustomization.go +++ b/pkg/types/kustomization.go @@ -249,8 +249,8 @@ type GeneratorOptions struct { // resource generation. Default at time of writing: {'sh', '-c'}. Shell []string `json:"shell,omitempty" yaml:"shell,omitempty"` - // DisableNameHash if true disables the default behavior of adding a + // DisableNameSuffixHash if true disables the default behavior of adding a // suffix to the names of generated resources that is a hash of the // resource contents. - DisableHash bool `json:"disableHash,omitempty" yaml:"disableHash,omitempty"` + DisableNameSuffixHash bool `json:"disableNameSuffixHash,omitempty" yaml:"disableNameSuffixHash,omitempty"` }