Merge pull request #525 from monopole/renameDisableHash

Rename disableHash to disableNameSuffixHash
This commit is contained in:
Jeff Regan
2018-10-30 11:42:57 -07:00
committed by GitHub
4 changed files with 7 additions and 7 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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)

View File

@@ -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"`
}