mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-23 23:37:00 +00:00
Merge pull request #525 from monopole/renameDisableHash
Rename disableHash to disableNameSuffixHash
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user