mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Rename disableHash to disableNameSuffixHash
This commit is contained in:
@@ -241,7 +241,7 @@ patchesStrategicMerge:
|
|||||||
- pod.yaml
|
- pod.yaml
|
||||||
# generator options
|
# generator options
|
||||||
generatorOptions:
|
generatorOptions:
|
||||||
disableHash: true
|
disableNameSuffixHash: true
|
||||||
`)
|
`)
|
||||||
|
|
||||||
expected := []byte(`
|
expected := []byte(`
|
||||||
@@ -279,7 +279,7 @@ patchesStrategicMerge:
|
|||||||
- pod.yaml
|
- pod.yaml
|
||||||
# generator options
|
# generator options
|
||||||
generatorOptions:
|
generatorOptions:
|
||||||
disableHash: true
|
disableNameSuffixHash: true
|
||||||
`)
|
`)
|
||||||
fSys := fs.MakeFakeFS()
|
fSys := fs.MakeFakeFS()
|
||||||
fSys.WriteTestKustomizationWith(kustomizationContentWithComments)
|
fSys.WriteTestKustomizationWith(kustomizationContentWithComments)
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ func (kt *KustTarget) MakeCustomizedResMap() (resmap.ResMap, error) {
|
|||||||
|
|
||||||
// resolveRefsToGeneratedResources fixes all name references.
|
// resolveRefsToGeneratedResources fixes all name references.
|
||||||
func (kt *KustTarget) resolveRefsToGeneratedResources(m resmap.ResMap) (resmap.ResMap, error) {
|
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)
|
err := kt.ptf.MakeHashTransformer().Transform(m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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 := makeKustTarget(t, makeLoader1(t))
|
||||||
kt.kustomization.GeneratorOptions = &types.GeneratorOptions{DisableHash: true}
|
kt.kustomization.GeneratorOptions = &types.GeneratorOptions{DisableNameSuffixHash: true}
|
||||||
actual, err := kt.MakeCustomizedResMap()
|
actual, err := kt.MakeCustomizedResMap()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected Resources error %v", err)
|
t.Fatalf("unexpected Resources error %v", err)
|
||||||
|
|||||||
@@ -249,8 +249,8 @@ type GeneratorOptions struct {
|
|||||||
// resource generation. Default at time of writing: {'sh', '-c'}.
|
// resource generation. Default at time of writing: {'sh', '-c'}.
|
||||||
Shell []string `json:"shell,omitempty" yaml:"shell,omitempty"`
|
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
|
// suffix to the names of generated resources that is a hash of the
|
||||||
// resource contents.
|
// 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