diff --git a/.golangci-kustomize.yml b/.golangci-kustomize.yml index e2fadf5ba..097af0f10 100644 --- a/.golangci-kustomize.yml +++ b/.golangci-kustomize.yml @@ -26,7 +26,7 @@ linters: # stylecheck demands that acronyms not be treated as words # in camelCase, so JsonOp become JSONOp, etc. Yuck. # - stylecheck - # - typecheck (fails in lots of places) + - typecheck - unconvert - unused - unparam diff --git a/api/builtins/hashtransformer.go b/api/builtins/hashtransformer.go index b96d90c24..8de0d94bd 100644 --- a/api/builtins/hashtransformer.go +++ b/api/builtins/hashtransformer.go @@ -23,7 +23,7 @@ func (p *HashTransformerPlugin) Config( // Transform appends hash to generated resources. func (p *HashTransformerPlugin) Transform(m resmap.ResMap) error { for _, res := range m.Resources() { - if res.ShouldAddHashSuffixToName() { + if res.NeedHashSuffix() { h, err := p.hasher.Hash(res) if err != nil { return err diff --git a/api/internal/plugins/execplugin/execplugin_test.go b/api/internal/plugins/execplugin/execplugin_test.go index aa002868c..9974ff96a 100644 --- a/api/internal/plugins/execplugin/execplugin_test.go +++ b/api/internal/plugins/execplugin/execplugin_test.go @@ -157,7 +157,7 @@ func TestUpdateResourceOptions(t *testing.T) { if !a.Equals(b) { t.Errorf("expected %v got %v", a, b) } - if a.ShouldAddHashSuffixToName() != b.ShouldAddHashSuffixToName() { + if a.NeedHashSuffix() != b.NeedHashSuffix() { t.Errorf("") } if a.Behavior() != b.Behavior() { diff --git a/api/resource/resource.go b/api/resource/resource.go index 7c44f9fcc..fc8931d42 100644 --- a/api/resource/resource.go +++ b/api/resource/resource.go @@ -252,9 +252,9 @@ func (r *Resource) Behavior() types.GenerationBehavior { return r.options.Behavior() } -// ShouldAddHashSuffixToName returns true if a resource -// content hash should be appended to the name of the resource. -func (r *Resource) ShouldAddHashSuffixToName() bool { +// NeedHashSuffix returns true if a resource content +// hash should be appended to the name of the resource. +func (r *Resource) NeedHashSuffix() bool { return r.options != nil && r.options.ShouldAddHashSuffixToName() } diff --git a/api/types/genargs.go b/api/types/genargs.go index a80955b36..ad0e750fd 100644 --- a/api/types/genargs.go +++ b/api/types/genargs.go @@ -34,7 +34,7 @@ func (g *GenArgs) String() string { "}" } -// ShouldAddHashSuffixToName returns true if a resource +// NeedHashSuffix returns true if a resource // content hash should be appended to the name of the resource. func (g *GenArgs) ShouldAddHashSuffixToName() bool { return g.args != nil &&