diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 2aca0cfc5..85bdd5d67 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -20,7 +20,9 @@ jobs: id: go - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Lint run: ./hack/kyaml-pre-commit.sh diff --git a/.golangci-kustomize.yml b/.golangci-kustomize.yml deleted file mode 100644 index 003110429..000000000 --- a/.golangci-kustomize.yml +++ /dev/null @@ -1,50 +0,0 @@ -run: - deadline: 5m - -linters: - disable-all: true - enable: - - bodyclose - - deadcode - - depguard - # - dogsled - - dupl - # - errcheck - # - funlen - # - gochecknoinits - - goconst - # - gocritic - - gocyclo - - gofmt - - goimports - - golint - - gosec - - gosimple - - govet - - ineffassign - - interfacer - - lll - - misspell - - nakedret - # - scopelint - - staticcheck - - structcheck - # stylecheck demands that acronyms not be treated as words - # in camelCase, so JsonOp become JSONOp, etc. Yuck. - # - stylecheck - - typecheck - - unconvert - - unparam - - unused - - varcheck - # - whitespace - -linters-settings: - dupl: - threshold: 400 - lll: - line-length: 170 - gocyclo: - min-complexity: 15 - golint: - min-confidence: 0.85 diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 000000000..4b008d16d --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,123 @@ +# Copyright 2019 The Kubernetes Authors. +# SPDX-License-Identifier: Apache-2.0 + +run: + deadline: 5m + +linters: + # please, do not use `enable-all`: it's deprecated and will be removed soon. + # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint + disable-all: true + enable: + - asciicheck + - bidichk + - bodyclose + - contextcheck +# - cyclop + - deadcode + - depguard + - dogsled + - dupl + - durationcheck + - errcheck + - errname + - errorlint + - exhaustive +# - exhaustivestruct + - exportloopref +# - forbidigo + - forcetypeassert +# - funlen +# - gci + - gochecknoglobals + - gochecknoinits +# - gocognit + - goconst + - gocritic + - gocyclo +# - godot +# - godox + - goerr113 + - gofmt +# - gofumpt + - goheader + - goimports + - gomnd + - gomoddirectives + - gomodguard + - goprintffuncname + - gosec + - gosimple + - govet +# - ifshort # too many false positives + - importas + - ineffassign +# - ireturn + - lll + - makezero + - misspell + - nakedret + - nestif + - nilerr +# - nilnil +# - nlreturn +# - noctx + - nolintlint +# - paralleltest + - prealloc + - predeclared + - promlinter + - revive + - rowserrcheck + - sqlclosecheck + - staticcheck + - structcheck +# - stylecheck + - tagliatelle + - tenv + - testpackage + - thelper + - tparallel + - typecheck + - unconvert + - unparam + - unused + - varcheck +# - varnamelen + - wastedassign + - whitespace + - wrapcheck +# - wsl + +linters-settings: + dupl: + threshold: 400 + lll: + line-length: 170 + gocyclo: + min-complexity: 30 + revive: + rules: + - name: var-naming + arguments: + - [ "ID", "API", "JSON" ] # AllowList + - [ ] # DenyList + gomoddirectives: + replace-local: true + gosec: + config: + G306: "0644" + gomnd: + ignored-functions: + - ioutil.WriteFile + +issues: + new-from-rev: c94b5d8f2 # enables us to enforce a larger set of linters for new code than pass on existing code + max-same-issues: 0 + exclude-rules: + - linters: + - revive + text: "don't use leading" + - linters: + - staticcheck + text: "SA1019: kioutil.Legacy" diff --git a/Makefile b/Makefile index b92acbba0..1d6d80653 100644 --- a/Makefile +++ b/Makefile @@ -55,17 +55,17 @@ verify-kustomize-e2e: test-examples-e2e-kustomize # This installs what kustomize wants to use. $(MYGOBIN)/golangci-lint-kustomize: rm -f $(CURDIR)/hack/golangci-lint - GOBIN=$(CURDIR)/hack go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.23.8 + GOBIN=$(CURDIR)/hack go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2 mv $(CURDIR)/hack/golangci-lint $(MYGOBIN)/golangci-lint-kustomize $(MYGOBIN)/mdrip: go install github.com/monopole/mdrip@v1.0.2 $(MYGOBIN)/stringer: - go get golang.org/x/tools/cmd/stringer + go install golang.org/x/tools/cmd/stringer@latest $(MYGOBIN)/goimports: - go get golang.org/x/tools/cmd/goimports + go install golang.org/x/tools/cmd/goimports@latest # Build from local source. $(MYGOBIN)/gorepomod: @@ -203,13 +203,16 @@ clean-kustomize-external-go-plugin: .PHONY: lint-kustomize lint-kustomize: $(MYGOBIN)/golangci-lint-kustomize $(builtinplugins) cd api; $(MYGOBIN)/golangci-lint-kustomize \ - -c ../.golangci-kustomize.yml \ + -c ../.golangci.yml \ + --path-prefix api \ run ./... cd kustomize; $(MYGOBIN)/golangci-lint-kustomize \ - -c ../.golangci-kustomize.yml \ + -c ../.golangci.yml \ + --path-prefix kustomize \ run ./... cd cmd/pluginator; $(MYGOBIN)/golangci-lint-kustomize \ - -c ../../.golangci-kustomize.yml \ + -c ../../.golangci.yml \ + --path-prefix cmd/pluginator \ run ./... # Used to add non-default compilation flags when experimenting with diff --git a/api/filters/annotations/annotations_test.go b/api/filters/annotations/annotations_test.go index d52cd673a..94669e8f9 100644 --- a/api/filters/annotations/annotations_test.go +++ b/api/filters/annotations/annotations_test.go @@ -285,7 +285,7 @@ spec: t.Run(tn, func(t *testing.T) { filter := tc.filter filter.WithMutationTracker(tc.setEntryCallback) - filter.FsSlice = append(annosFs, tc.fsslice...) + filter.FsSlice = append(annosFs, tc.fsslice...) //nolint:gocritic if !assert.Equal(t, strings.TrimSpace(tc.expectedOutput), strings.TrimSpace(filtertest_test.RunFilter(t, tc.input, filter))) { diff --git a/api/filters/iampolicygenerator/iampolicygenerator.go b/api/filters/iampolicygenerator/iampolicygenerator.go index c1f8593fb..97ea31693 100644 --- a/api/filters/iampolicygenerator/iampolicygenerator.go +++ b/api/filters/iampolicygenerator/iampolicygenerator.go @@ -43,7 +43,7 @@ metadata: f.IAMPolicyGenerator.KubernetesService.Name) if f.IAMPolicyGenerator.Namespace != "" { - input = input + fmt.Sprintf("\n namespace: %s", f.IAMPolicyGenerator.Namespace) + input += fmt.Sprintf("\n namespace: %s", f.IAMPolicyGenerator.Namespace) } sa, err := yaml.Parse(input) diff --git a/api/filters/imagetag/legacy.go b/api/filters/imagetag/legacy.go index d07080b8e..d6f5b33f2 100644 --- a/api/filters/imagetag/legacy.go +++ b/api/filters/imagetag/legacy.go @@ -6,6 +6,7 @@ package imagetag import ( "sigs.k8s.io/kustomize/api/internal/utils" "sigs.k8s.io/kustomize/api/types" + "sigs.k8s.io/kustomize/kyaml/errors" "sigs.k8s.io/kustomize/kyaml/kio" "sigs.k8s.io/kustomize/kyaml/yaml" ) @@ -81,9 +82,7 @@ func (f findFieldsFilter) walk(node *yaml.RNode) error { return nil }) case yaml.SequenceNode: - return node.VisitElements(func(n *yaml.RNode) error { - return f.walk(n) - }) + return errors.Wrap(node.VisitElements(f.walk)) } return nil } diff --git a/api/filters/imagetag/updater.go b/api/filters/imagetag/updater.go index 45c6c748d..810f20591 100644 --- a/api/filters/imagetag/updater.go +++ b/api/filters/imagetag/updater.go @@ -36,13 +36,14 @@ func (u imageTagUpdater) SetImageValue(rn *yaml.RNode) error { } // overriding tag or digest will replace both original tag and digest values - if u.ImageTag.NewTag != "" && u.ImageTag.Digest != "" { + switch { + case u.ImageTag.NewTag != "" && u.ImageTag.Digest != "": tag = u.ImageTag.NewTag digest = u.ImageTag.Digest - } else if u.ImageTag.NewTag != "" { + case u.ImageTag.NewTag != "": tag = u.ImageTag.NewTag digest = "" - } else if u.ImageTag.Digest != "" { + case u.ImageTag.Digest != "": tag = "" digest = u.ImageTag.Digest } diff --git a/api/filters/namespace/namespace.go b/api/filters/namespace/namespace.go index 016a14a13..8d0f54ea2 100644 --- a/api/filters/namespace/namespace.go +++ b/api/filters/namespace/namespace.go @@ -139,7 +139,6 @@ func (ns Filter) roleBindingHack(obj *yaml.RNode, gvk resid.Gvk) error { } return ns.trackableSetter.SetEntry("", ns.Namespace, yaml.NodeTagString)(node) - }) return err diff --git a/api/filters/namespace/namespace_test.go b/api/filters/namespace/namespace_test.go index 32a24d29f..5e4813dc1 100644 --- a/api/filters/namespace/namespace_test.go +++ b/api/filters/namespace/namespace_test.go @@ -406,7 +406,7 @@ func TestNamespace_Filter(t *testing.T) { test := tests[i] test.filter.WithMutationTracker(test.mutationTracker) t.Run(test.name, func(t *testing.T) { - test.filter.FsSlice = append(config.NameSpace, test.fsslice...) + test.filter.FsSlice = append(config.NameSpace, test.fsslice...) //nolint:gocritic if !assert.Equal(t, strings.TrimSpace(test.expected), strings.TrimSpace( diff --git a/api/filters/refvar/refvar_test.go b/api/filters/refvar/refvar_test.go index c80dc79bd..87147ef62 100644 --- a/api/filters/refvar/refvar_test.go +++ b/api/filters/refvar/refvar_test.go @@ -17,7 +17,6 @@ var makeMf = func(theMap map[string]interface{}) MappingFunc { } func TestFilter(t *testing.T) { - testCases := map[string]struct { input string expected string diff --git a/api/filters/replacement/replacement.go b/api/filters/replacement/replacement.go index f4627ddbc..a96dfff71 100644 --- a/api/filters/replacement/replacement.go +++ b/api/filters/replacement/replacement.go @@ -20,11 +20,11 @@ type Filter struct { // Filter replaces values of targets with values from sources func (f Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) { - for _, r := range f.Replacements { + for i, r := range f.Replacements { if r.Source == nil || r.Targets == nil { return nil, fmt.Errorf("replacements must specify a source and at least one target") } - value, err := getReplacement(nodes, &r) + value, err := getReplacement(nodes, &f.Replacements[i]) if err != nil { return nil, err } @@ -60,8 +60,8 @@ func applyReplacement(nodes []*yaml.RNode, value *yaml.RNode, targets []*types.T } // filter targets by matching resource IDs - for _, id := range ids { - if id.IsSelectedBy(t.Select.ResId) && !rejectId(t.Reject, &id) { + for i, id := range ids { + if id.IsSelectedBy(t.Select.ResId) && !rejectId(t.Reject, &ids[i]) { err := applyToNode(n, value, t) if err != nil { return nil, err diff --git a/api/go.sum b/api/go.sum index 5916f6cf2..5c24b2765 100644 --- a/api/go.sum +++ b/api/go.sum @@ -604,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/api/hasher/hasher_test.go b/api/hasher/hasher_test.go index 0235d409e..a0de2bb4f 100644 --- a/api/hasher/hasher_test.go +++ b/api/hasher/hasher_test.go @@ -341,6 +341,7 @@ data: // The return value indicates whether we should skip the rest of the test case // due to the error result. func SkipRest(t *testing.T, desc string, err error, contains string) bool { + t.Helper() if err != nil { if len(contains) == 0 { t.Errorf("case %q, expect nil error but got %q", desc, err.Error()) diff --git a/api/internal/accumulator/namereferencetransformer.go b/api/internal/accumulator/namereferencetransformer.go index e039db4b1..f8f12b4f2 100644 --- a/api/internal/accumulator/namereferencetransformer.go +++ b/api/internal/accumulator/namereferencetransformer.go @@ -113,7 +113,6 @@ func debug(fMap filterMap) { // 'spec/scaleTargetRef/name' field. Return a filter that can do that. func (t *nameReferenceTransformer) determineFilters( resources []*resource.Resource) (fMap filterMap) { - // We cache the resource OrgId values because they don't change and otherwise are very visible in a memory pprof resourceOrgIds := make([]resid.ResId, len(resources)) for i, resource := range resources { diff --git a/api/internal/accumulator/resaccumulator.go b/api/internal/accumulator/resaccumulator.go index 934553757..2c1fc71b5 100644 --- a/api/internal/accumulator/resaccumulator.go +++ b/api/internal/accumulator/resaccumulator.go @@ -107,7 +107,6 @@ func (ra *ResAccumulator) findVarValueFromResources(v types.Var) (interface{}, e for _, res := range ra.resMap.Resources() { for _, varName := range res.GetRefVarNames() { if varName == v.Name { - //nolint: staticcheck s, err := res.GetFieldValue(v.FieldRef.FieldPath) if err != nil { return "", fmt.Errorf( diff --git a/api/internal/accumulator/resaccumulator_test.go b/api/internal/accumulator/resaccumulator_test.go index 1d2140c1e..6cc565682 100644 --- a/api/internal/accumulator/resaccumulator_test.go +++ b/api/internal/accumulator/resaccumulator_test.go @@ -22,6 +22,7 @@ import ( ) func makeResAccumulator(t *testing.T) *ResAccumulator { + t.Helper() ra := MakeEmptyAccumulator() err := ra.MergeConfig(builtinconfig.MakeDefaultConfig()) if err != nil { @@ -133,6 +134,7 @@ func TestResolveVarsOneUnused(t *testing.T) { } func expectLog(t *testing.T, log bytes.Buffer, expect string) { + t.Helper() if !strings.Contains(log.String(), expect) { t.Fatalf("expected log containing '%s', got '%s'", expect, log.String()) } diff --git a/api/internal/git/repospec.go b/api/internal/git/repospec.go index 10ebb980a..996f0cf23 100644 --- a/api/internal/git/repospec.go +++ b/api/internal/git/repospec.go @@ -78,15 +78,15 @@ func (x *RepoSpec) Cleaner(fSys filesys.FileSystem) func() error { return func() error { return fSys.RemoveAll(x.Dir.String()) } } -// NewRepoSpecFromUrl parses git-like urls. +// NewRepoSpecFromURL parses git-like urls. // From strings like git@github.com:someOrg/someRepo.git or // https://github.com/someOrg/someRepo?ref=someHash, extract // the parts. -func NewRepoSpecFromUrl(n string) (*RepoSpec, error) { +func NewRepoSpecFromURL(n string) (*RepoSpec, error) { if filepath.IsAbs(n) { return nil, fmt.Errorf("uri looks like abs path: %s", n) } - host, orgRepo, path, gitRef, gitSubmodules, suffix, gitTimeout := parseGitUrl(n) + host, orgRepo, path, gitRef, gitSubmodules, suffix, gitTimeout := parseGitURL(n) if orgRepo == "" { return nil, fmt.Errorf("url lacks orgRepo: %s", n) } @@ -108,9 +108,8 @@ const ( // From strings like git@github.com:someOrg/someRepo.git or // https://github.com/someOrg/someRepo?ref=someHash, extract // the parts. -func parseGitUrl(n string) ( +func parseGitURL(n string) ( host string, orgRepo string, path string, gitRef string, gitSubmodules bool, gitSuff string, gitTimeout time.Duration) { - if strings.Contains(n, gitDelimiter) { index := strings.Index(n, gitDelimiter) // Adding _git/ to host @@ -229,7 +228,7 @@ func parseHostSpec(n string) (string, string) { if strings.HasSuffix(host, p) { i := strings.Index(n, "/") if i > -1 { - host = host + n[0:i+1] + host += n[0 : i+1] n = n[i+1:] } break diff --git a/api/internal/git/repospec_test.go b/api/internal/git/repospec_test.go index 2e4404d03..41e89ca31 100644 --- a/api/internal/git/repospec_test.go +++ b/api/internal/git/repospec_test.go @@ -37,7 +37,7 @@ var hostNamesRawAndNormalized = [][]string{ {"git@github.com/", "git@github.com:"}, } -func makeUrl(hostFmt, orgRepo, path, href string) string { +func makeURL(hostFmt, orgRepo, path, href string) string { if len(path) > 0 { orgRepo = filepath.Join(orgRepo, path) } @@ -56,8 +56,8 @@ func TestNewRepoSpecFromUrl(t *testing.T) { for _, orgRepo := range orgRepos { for _, pathName := range pathNames { for _, hrefArg := range hrefArgs { - uri := makeUrl(hostRaw, orgRepo, pathName, hrefArg) - rs, err := NewRepoSpecFromUrl(uri) + uri := makeURL(hostRaw, orgRepo, pathName, hrefArg) + rs, err := NewRepoSpecFromURL(uri) if err != nil { t.Errorf("problem %v", err) } @@ -99,7 +99,7 @@ var badData = [][]string{ func TestNewRepoSpecFromUrlErrors(t *testing.T) { for _, tuple := range badData { - _, err := NewRepoSpecFromUrl(tuple[0]) + _, err := NewRepoSpecFromURL(tuple[0]) if err == nil { t.Error("expected error") } @@ -191,7 +191,7 @@ func TestNewRepoSpecFromUrl_CloneSpecs(t *testing.T) { } for tn, tc := range testcases { t.Run(tn, func(t *testing.T) { - rs, err := NewRepoSpecFromUrl(tc.input) + rs, err := NewRepoSpecFromURL(tc.input) assert.NoError(t, err) assert.Equal(t, tc.cloneSpec, rs.CloneSpec(), "cloneSpec mismatch") assert.Equal(t, tc.absPath, rs.AbsPath(), "absPath mismatch") diff --git a/api/internal/plugins/builtinhelpers/builtins.go b/api/internal/plugins/builtinhelpers/builtins.go index 260ed1bf5..b1c987a52 100644 --- a/api/internal/plugins/builtinhelpers/builtins.go +++ b/api/internal/plugins/builtinhelpers/builtins.go @@ -36,7 +36,7 @@ const ( var stringToBuiltinPluginTypeMap map[string]BuiltinPluginType -func init() { +func init() { //nolint:gochecknoinits stringToBuiltinPluginTypeMap = makeStringToBuiltinPluginTypeMap() } diff --git a/api/internal/plugins/execplugin/execplugin_test.go b/api/internal/plugins/execplugin/execplugin_test.go index 5cc637f3b..b20626297 100644 --- a/api/internal/plugins/execplugin/execplugin_test.go +++ b/api/internal/plugins/execplugin/execplugin_test.go @@ -83,7 +83,6 @@ metadata: ` if expected != string(p.Cfg()) { t.Fatalf("expected cfg '%s', got '%s'", expected, string(p.Cfg())) - } if len(p.Args()) != 6 { t.Fatalf("unexpected arg len %d, %#v", len(p.Args()), p.Args()) diff --git a/api/internal/plugins/utils/utils_test.go b/api/internal/plugins/utils/utils_test.go index 9aa0184ed..32ef65826 100644 --- a/api/internal/plugins/utils/utils_test.go +++ b/api/internal/plugins/utils/utils_test.go @@ -105,10 +105,10 @@ func TestUpdateResourceOptionsWithInvalidHashAnnotationValues(t *testing.T) { "TrUe", "potato", } - for i, c := range cases { + for i := range cases { name := fmt.Sprintf("test%d", i) in := resmap.New() - err := in.Append(makeConfigMap(rf, name, "", &c)) + err := in.Append(makeConfigMap(rf, name, "", &cases[i])) require.NoError(t, err) _, err = UpdateResourceOptions(in) require.Error(t, err) diff --git a/api/internal/target/maker_test.go b/api/internal/target/maker_test.go index 9d4f9b1ef..67f1d8dbe 100644 --- a/api/internal/target/maker_test.go +++ b/api/internal/target/maker_test.go @@ -20,6 +20,7 @@ func makeAndLoadKustTarget( t *testing.T, fSys filesys.FileSystem, root string) *target.KustTarget { + t.Helper() kt := makeKustTargetWithRf(t, fSys, root, provider.NewDefaultDepProvider()) if err := kt.Load(); err != nil { t.Fatalf("Unexpected load error %v", err) @@ -32,6 +33,7 @@ func makeKustTargetWithRf( fSys filesys.FileSystem, root string, pvd *provider.DepProvider) *target.KustTarget { + t.Helper() ldr, err := fLdr.NewLoader(fLdr.RestrictionRootOnly, root, fSys) if err != nil { t.Fatal(err) diff --git a/api/konfig/plugins_test.go b/api/konfig/plugins_test.go index f3ed8e828..87320a19f 100644 --- a/api/konfig/plugins_test.go +++ b/api/konfig/plugins_test.go @@ -179,9 +179,11 @@ func TestDefaultAbsPluginHomeNoXdgJustHomeDir(t *testing.T) { } func setenv(t *testing.T, key, value string) { + t.Helper() require.NoError(t, os.Setenv(key, value)) } func unsetenv(t *testing.T, key string) { + t.Helper() require.NoError(t, os.Unsetenv(key)) } diff --git a/api/krusty/basic_io_test.go b/api/krusty/basic_io_test.go index 5e6eef8fd..354c4d2d2 100644 --- a/api/krusty/basic_io_test.go +++ b/api/krusty/basic_io_test.go @@ -82,7 +82,7 @@ spec: `) } -//test for https://github.com/kubernetes-sigs/kustomize/issues/3812#issuecomment-862339267 +// test for https://github.com/kubernetes-sigs/kustomize/issues/3812#issuecomment-862339267 func TestBasicIO3812(t *testing.T) { th := kusttest_test.MakeHarness(t) th.WriteK(".", ` diff --git a/api/krusty/configmaps_test.go b/api/krusty/configmaps_test.go index 721979983..a2b954444 100644 --- a/api/krusty/configmaps_test.go +++ b/api/krusty/configmaps_test.go @@ -460,7 +460,6 @@ metadata: } func TestConfigMapGeneratorMergeNamePrefix(t *testing.T) { - th := kusttest_test.MakeHarness(t) th.WriteK("base", ` configMapGenerator: diff --git a/api/krusty/diamondcomposition_test.go b/api/krusty/diamondcomposition_test.go index 401afb1a9..9603b325e 100644 --- a/api/krusty/diamondcomposition_test.go +++ b/api/krusty/diamondcomposition_test.go @@ -34,7 +34,7 @@ const container = `{ "image": "my-image", "livenessProbe": { "httpGet" : {"path" const patchJsonAddProbe = `[{"op": "replace", "path": "/spec/template/spec/containers/0", "value": ` + container + `}]` -const patchDnsPolicy = ` +const patchDNSPolicy = ` apiVersion: apps/v1 kind: Deployment metadata: @@ -44,7 +44,7 @@ spec: spec: dnsPolicy: ClusterFirst ` -const patchJsonDnsPolicy = `[{"op": "add", "path": "/spec/template/spec/dnsPolicy", "value": "ClusterFirst"}]` +const patchJsonDNSPolicy = `[{"op": "add", "path": "/spec/template/spec/dnsPolicy", "value": "ClusterFirst"}]` const patchRestartPolicy = ` apiVersion: apps/v1 @@ -96,7 +96,7 @@ resources: patchesStrategicMerge: - dep-patch.yaml `) - th.WriteF("dns/dep-patch.yaml", patchDnsPolicy) + th.WriteF("dns/dep-patch.yaml", patchDNSPolicy) } func writeRestartOverlay(th kusttest_test.Harness) { @@ -209,7 +209,7 @@ patchesStrategicMerge: - patchRestartPolicy.yaml `) th.WriteF("composite/patchRestartPolicy.yaml", patchRestartPolicy) - th.WriteF("composite/patchDnsPolicy.yaml", patchDnsPolicy) + th.WriteF("composite/patchDnsPolicy.yaml", patchDNSPolicy) th.WriteF("composite/patchAddProbe.yaml", patchAddProbe) m := th.Run("composite", th.MakeDefaultOptions()) @@ -220,7 +220,7 @@ func definePatchDirStructure(th kusttest_test.Harness) { writeDeploymentBase(th) th.WriteF("patches/patchRestartPolicy.yaml", patchRestartPolicy) - th.WriteF("patches/patchDnsPolicy.yaml", patchDnsPolicy) + th.WriteF("patches/patchDnsPolicy.yaml", patchDNSPolicy) th.WriteF("patches/patchAddProbe.yaml", patchAddProbe) } @@ -368,7 +368,7 @@ func TestIssue1251_Plugins_Local(t *testing.T) { writeDeploymentBase(th.Harness) writeJsonTransformerPluginConfig( - th, "composite", "addDnsPolicy", patchJsonDnsPolicy) + th, "composite", "addDnsPolicy", patchJsonDNSPolicy) writeJsonTransformerPluginConfig( th, "composite", "addRestartPolicy", patchJsonRestartPolicy) writeJsonTransformerPluginConfig( @@ -417,7 +417,7 @@ resources: - addProbeConfig.yaml `) writeJsonTransformerPluginConfig( - th, "patches", "addDnsPolicy", patchJsonDnsPolicy) + th, "patches", "addDnsPolicy", patchJsonDNSPolicy) writeJsonTransformerPluginConfig( th, "patches", "addRestartPolicy", patchJsonRestartPolicy) writeJsonTransformerPluginConfig( @@ -441,7 +441,7 @@ resources: - addDnsPolicyConfig.yaml `) writeJsonTransformerPluginConfig( - th, "patches/addDnsPolicy", "addDnsPolicy", patchJsonDnsPolicy) + th, "patches/addDnsPolicy", "addDnsPolicy", patchJsonDNSPolicy) th.WriteK("patches/addRestartPolicy", ` resources: diff --git a/api/krusty/disablenamesuffix_test.go b/api/krusty/disablenamesuffix_test.go index 9580a8914..d50a65ed8 100644 --- a/api/krusty/disablenamesuffix_test.go +++ b/api/krusty/disablenamesuffix_test.go @@ -82,21 +82,19 @@ metadata: secret := findSecret(m, "") if secret == nil { t.Errorf("Expected to find a Secret") - } - if secret.GetName() != "foo-secret-bar-82c2g5f8f6" { + } else if secret.GetName() != "foo-secret-bar-82c2g5f8f6" { t.Errorf("unexpected secret resource name: %s", secret.GetName()) } th.WriteK("/whatever", - strings.Replace(kustomizationContent, + strings.ReplaceAll(kustomizationContent, "disableNameSuffixHash: false", - "disableNameSuffixHash: true", -1)) + "disableNameSuffixHash: true")) m = th.Run("/whatever", th.MakeDefaultOptions()) secret = findSecret(m, "") if secret == nil { t.Errorf("Expected to find a Secret") - } - if secret.GetName() != "foo-secret-bar" { // No hash at end. + } else if secret.GetName() != "foo-secret-bar" { // No hash at end. t.Errorf("unexpected secret resource name: %s", secret.GetName()) } } @@ -131,16 +129,14 @@ secretGenerator: secret := findSecret(m, "nohash") if secret == nil { t.Errorf("Expected to find a Secret") - } - if secret.GetName() != "nohash" { + } else if secret.GetName() != "nohash" { t.Errorf("unexpected secret resource name: %s", secret.GetName()) } secret = findSecret(m, "yeshash") if secret == nil { t.Errorf("Expected to find a Secret") - } - if secret.GetName() != "yeshash-82c2g5f8f6" { + } else if secret.GetName() != "yeshash-82c2g5f8f6" { t.Errorf("unexpected secret resource name: %s", secret.GetName()) } } diff --git a/api/krusty/fnplugin_test.go b/api/krusty/fnplugin_test.go index 88fa8dee8..e4d5fa83b 100644 --- a/api/krusty/fnplugin_test.go +++ b/api/krusty/fnplugin_test.go @@ -214,6 +214,7 @@ spec: } func skipIfNoDocker(t *testing.T) { + t.Helper() if _, err := exec.LookPath("docker"); err != nil { t.Skip("skipping because docker binary wasn't found in PATH") } diff --git a/api/krusty/namespaces_test.go b/api/krusty/namespaces_test.go index 45d18078d..58dbb8686 100644 --- a/api/krusty/namespaces_test.go +++ b/api/krusty/namespaces_test.go @@ -692,6 +692,7 @@ resources: th.AssertActualEqualsExpected(m, namespaceNeedInVarExpectedOutput) } +// nolint:gosec const namespaceNeedInVarMyAppWithNamespace string = ` resources: - elasticsearch-dev-service.yaml diff --git a/api/krusty/pluginenv_test.go b/api/krusty/pluginenv_test.go index a4d8c230c..86351e780 100644 --- a/api/krusty/pluginenv_test.go +++ b/api/krusty/pluginenv_test.go @@ -67,6 +67,7 @@ metadata: } func makeTmpDir(t *testing.T) string { + t.Helper() base, err := os.Getwd() if err != nil { t.Fatalf("err %v", err) diff --git a/api/krusty/repeatbase_test.go b/api/krusty/repeatbase_test.go index 438b7af28..0fc80e462 100644 --- a/api/krusty/repeatbase_test.go +++ b/api/krusty/repeatbase_test.go @@ -172,6 +172,5 @@ spec: // containers: // - image: image-canary-a // name: container-a - //`) - + // `) } diff --git a/api/loader/fileloader.go b/api/loader/fileloader.go index ffeef3b02..793b82c82 100644 --- a/api/loader/fileloader.go +++ b/api/loader/fileloader.go @@ -172,7 +172,7 @@ func (fl *fileLoader) New(path string) (ifc.Loader, error) { return nil, fmt.Errorf("new root cannot be empty") } - repoSpec, err := git.NewRepoSpecFromUrl(path) + repoSpec, err := git.NewRepoSpecFromURL(path) if err == nil { // Treat this as git repo clone request. if err = fl.errIfRepoCycle(repoSpec); err != nil { @@ -315,7 +315,7 @@ func (fl *fileLoader) Load(path string) ([]byte, error) { } defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode > 299 { - _, err := git.NewRepoSpecFromUrl(path) + _, err := git.NewRepoSpecFromURL(path) if err == nil { return nil, errors.New("URL is a git repository") } diff --git a/api/loader/fileloader_test.go b/api/loader/fileloader_test.go index aedfd1693..79cc4050e 100644 --- a/api/loader/fileloader_test.go +++ b/api/loader/fileloader_test.go @@ -240,6 +240,7 @@ func commonSetupForLoaderRestrictionTest() (string, filesys.FileSystem, error) { // in or below the loader root. func doSanityChecksAndDropIntoBase( t *testing.T, l ifc.Loader) ifc.Loader { + t.Helper() data, err := l.Load(path.Join("base", "okayData")) if err != nil { t.Fatalf("unexpected error: %v", err) @@ -347,7 +348,7 @@ func splitOnNthSlash(v string, n int) (string, string) { if k < 0 { break } - left = left + v[:k+1] + left += v[:k+1] v = v[k+1:] } return left[:len(left)-1], v @@ -367,9 +368,9 @@ func TestSplit(t *testing.T) { } func TestNewLoaderAtGitClone(t *testing.T) { - rootUrl := "github.com/someOrg/someRepo" + rootURL := "github.com/someOrg/someRepo" pathInRepo := "foo/base" - url := rootUrl + "/" + pathInRepo + url := rootURL + "/" + pathInRepo coRoot := "/tmp" fSys := filesys.MakeFsInMemory() fSys.MkdirAll(coRoot) @@ -381,7 +382,7 @@ func TestNewLoaderAtGitClone(t *testing.T) { whatever `)) - repoSpec, err := git.NewRepoSpecFromUrl(url) + repoSpec, err := git.NewRepoSpecFromURL(url) if err != nil { t.Fatalf("unexpected err: %v\n", err) } @@ -398,13 +399,13 @@ whatever if _, err = l.New(url); err == nil { t.Fatalf("expected cycle error 1") } - if _, err = l.New(rootUrl + "/" + "foo"); err == nil { + if _, err = l.New(rootURL + "/" + "foo"); err == nil { t.Fatalf("expected cycle error 2") } pathInRepo = "foo/overlay" fSys.MkdirAll(coRoot + "/" + pathInRepo) - url = rootUrl + "/" + pathInRepo + url = rootURL + "/" + pathInRepo l2, err := l.New(url) if err != nil { t.Fatalf("unexpected error: %v", err) @@ -459,7 +460,7 @@ func TestLoaderDisallowsLocalBaseFromRemoteOverlay(t *testing.T) { // exist in its own repository, so presumably the // remote K would be deliberately designed to phish // for local K's. - repoSpec, err := git.NewRepoSpecFromUrl( + repoSpec, err := git.NewRepoSpecFromURL( "github.com/someOrg/someRepo/foo/overlay") if err != nil { t.Fatalf("unexpected err: %v\n", err) @@ -533,7 +534,7 @@ func TestRepoDirectCycleDetection(t *testing.T) { RestrictionRootOnly, root, fSys, nil, git.DoNothingCloner(filesys.ConfirmedDir(cloneRoot))) p1 := "github.com/someOrg/someRepo/foo" - rs1, err := git.NewRepoSpecFromUrl(p1) + rs1, err := git.NewRepoSpecFromURL(p1) if err != nil { t.Fatalf("unexpected err: %v", err) } diff --git a/api/loader/loader.go b/api/loader/loader.go index 7a2b75f20..17dbad897 100644 --- a/api/loader/loader.go +++ b/api/loader/loader.go @@ -19,7 +19,7 @@ import ( func NewLoader( lr LoadRestrictorFunc, target string, fSys filesys.FileSystem) (ifc.Loader, error) { - repoSpec, err := git.NewRepoSpecFromUrl(target) + repoSpec, err := git.NewRepoSpecFromURL(target) if err == nil { // The target qualifies as a remote git target. return newLoaderAtGitClone( diff --git a/api/resmap/factory.go b/api/resmap/factory.go index 9ec0fe396..ee6c68f10 100644 --- a/api/resmap/factory.go +++ b/api/resmap/factory.go @@ -78,8 +78,8 @@ func (rmF *Factory) NewResMapFromBytes(b []byte) (ResMap, error) { func (rmF *Factory) NewResMapFromConfigMapArgs( kvLdr ifc.KvLoader, argList []types.ConfigMapArgs) (ResMap, error) { var resources []*resource.Resource - for _, args := range argList { - res, err := rmF.resF.MakeConfigMap(kvLdr, &args) + for i := range argList { + res, err := rmF.resF.MakeConfigMap(kvLdr, &argList[i]) if err != nil { return nil, errors.Wrap(err, "NewResMapFromConfigMapArgs") } @@ -103,8 +103,8 @@ func (rmF *Factory) FromConfigMapArgs( func (rmF *Factory) NewResMapFromSecretArgs( kvLdr ifc.KvLoader, argsList []types.SecretArgs) (ResMap, error) { var resources []*resource.Resource - for _, args := range argsList { - res, err := rmF.resF.MakeSecret(kvLdr, &args) + for i := range argsList { + res, err := rmF.resF.MakeSecret(kvLdr, &argsList[i]) if err != nil { return nil, errors.Wrap(err, "NewResMapFromSecretArgs") } diff --git a/api/resmap/reswrangler.go b/api/resmap/reswrangler.go index 5ce98dc77..e80299448 100644 --- a/api/resmap/reswrangler.go +++ b/api/resmap/reswrangler.go @@ -429,7 +429,6 @@ func getNamespacesForRoleBinding(r *resource.Resource) (map[string]bool, error) if r.GetKind() != "RoleBinding" { return result, nil } - //nolint staticcheck subjects, err := r.GetSlice("subjects") if err != nil || subjects == nil { return result, nil @@ -442,7 +441,7 @@ func getNamespacesForRoleBinding(r *resource.Resource) (map[string]bool, error) if n, ok3 := ns.(string); ok3 { result[n] = true } else { - return nil, errors.New(fmt.Sprintf("Invalid Input: namespace is blank for resource %q\n", r.CurId())) + return nil, errors.Errorf("Invalid Input: namespace is blank for resource %q\n", r.CurId()) } } } diff --git a/api/resmap/reswrangler_test.go b/api/resmap/reswrangler_test.go index d81c76cdd..d254ad9f5 100644 --- a/api/resmap/reswrangler_test.go +++ b/api/resmap/reswrangler_test.go @@ -56,12 +56,14 @@ var origin2 = &resource.Origin{ } func doAppend(t *testing.T, w ResMap, r *resource.Resource) { + t.Helper() err := w.Append(r) if err != nil { t.Fatalf("append error: %v", err) } } func doRemove(t *testing.T, w ResMap, id resid.ResId) { + t.Helper() err := w.Remove(id) if err != nil { t.Fatalf("remove error: %v", err) @@ -116,7 +118,7 @@ func TestAppendRemove(t *testing.T) { doAppend(t, w2, makeCm(2)) doAppend(t, w2, makeCm(4)) doAppend(t, w2, makeCm(6)) - if !reflect.DeepEqual(w1, w1) { + if !reflect.DeepEqual(w1, w2) { w1.Debug("w1") w2.Debug("w2") t.Fatalf("mismatch") @@ -431,7 +433,6 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) { m := resmaptest_test.NewRmBuilder(t, rf). AddR(r1).AddR(r2).AddR(r3).AddR(r4).AddR(r5).ResMap() - // nolint:goconst tests := []struct { name string matcher IdMatcher diff --git a/api/resmap/selector_test.go b/api/resmap/selector_test.go index 922fb1c63..e31642e12 100644 --- a/api/resmap/selector_test.go +++ b/api/resmap/selector_test.go @@ -13,6 +13,7 @@ import ( ) func setupRMForPatchTargets(t *testing.T) ResMap { + t.Helper() result, err := rmF.NewResMapFromBytes([]byte(` apiVersion: group1/v1 kind: Kind1 diff --git a/api/resource/origin.go b/api/resource/origin.go index d5ac3a1a4..3f4cfe340 100644 --- a/api/resource/origin.go +++ b/api/resource/origin.go @@ -50,7 +50,7 @@ func (origin *Origin) Copy() Origin { // Append returns a copy of origin with a path appended to it func (origin *Origin) Append(path string) *Origin { originCopy := origin.Copy() - repoSpec, err := git.NewRepoSpecFromUrl(path) + repoSpec, err := git.NewRepoSpecFromURL(path) if err == nil { originCopy.Repo = repoSpec.Host + repoSpec.OrgRepo absPath := repoSpec.AbsPath() diff --git a/api/resource/resource.go b/api/resource/resource.go index faf882045..9997e408b 100644 --- a/api/resource/resource.go +++ b/api/resource/resource.go @@ -26,7 +26,6 @@ type Resource struct { refVarNames []string } -// nolint var BuildAnnotations = []string{ utils.BuildAnnotationPreviousKinds, utils.BuildAnnotationPreviousNames, diff --git a/api/testutils/filtertest/runfilter.go b/api/testutils/filtertest/runfilter.go index 95f8d26c3..9c6d308b3 100644 --- a/api/testutils/filtertest/runfilter.go +++ b/api/testutils/filtertest/runfilter.go @@ -32,6 +32,7 @@ func run(input string, f kio.Filter) (string, error) { // RunFilter runs filter and panic if there is error func RunFilter(t *testing.T, input string, f kio.Filter) string { + t.Helper() output, err := run(input, f) if !assert.NoError(t, err) { t.FailNow() @@ -41,6 +42,7 @@ func RunFilter(t *testing.T, input string, f kio.Filter) string { // RunFilterE runs filter and return error if there is func RunFilterE(t *testing.T, input string, f kio.Filter) (string, error) { + t.Helper() output, err := run(input, f) if err != nil { return "", err diff --git a/api/testutils/kusttest/harness.go b/api/testutils/kusttest/harness.go index 412502a50..c60a614a5 100644 --- a/api/testutils/kusttest/harness.go +++ b/api/testutils/kusttest/harness.go @@ -22,11 +22,13 @@ type Harness struct { } func MakeHarness(t *testing.T) Harness { + t.Helper() return MakeHarnessWithFs(t, filesys.MakeFsInMemory()) } func MakeHarnessWithFs( t *testing.T, fSys filesys.FileSystem) Harness { + t.Helper() return Harness{ t: t, fSys: fSys, diff --git a/api/testutils/kusttest/harnessenhanced.go b/api/testutils/kusttest/harnessenhanced.go index fa33f5db8..bf77155bb 100644 --- a/api/testutils/kusttest/harnessenhanced.go +++ b/api/testutils/kusttest/harnessenhanced.go @@ -47,6 +47,7 @@ type HarnessEnhanced struct { } func MakeEnhancedHarness(t *testing.T) *HarnessEnhanced { + t.Helper() r := makeBaseEnhancedHarness(t) r.Harness = MakeHarnessWithFs(t, filesys.MakeFsInMemory()) // Point the Harness's file loader to the root ('/') @@ -56,6 +57,7 @@ func MakeEnhancedHarness(t *testing.T) *HarnessEnhanced { } func MakeEnhancedHarnessWithTmpRoot(t *testing.T) *HarnessEnhanced { + t.Helper() r := makeBaseEnhancedHarness(t) fSys := filesys.MakeFsOnDisk() r.Harness = MakeHarnessWithFs(t, fSys) @@ -72,6 +74,7 @@ func MakeEnhancedHarnessWithTmpRoot(t *testing.T) *HarnessEnhanced { } func makeBaseEnhancedHarness(t *testing.T) *HarnessEnhanced { + t.Helper() rf := resmap.NewFactory( provider.NewDefaultDepProvider().GetResourceFactory()) return &HarnessEnhanced{ diff --git a/api/testutils/kusttest/hasgett.go b/api/testutils/kusttest/hasgett.go index 33496b9d2..822f99fde 100644 --- a/api/testutils/kusttest/hasgett.go +++ b/api/testutils/kusttest/hasgett.go @@ -26,6 +26,7 @@ func AssertActualEqualsExpectedWithTweak( t *testing.T, m resmap.ResMap, tweaker func([]byte) []byte, expected string) { + t.Helper() if m == nil { t.Fatalf("Map should not be nil.") } @@ -49,13 +50,14 @@ func AssertActualEqualsExpectedWithTweak( // Pretty printing of file differences. func reportDiffAndFail( t *testing.T, actual []byte, expected string) { + t.Helper() sE, maxLen := convertToArray(expected) sA, _ := convertToArray(string(actual)) fmt.Println("===== ACTUAL BEGIN ========================================") fmt.Print(string(actual)) fmt.Println("===== ACTUAL END ==========================================") format := fmt.Sprintf("%%s %%-%ds %%s\n", maxLen+4) - limit := 0 + var limit int if len(sE) < len(sA) { limit = len(sE) } else { diff --git a/api/testutils/kusttest/plugintestenv.go b/api/testutils/kusttest/plugintestenv.go index 0bc5bd183..460e57e4c 100644 --- a/api/testutils/kusttest/plugintestenv.go +++ b/api/testutils/kusttest/plugintestenv.go @@ -25,6 +25,7 @@ type pluginTestEnv struct { // newPluginTestEnv returns a new instance of pluginTestEnv. func newPluginTestEnv(t *testing.T) *pluginTestEnv { + t.Helper() return &pluginTestEnv{t: t} } diff --git a/api/testutils/resmaptest/rmbuilder.go b/api/testutils/resmaptest/rmbuilder.go index 5b725c3c4..1eea23b19 100644 --- a/api/testutils/resmaptest/rmbuilder.go +++ b/api/testutils/resmaptest/rmbuilder.go @@ -20,18 +20,22 @@ type rmBuilder struct { } func NewSeededRmBuilder(t *testing.T, rf *resource.Factory, m resmap.ResMap) *rmBuilder { + t.Helper() return &rmBuilder{t: t, rf: rf, m: m} } func NewRmBuilder(t *testing.T, rf *resource.Factory) *rmBuilder { + t.Helper() return NewSeededRmBuilder(t, rf, resmap.New()) } func NewRmBuilderDefault(t *testing.T) *rmBuilder { + t.Helper() return NewSeededRmBuilderDefault(t, resmap.New()) } func NewSeededRmBuilderDefault(t *testing.T, m resmap.ResMap) *rmBuilder { + t.Helper() return NewSeededRmBuilder( t, provider.NewDefaultDepProvider().GetResourceFactory(), m) } diff --git a/api/testutils/valtest/fakevalidator.go b/api/testutils/valtest/fakevalidator.go index 7e7daadfa..9da5a38ca 100644 --- a/api/testutils/valtest/fakevalidator.go +++ b/api/testutils/valtest/fakevalidator.go @@ -22,11 +22,13 @@ const SAD = "i'm not happy Bob, NOT HAPPY" // MakeHappyMapValidator makes a fakeValidator that always passes. func MakeHappyMapValidator(t *testing.T) *fakeValidator { + t.Helper() return &fakeValidator{happy: true, t: t} } // MakeSadMapValidator makes a fakeValidator that always fails. func MakeSadMapValidator(t *testing.T) *fakeValidator { + t.Helper() return &fakeValidator{happy: false, t: t} } diff --git a/api/types/helmchartargs.go b/api/types/helmchartargs.go index c0fff2457..05d540462 100644 --- a/api/types/helmchartargs.go +++ b/api/types/helmchartargs.go @@ -71,7 +71,7 @@ type HelmChart struct { // IncludeCRDs specifies if Helm should also generate CustomResourceDefinitions. // Defaults to 'false'. - IncludeCRDs bool `json:"includeCRDs,omitempty" yaml:"includeCRDs,omitempty"` + IncludeCRDs bool `json:"includeCRDs,omitempty" yaml:"includeCRDs,omitempty"` // nolint: tagliatelle } // HelmChartArgs contains arguments to helm. @@ -96,8 +96,8 @@ type HelmChartArgs struct { // per-chart params and global chart-independent parameters. func SplitHelmParameters( oldArgs []HelmChartArgs) (charts []HelmChart, globals HelmGlobals) { - for _, old := range oldArgs { - charts = append(charts, makeHelmChartFromHca(&old)) + for i, old := range oldArgs { + charts = append(charts, makeHelmChartFromHca(&oldArgs[i])) if old.HelmHome != "" { // last non-empty wins globals.ConfigHome = old.HelmHome diff --git a/api/types/kustomization.go b/api/types/kustomization.go index e7935d16f..c194dcc3c 100644 --- a/api/types/kustomization.go +++ b/api/types/kustomization.go @@ -192,14 +192,14 @@ func (k *Kustomization) FixKustomizationPostUnmarshalling() { for i, g := range k.ConfigMapGenerator { if g.EnvSource != "" { k.ConfigMapGenerator[i].EnvSources = - append(g.EnvSources, g.EnvSource) + append(g.EnvSources, g.EnvSource) //nolint:gocritic k.ConfigMapGenerator[i].EnvSource = "" } } for i, g := range k.SecretGenerator { if g.EnvSource != "" { k.SecretGenerator[i].EnvSources = - append(g.EnvSources, g.EnvSource) + append(g.EnvSources, g.EnvSource) //nolint:gocritic k.SecretGenerator[i].EnvSource = "" } } diff --git a/cmd/config/.golangci.yml b/cmd/config/.golangci.yml deleted file mode 100644 index fc4b84297..000000000 --- a/cmd/config/.golangci.yml +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 2019 The Kubernetes Authors. -# SPDX-License-Identifier: Apache-2.0 - -run: - deadline: 5m - -linters: - # please, do not use `enable-all`: it's deprecated and will be removed soon. - # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint - disable-all: true - enable: - - bodyclose - - deadcode - - depguard -# - dogsled - - dupl -# - errcheck -# - funlen -# - gochecknoinits -# - goconst -# - gocritic -# - gocyclo - - gofmt - - goimports -# - golint -# - gosec - - gosimple - - govet - - ineffassign - - interfacer -# - lll - - misspell - - nakedret -# - scopelint - - staticcheck - - structcheck -# - stylecheck - - typecheck - - unconvert -# - unparam - - unused - - varcheck -# - whitespace - - -linters-settings: - dupl: - threshold: 400 - lll: - line-length: 170 - gocyclo: - min-complexity: 30 - golint: - min-confidence: 0.85 diff --git a/cmd/config/Makefile b/cmd/config/Makefile index 774bf3e15..63f51539b 100644 --- a/cmd/config/Makefile +++ b/cmd/config/Makefile @@ -12,7 +12,7 @@ $(GOBIN)/addlicense: go get github.com/google/addlicense $(GOBIN)/golangci-lint: - go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.19.1 + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2 $(GOBIN)/k8scopy: ( cd ../k8scopy; go install . ) @@ -36,7 +36,9 @@ clean: lint: $(GOBIN)/golangci-lint $(GOBIN)/golangci-lint \ --skip-dirs $(k8sGenDir) \ - run ./... + run ./... \ + --path-prefix=cmd/config \ + -c ../../.golangci.yml license: $(GOBIN)/addlicense $(GOBIN)/addlicense \ diff --git a/cmd/config/go.sum b/cmd/config/go.sum index 11c19007c..f3a27df3a 100644 --- a/cmd/config/go.sum +++ b/cmd/config/go.sum @@ -611,8 +611,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/cmd/config/internal/commands/annotate.go b/cmd/config/internal/commands/annotate.go index dd25a9323..43da1eb92 100644 --- a/cmd/config/internal/commands/annotate.go +++ b/cmd/config/internal/commands/annotate.go @@ -142,7 +142,6 @@ func (r *AnnotateRunner) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) { return nil, err } } - } return nodes, nil } diff --git a/cmd/config/internal/commands/annotate_test.go b/cmd/config/internal/commands/annotate_test.go index 85ba1e62b..cbf20f11c 100644 --- a/cmd/config/internal/commands/annotate_test.go +++ b/cmd/config/internal/commands/annotate_test.go @@ -88,6 +88,7 @@ func TestAnnotateCommand(t *testing.T) { } func initTestDir(t *testing.T) string { + t.Helper() d, err := ioutil.TempDir("", "kustomize-annotate-test") if !assert.NoError(t, err) { t.FailNow() @@ -601,12 +602,12 @@ added annotations in the package } // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(actual.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(actual.String(), "\\", "/"), + "//", "/") - expected := strings.Replace(test.expected, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace(expected, "\\", "/", -1) + expected := strings.ReplaceAll(test.expected, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll(expected, "\\", "/") if !assert.Contains(t, actualNormalized, expectedNormalized) { t.FailNow() } diff --git a/cmd/config/internal/commands/cat.go b/cmd/config/internal/commands/cat.go index 53ccdc906..62e8f3d96 100644 --- a/cmd/config/internal/commands/cat.go +++ b/cmd/config/internal/commands/cat.go @@ -166,7 +166,6 @@ func (r *CatRunner) catFilters() []kio.Filter { return fltrs } -// nolint func (r *CatRunner) out(w io.Writer) ([]kio.Writer, error) { var outputs []kio.Writer var functionConfig *yaml.RNode diff --git a/cmd/config/internal/commands/cat_test.go b/cmd/config/internal/commands/cat_test.go index c9b1ec024..074e993ff 100644 --- a/cmd/config/internal/commands/cat_test.go +++ b/cmd/config/internal/commands/cat_test.go @@ -654,12 +654,12 @@ spec: } // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(actual.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(actual.String(), "\\", "/"), + "//", "/") - expected := strings.Replace(test.expected, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace(expected, "\\", "/", -1) + expected := strings.ReplaceAll(test.expected, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll(expected, "\\", "/") if !assert.Equal(t, expectedNormalized, actualNormalized) { t.FailNow() } diff --git a/cmd/config/internal/commands/cmdcreatesetter_test.go b/cmd/config/internal/commands/cmdcreatesetter_test.go index 6a0ffcd60..9777272c2 100644 --- a/cmd/config/internal/commands/cmdcreatesetter_test.go +++ b/cmd/config/internal/commands/cmdcreatesetter_test.go @@ -753,12 +753,12 @@ spec: t.FailNow() } - expectedOut := strings.Replace(test.out, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace(expectedOut, "\\", "/", -1) + expectedOut := strings.ReplaceAll(test.out, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll(expectedOut, "\\", "/") // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(out.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(out.String(), "\\", "/"), + "//", "/") if !assert.Contains(t, actualNormalized, expectedNormalized) { t.FailNow() @@ -863,12 +863,12 @@ setter with name "namespace" already exists, if you want to modify it, please de } // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(actual.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(actual.String(), "\\", "/"), + "//", "/") - expected := strings.Replace(test.expected, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace(expected, "\\", "/", -1) + expected := strings.ReplaceAll(test.expected, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll(expected, "\\", "/") if !assert.Contains(t, actualNormalized, expectedNormalized) { t.FailNow() } diff --git a/cmd/config/internal/commands/cmdcreatesubstitution_test.go b/cmd/config/internal/commands/cmdcreatesubstitution_test.go index 4d9c1f791..36a4d46bc 100644 --- a/cmd/config/internal/commands/cmdcreatesubstitution_test.go +++ b/cmd/config/internal/commands/cmdcreatesubstitution_test.go @@ -393,12 +393,12 @@ spec: t.FailNow() } - expectedOut := strings.Replace(test.out, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace(expectedOut, "\\", "/", -1) + expectedOut := strings.ReplaceAll(test.out, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll(expectedOut, "\\", "/") // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(out.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(out.String(), "\\", "/"), + "//", "/") if !assert.Contains(t, actualNormalized, expectedNormalized) { t.FailNow() @@ -500,12 +500,12 @@ created substitution "image-tag"`, } // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(actual.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(actual.String(), "\\", "/"), + "//", "/") - expected := strings.Replace(test.expected, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace(expected, "\\", "/", -1) + expected := strings.ReplaceAll(test.expected, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll(expected, "\\", "/") if !assert.Contains(t, strings.TrimSpace(actualNormalized), strings.TrimSpace(expectedNormalized)) { t.FailNow() } diff --git a/cmd/config/internal/commands/cmddeletesetter_test.go b/cmd/config/internal/commands/cmddeletesetter_test.go index 963a5c40c..3608b8514 100644 --- a/cmd/config/internal/commands/cmddeletesetter_test.go +++ b/cmd/config/internal/commands/cmddeletesetter_test.go @@ -340,12 +340,12 @@ kind: Deployment } // normalize path format for windows - actualNorm := strings.Replace( - strings.Replace(out.String(), "\\", "/", -1), - "//", "/", -1) + actualNorm := strings.ReplaceAll( + strings.ReplaceAll(out.String(), "\\", "/"), + "//", "/") - expectedOut := strings.Replace(test.out, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace(expectedOut, "\\", "/", -1) + expectedOut := strings.ReplaceAll(test.out, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll(expectedOut, "\\", "/") if !assert.Contains(t, strings.TrimSpace(actualNorm), expectedNormalized) { t.FailNow() @@ -427,7 +427,7 @@ deleted setter "namespace" t.FailNow() } copyutil.CopyDir(sourceDir, baseDir) - //defer os.RemoveAll(baseDir) + // defer os.RemoveAll(baseDir) runner := commands.NewDeleteSetterRunner("") actual := &bytes.Buffer{} runner.Command.SetOut(actual) @@ -438,12 +438,12 @@ deleted setter "namespace" } // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(actual.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(actual.String(), "\\", "/"), + "//", "/") - expected := strings.Replace(test.expected, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace(expected, "\\", "/", -1) + expected := strings.ReplaceAll(test.expected, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll(expected, "\\", "/") if !assert.Equal(t, expectedNormalized, actualNormalized) { t.FailNow() } diff --git a/cmd/config/internal/commands/cmddeletesubstitution_test.go b/cmd/config/internal/commands/cmddeletesubstitution_test.go index 063d64a10..ca968a723 100644 --- a/cmd/config/internal/commands/cmddeletesubstitution_test.go +++ b/cmd/config/internal/commands/cmddeletesubstitution_test.go @@ -467,11 +467,11 @@ spec: } // normalize path format for windows - actualNorm := strings.Replace( - strings.Replace(out.String(), "\\", "/", -1), - "//", "/", -1) - expectedOut := strings.Replace(test.out, "${baseDir}", baseDir, -1) - expectedNorm := strings.Replace(expectedOut, "\\", "/", -1) + actualNorm := strings.ReplaceAll( + strings.ReplaceAll(out.String(), "\\", "/"), + "//", "/") + expectedOut := strings.ReplaceAll(test.out, "${baseDir}", baseDir) + expectedNorm := strings.ReplaceAll(expectedOut, "\\", "/") if !assert.Contains(t, strings.TrimSpace(actualNorm), expectedNorm) { t.FailNow() @@ -544,7 +544,7 @@ deleted substitution "image-tag" t.FailNow() } copyutil.CopyDir(sourceDir, baseDir) - //defer os.RemoveAll(baseDir) + // defer os.RemoveAll(baseDir) runner := commands.NewDeleteSubstitutionRunner("") actual := &bytes.Buffer{} runner.Command.SetOut(actual) @@ -555,12 +555,12 @@ deleted substitution "image-tag" } // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(actual.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(actual.String(), "\\", "/"), + "//", "/") - expected := strings.Replace(test.expected, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace(expected, "\\", "/", -1) + expected := strings.ReplaceAll(test.expected, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll(expected, "\\", "/") if !assert.Equal(t, expectedNormalized, actualNormalized) { t.FailNow() } diff --git a/cmd/config/internal/commands/cmdlistsetters_test.go b/cmd/config/internal/commands/cmdlistsetters_test.go index 6248399d0..f37716ab4 100644 --- a/cmd/config/internal/commands/cmdlistsetters_test.go +++ b/cmd/config/internal/commands/cmdlistsetters_test.go @@ -523,7 +523,7 @@ test/testdata/dataset-with-setters/mysql/ } // normalize path format for windows - actualNormalized := strings.Replace(actual.String(), "\\", "/", -1) + actualNormalized := strings.ReplaceAll(actual.String(), "\\", "/") if !assert.Contains(t, strings.TrimSpace(actualNormalized), strings.TrimSpace(test.expected)) { t.FailNow() diff --git a/cmd/config/internal/commands/cmdset_test.go b/cmd/config/internal/commands/cmdset_test.go index 9548f76d6..031dc486e 100644 --- a/cmd/config/internal/commands/cmdset_test.go +++ b/cmd/config/internal/commands/cmdset_test.go @@ -1129,14 +1129,14 @@ set 1 field(s) of setter "namespace" to value "otherspace" } // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(actual.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(actual.String(), "\\", "/"), + "//", "/") - expected := strings.Replace(test.expected, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace( - strings.Replace(expected, "\\", "/", -1), - "//", "/", -1) + expected := strings.ReplaceAll(test.expected, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll( + strings.ReplaceAll(expected, "\\", "/"), + "//", "/") if !assert.Contains(t, strings.TrimSpace(actualNormalized), strings.TrimSpace(expectedNormalized)) { t.FailNow() } diff --git a/cmd/config/internal/commands/cmdxargs.go b/cmd/config/internal/commands/cmdxargs.go index 0c7daeec7..31d9a5f1d 100644 --- a/cmd/config/internal/commands/cmdxargs.go +++ b/cmd/config/internal/commands/cmdxargs.go @@ -106,7 +106,7 @@ func (r *XArgsRunner) runE(c *cobra.Command, _ []string) error { return fmt.Errorf("must specify -- before command") } r.Args = r.Args[cmdIndex:] - run := exec.Command(r.Args[0]) + run := exec.Command(r.Args[0]) // nolint: gosec if len(r.Args) > 1 { r.Args = r.Args[cmdIndex+1:] diff --git a/cmd/config/internal/commands/count_test.go b/cmd/config/internal/commands/count_test.go index c6d4a959b..4b598ea15 100644 --- a/cmd/config/internal/commands/count_test.go +++ b/cmd/config/internal/commands/count_test.go @@ -137,12 +137,12 @@ Deployment: 1 } // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(actual.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(actual.String(), "\\", "/"), + "//", "/") - expected := strings.Replace(test.expected, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace(expected, "\\", "/", -1) + expected := strings.ReplaceAll(test.expected, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll(expected, "\\", "/") if !assert.Equal(t, expectedNormalized, actualNormalized) { t.FailNow() } diff --git a/cmd/config/internal/commands/e2e/e2e_test.go b/cmd/config/internal/commands/e2e/e2e_test.go index 8a1f39354..c4778f96c 100644 --- a/cmd/config/internal/commands/e2e/e2e_test.go +++ b/cmd/config/internal/commands/e2e/e2e_test.go @@ -35,7 +35,7 @@ func TestRunE2e(t *testing.T) { name: "exec_function_no_args", args: func(d string) []string { return []string{ - "--enable-exec", "--exec-path", filepath.Join(d, "e2econtainerconfig"), + "--enable-exec", "--exec-path", filepath.Join(d, e2eConfigDir), } }, files: func(d string) map[string]string { @@ -720,7 +720,7 @@ metadata: } args := append([]string{"fn", "run", "."}, tt.args(binDir)...) - cmd := exec.Command(filepath.Join(binDir, kyamlBin), args...) + cmd := exec.Command(filepath.Join(binDir, kyamlBin), args...) // nolint: gosec cmd.Dir = dir var stdErr, stdOut bytes.Buffer cmd.Stdout = &stdOut @@ -751,6 +751,8 @@ metadata: var buildOnce sync.Once var binDir string +const e2eConfigDir = "e2econtainerconfig" + func build() string { // only build the binaries once buildOnce.Do(func() { @@ -760,7 +762,7 @@ func build() string { panic(err) } - build := exec.Command("go", "build", "-o", + build := exec.Command("go", "build", "-o", // nolint: gosec filepath.Join(binDir, e2econtainerconfigBin)) build.Dir = "e2econtainerconfig" build.Stdout = os.Stdout @@ -772,7 +774,7 @@ func build() string { panic(err) } - build = exec.Command("go", "build", "-o", filepath.Join(binDir, kyamlBin)) + build = exec.Command("go", "build", "-o", filepath.Join(binDir, kyamlBin)) // nolint: gosec build.Dir = filepath.Join("..", "..", "..", "kubectl-krm") build.Stdout = os.Stdout build.Stderr = os.Stderr @@ -786,7 +788,7 @@ func build() string { } build = exec.Command( "docker", "build", ".", "-t", "gcr.io/kustomize-functions/e2econtainerconfig") - build.Dir = "e2econtainerconfig" + build.Dir = e2eConfigDir build.Stdout = os.Stdout build.Stderr = os.Stderr err = build.Run() @@ -803,9 +805,9 @@ var ( kyamlBin string ) -func init() { +func init() { //nolint: gochecknoinits kyamlBin = "kubectl-krm" - e2econtainerconfigBin = "e2econtainerconfig" + e2econtainerconfigBin = e2eConfigDir if runtime.GOOS == "windows" { kyamlBin = "kubectl-krm.exe" diff --git a/cmd/config/internal/commands/e2e/test_util_test.go b/cmd/config/internal/commands/e2e/test_util_test.go index 6835c4a0c..1bf83c8f9 100644 --- a/cmd/config/internal/commands/e2e/test_util_test.go +++ b/cmd/config/internal/commands/e2e/test_util_test.go @@ -17,9 +17,13 @@ import ( ) func TestMain(m *testing.M) { - d := build() - defer os.RemoveAll(d) - os.Exit(m.Run()) + var code int + func() { + d := build() + defer os.RemoveAll(d) + code = m.Run() + }() + os.Exit(code) } type test struct { @@ -32,6 +36,7 @@ type test struct { } func runTests(t *testing.T, tests []test) { + t.Helper() dir := build() bin := filepath.Join(dir, kyamlBin) diff --git a/cmd/config/internal/commands/fmt.go b/cmd/config/internal/commands/fmt.go index 2ab3d4eb2..e658cf2b2 100644 --- a/cmd/config/internal/commands/fmt.go +++ b/cmd/config/internal/commands/fmt.go @@ -69,7 +69,6 @@ func (r *FmtRunner) preRunE(c *cobra.Command, args []string) error { } func (r *FmtRunner) runE(c *cobra.Command, args []string) error { - // format stdin if there are no args if len(args) == 0 { rw := &kio.ByteReadWriter{ diff --git a/cmd/config/internal/commands/fmt_test.go b/cmd/config/internal/commands/fmt_test.go index c0918ac4f..a3551a900 100644 --- a/cmd/config/internal/commands/fmt_test.go +++ b/cmd/config/internal/commands/fmt_test.go @@ -232,12 +232,12 @@ formatted resource files in the package } // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(actual.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(actual.String(), "\\", "/"), + "//", "/") - expected := strings.Replace(test.expected, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace(expected, "\\", "/", -1) + expected := strings.ReplaceAll(test.expected, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll(expected, "\\", "/") if !assert.Contains(t, strings.TrimSpace(actualNormalized), strings.TrimSpace(expectedNormalized)) { t.FailNow() } diff --git a/cmd/config/internal/commands/grep.go b/cmd/config/internal/commands/grep.go index 6333a280e..82846ac7b 100644 --- a/cmd/config/internal/commands/grep.go +++ b/cmd/config/internal/commands/grep.go @@ -73,19 +73,20 @@ func (r *GrepRunner) preRunE(c *cobra.Command, args []string) error { } var last []string - if strings.Contains(parts[len(parts)-1], ">=") { + switch { + case strings.Contains(parts[len(parts)-1], ">="): last = strings.Split(parts[len(parts)-1], ">=") r.MatchType = filters.GreaterThanEq - } else if strings.Contains(parts[len(parts)-1], "<=") { + case strings.Contains(parts[len(parts)-1], "<="): last = strings.Split(parts[len(parts)-1], "<=") r.MatchType = filters.LessThanEq - } else if strings.Contains(parts[len(parts)-1], ">") { + case strings.Contains(parts[len(parts)-1], ">"): last = strings.Split(parts[len(parts)-1], ">") r.MatchType = filters.GreaterThan - } else if strings.Contains(parts[len(parts)-1], "<") { + case strings.Contains(parts[len(parts)-1], "<"): last = strings.Split(parts[len(parts)-1], "<") r.MatchType = filters.LessThan - } else { + default: last = strings.Split(parts[len(parts)-1], "=") r.MatchType = filters.Regexp } @@ -99,7 +100,7 @@ func (r *GrepRunner) preRunE(c *cobra.Command, args []string) error { r.Value = last[1] } - r.Path = append(parts[:len(parts)-1], last[0]) + r.Path = append(parts[:len(parts)-1], last[0]) // nolint:gocritic return nil } @@ -136,7 +137,6 @@ func (r *GrepRunner) runE(c *cobra.Command, args []string) error { fmt.Fprintf(c.OutOrStdout(), "%s", res) return nil - } func (r *GrepRunner) ExecuteCmd(w io.Writer, pkgPath string) error { diff --git a/cmd/config/internal/commands/grep_test.go b/cmd/config/internal/commands/grep_test.go index 4667cc3e7..468fb0df4 100644 --- a/cmd/config/internal/commands/grep_test.go +++ b/cmd/config/internal/commands/grep_test.go @@ -416,12 +416,12 @@ spec: } // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(actual.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(actual.String(), "\\", "/"), + "//", "/") - expected := strings.Replace(test.expected, "${baseDir}", baseDir, -1) - expectedNormalized := strings.Replace(expected, "\\", "/", -1) + expected := strings.ReplaceAll(test.expected, "${baseDir}", baseDir) + expectedNormalized := strings.ReplaceAll(expected, "\\", "/") if !assert.Equal(t, expectedNormalized, actualNormalized) { t.FailNow() } diff --git a/cmd/config/internal/commands/merge3_test.go b/cmd/config/internal/commands/merge3_test.go index c23176f5b..bd8b9ea88 100644 --- a/cmd/config/internal/commands/merge3_test.go +++ b/cmd/config/internal/commands/merge3_test.go @@ -61,13 +61,13 @@ spec: return } - expected_dir, err := ioutil.TempDir("", "test-data-expected") - defer os.RemoveAll(expected_dir) + expectedDir, err := ioutil.TempDir("", "test-data-expected") + defer os.RemoveAll(expectedDir) if !assert.NoError(t, err) { return } - err = ioutil.WriteFile(filepath.Join(expected_dir, "java-deployment.resource.yaml"), []byte(`apiVersion: apps/v1 + err = ioutil.WriteFile(filepath.Join(expectedDir, "java-deployment.resource.yaml"), []byte(`apiVersion: apps/v1 kind: Deployment metadata: name: app @@ -111,13 +111,13 @@ spec: return } - updated_dir, err := ioutil.TempDir("", "test-data-updated") - defer os.RemoveAll(updated_dir) + updatedDir, err := ioutil.TempDir("", "test-data-updated") + defer os.RemoveAll(updatedDir) if !assert.NoError(t, err) { return } - err = ioutil.WriteFile(filepath.Join(updated_dir, "java-deployment.resource.yaml"), []byte(`apiVersion: apps/v1 + err = ioutil.WriteFile(filepath.Join(updatedDir, "java-deployment.resource.yaml"), []byte(`apiVersion: apps/v1 kind: Deployment metadata: name: app @@ -158,13 +158,13 @@ spec: return } - dest_dir, err := ioutil.TempDir("", "test-data-dest") - defer os.RemoveAll(dest_dir) + destDir, err := ioutil.TempDir("", "test-data-dest") + defer os.RemoveAll(destDir) if !assert.NoError(t, err) { return } - err = ioutil.WriteFile(filepath.Join(dest_dir, "java-deployment.resource.yaml"), []byte(`apiVersion: apps/v1 + err = ioutil.WriteFile(filepath.Join(destDir, "java-deployment.resource.yaml"), []byte(`apiVersion: apps/v1 kind: Deployment metadata: name: app @@ -212,15 +212,15 @@ spec: "--ancestor", datadir, "--from", - updated_dir, + updatedDir, "--to", - dest_dir, + destDir, }) if !assert.NoError(t, r.Command.Execute()) { return } - diffs, err := copyutil.Diff(dest_dir, expected_dir) + diffs, err := copyutil.Diff(destDir, expectedDir) if !assert.NoError(t, err) { t.FailNow() } diff --git a/cmd/config/internal/commands/run-fns.go b/cmd/config/internal/commands/run-fns.go index 481969fb7..ee9446881 100644 --- a/cmd/config/internal/commands/run-fns.go +++ b/cmd/config/internal/commands/run-fns.go @@ -47,7 +47,8 @@ func GetRunFnRunner(name string) *RunFnRunner { "run this image as a function instead of discovering them.") // NOTE: exec plugins execute arbitrary code -- never change the default value of this flag!!! r.Command.Flags().BoolVar( - &r.EnableExec, "enable-exec", false /*do not change!*/, "enable support for exec functions -- note: exec functions run arbitrary code -- do not use for untrusted configs!!! (Alpha)") + &r.EnableExec, "enable-exec", false, /*do not change!*/ + "enable support for exec functions -- note: exec functions run arbitrary code -- do not use for untrusted configs!!! (Alpha)") r.Command.Flags().StringVar( &r.ExecPath, "exec-path", "", "run an executable as a function. (Alpha)") r.Command.Flags().BoolVar( @@ -111,87 +112,47 @@ func (r *RunFnRunner) runE(c *cobra.Command, args []string) error { // getContainerFunctions parses the commandline flags and arguments into explicit // Functions to run. -func (r *RunFnRunner) getContainerFunctions(c *cobra.Command, dataItems []string) ( +func (r *RunFnRunner) getContainerFunctions(dataItems []string) ( []*yaml.RNode, error) { - if r.Image == "" && r.StarPath == "" && r.ExecPath == "" && r.StarURL == "" { return nil, nil } - var fn *yaml.RNode - var err error - - if r.Image != "" { - // create the function spec to set as an annotation - fn, err = yaml.Parse(`container: {}`) - if err != nil { - return nil, err - } - // TODO: add support network, volumes, etc based on flag values - err = fn.PipeE( - yaml.Lookup("container"), - yaml.SetField("image", yaml.NewScalarRNode(r.Image))) - if err != nil { - return nil, err - } - if r.Network { - n := &yaml.Node{ - Kind: yaml.ScalarNode, - Value: "true", - Tag: yaml.NodeTagBool, - } - err = fn.PipeE( - yaml.Lookup("container"), - yaml.SetField("network", yaml.NewRNode(n))) - if err != nil { - return nil, err - } - } - } else if r.EnableStar && (r.StarPath != "" || r.StarURL != "") { - // create the function spec to set as an annotation - fn, err = yaml.Parse(`starlark: {}`) - if err != nil { - return nil, err - } - - if r.StarPath != "" { - err = fn.PipeE( - yaml.Lookup("starlark"), - yaml.SetField("path", yaml.NewScalarRNode(r.StarPath))) - if err != nil { - return nil, err - } - } - if r.StarURL != "" { - err = fn.PipeE( - yaml.Lookup("starlark"), - yaml.SetField("url", yaml.NewScalarRNode(r.StarURL))) - if err != nil { - return nil, err - } - } - err = fn.PipeE( - yaml.Lookup("starlark"), - yaml.SetField("name", yaml.NewScalarRNode(r.StarName))) - if err != nil { - return nil, err - } - - } else if r.EnableExec && r.ExecPath != "" { - // create the function spec to set as an annotation - fn, err = yaml.Parse(`exec: {}`) - if err != nil { - return nil, err - } - - err = fn.PipeE( - yaml.Lookup("exec"), - yaml.SetField("path", yaml.NewScalarRNode(r.ExecPath))) - if err != nil { - return nil, err - } + res, err := buildFnConfigResource(dataItems) + if err != nil { + return nil, err } + // create the function spec to set as an annotation + var fnAnnotation *yaml.RNode + switch { + case r.Image != "": + fnAnnotation, err = fnAnnotationForImage(r.Image, r.Network) + case r.EnableStar && (r.StarPath != "" || r.StarURL != ""): + fnAnnotation, err = fnAnnotationForStar(r.StarPath, r.StarURL, r.StarName) + case r.EnableExec && r.ExecPath != "": + fnAnnotation, err = fnAnnotationForExec(r.ExecPath) + } + if err != nil { + return nil, err + } + + // set the function annotation on the function config, so that it is parsed by RunFns + value, err := fnAnnotation.String() + if err != nil { + return nil, errors.Wrap(err) + } + err = res.PipeE( + yaml.LookupCreate(yaml.MappingNode, "metadata", "annotations"), + yaml.SetField(runtimeutil.FunctionAnnotationKey, yaml.NewScalarRNode(value))) + if err != nil { + return nil, errors.Wrap(err) + } + + return []*yaml.RNode{res}, nil +} + +func buildFnConfigResource(dataItems []string) (*yaml.RNode, error) { // create the function config rc, err := yaml.Parse(` metadata: @@ -202,19 +163,6 @@ data: {} return nil, err } - // set the function annotation on the function config so it - // is parsed by RunFns - value, err := fn.String() - if err != nil { - return nil, err - } - err = rc.PipeE( - yaml.LookupCreate(yaml.MappingNode, "metadata", "annotations"), - yaml.SetField(runtimeutil.FunctionAnnotationKey, yaml.NewScalarRNode(value))) - if err != nil { - return nil, err - } - // default the function config kind to ConfigMap, this may be overridden var kind = "ConfigMap" var version = "v1" @@ -252,7 +200,81 @@ data: {} if err != nil { return nil, err } - return []*yaml.RNode{rc}, nil + return rc, nil +} + +func fnAnnotationForExec(path string) (*yaml.RNode, error) { + fn, err := yaml.Parse(`exec: {}`) + if err != nil { + return nil, errors.Wrap(err) + } + + err = fn.PipeE( + yaml.Lookup("exec"), + yaml.SetField("path", yaml.NewScalarRNode(path))) + if err != nil { + return nil, errors.Wrap(err) + } + return fn, nil +} + +func fnAnnotationForStar(path string, url string, name string) (*yaml.RNode, error) { + fn, err := yaml.Parse(`starlark: {}`) + if err != nil { + return nil, errors.Wrap(err) + } + + if path != "" { + err = fn.PipeE( + yaml.Lookup("starlark"), + yaml.SetField("path", yaml.NewScalarRNode(path))) + if err != nil { + return nil, errors.Wrap(err) + } + } + if url != "" { + err = fn.PipeE( + yaml.Lookup("starlark"), + yaml.SetField("url", yaml.NewScalarRNode(url))) + if err != nil { + return nil, errors.Wrap(err) + } + } + err = fn.PipeE( + yaml.Lookup("starlark"), + yaml.SetField("name", yaml.NewScalarRNode(name))) + if err != nil { + return nil, errors.Wrap(err) + } + return fn, nil +} + +func fnAnnotationForImage(image string, enableNetwork bool) (*yaml.RNode, error) { + fn, err := yaml.Parse(`container: {}`) + if err != nil { + return nil, errors.Wrap(err) + } + // TODO: add support network, volumes, etc based on flag values + err = fn.PipeE( + yaml.Lookup("container"), + yaml.SetField("image", yaml.NewScalarRNode(image))) + if err != nil { + return nil, errors.Wrap(err) + } + if enableNetwork { + n := &yaml.Node{ + Kind: yaml.ScalarNode, + Value: "true", + Tag: yaml.NodeTagBool, + } + err = fn.PipeE( + yaml.Lookup("container"), + yaml.SetField("network", yaml.NewRNode(n))) + if err != nil { + return nil, errors.Wrap(err) + } + } + return fn, nil } func toStorageMounts(mounts []string) []runtimeutil.StorageMount { @@ -286,7 +308,7 @@ func (r *RunFnRunner) preRunE(c *cobra.Command, args []string) error { return errors.Errorf("0 or 1 arguments supported, function arguments go after '--'") } - fns, err := r.getContainerFunctions(c, dataItems) + fns, err := r.getContainerFunctions(dataItems) if err != nil { return err } diff --git a/cmd/config/internal/commands/run_test.go b/cmd/config/internal/commands/run_test.go index 5a8ca8e26..72fbd6d08 100644 --- a/cmd/config/internal/commands/run_test.go +++ b/cmd/config/internal/commands/run_test.go @@ -412,7 +412,6 @@ apiVersion: v1 t.FailNow() } } - }) } } diff --git a/cmd/config/internal/commands/sink.go b/cmd/config/internal/commands/sink.go index 3efd381de..653c05302 100644 --- a/cmd/config/internal/commands/sink.go +++ b/cmd/config/internal/commands/sink.go @@ -46,7 +46,6 @@ See discussion in https://github.com/kubernetes-sigs/kustomize/issues/3953.`) return err } -// nolint func (r *SinkRunner) runE(c *cobra.Command, args []string) error { var outputs []kio.Writer if len(args) == 1 { diff --git a/cmd/config/internal/commands/source_test.go b/cmd/config/internal/commands/source_test.go index c7ad70d06..a74eb6601 100644 --- a/cmd/config/internal/commands/source_test.go +++ b/cmd/config/internal/commands/source_test.go @@ -202,8 +202,22 @@ func TestSourceCommandJSON(t *testing.T) { if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1 kind: ResourceList items: -- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo", "annotations": {"app": "nginx2", config.kubernetes.io/index: '0', config.kubernetes.io/path: 'f1.json', internal.config.kubernetes.io/index: '0', internal.config.kubernetes.io/path: 'f1.json'}}, "spec": {"replicas": 1}} -- {"apiVersion": "v1", "kind": "Abstraction", "metadata": {"name": "foo", "annotations": {"config.kubernetes.io/function": "container:\n image: gcr.io/example/reconciler:v1\n", "config.kubernetes.io/local-config": "true", config.kubernetes.io/index: '0', config.kubernetes.io/path: 'f2.json', internal.config.kubernetes.io/index: '0', internal.config.kubernetes.io/path: 'f2.json'}}, "spec": {"replicas": 3}} +- {"kind": "Deployment", `+ + `"metadata": {`+ + `"labels": {"app": "nginx2"}, `+ + `"name": "foo", `+ + `"annotations": {`+ + `"app": "nginx2", `+ + `config.kubernetes.io/index: '0', config.kubernetes.io/path: 'f1.json', internal.config.kubernetes.io/index: '0', internal.config.kubernetes.io/path: 'f1.json'}}, `+ + `"spec": {"replicas": 1}} +- {"apiVersion": "v1", "kind": "Abstraction", `+ + `"metadata": {`+ + `"name": "foo", `+ + `"annotations": {`+ + `"config.kubernetes.io/function": "container:\n image: gcr.io/example/reconciler:v1\n", `+ + `"config.kubernetes.io/local-config": "true", `+ + `config.kubernetes.io/index: '0', config.kubernetes.io/path: 'f2.json', internal.config.kubernetes.io/index: '0', internal.config.kubernetes.io/path: 'f2.json'}}, `+ + `"spec": {"replicas": 3}} `, b.String()) { return } @@ -312,7 +326,14 @@ func TestSourceCommandJSON_Stdin(t *testing.T) { if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1 kind: ResourceList items: -- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo", "annotations": {"app": "nginx2", config.kubernetes.io/index: '0', internal.config.kubernetes.io/index: '0'}}, "spec": {"replicas": 1}} +- {"kind": "Deployment", `+ + `"metadata": {`+ + `"labels": {"app": "nginx2"}, `+ + `"name": "foo", `+ + `"annotations": {`+ + `"app": "nginx2", `+ + `config.kubernetes.io/index: '0', internal.config.kubernetes.io/index: '0'}}, `+ + `"spec": {"replicas": 1}} `, out.String()) { return } diff --git a/cmd/config/runner/runner.go b/cmd/config/runner/runner.go index 38fe0ae11..6e4adb0e1 100644 --- a/cmd/config/runner/runner.go +++ b/cmd/config/runner/runner.go @@ -132,11 +132,11 @@ var StackOnError bool const cmdName = "kustomize fn" // FixDocs replaces instances of old with new in the docs for c -func FixDocs(new string, c *cobra.Command) { - c.Use = strings.ReplaceAll(c.Use, cmdName, new) - c.Short = strings.ReplaceAll(c.Short, cmdName, new) - c.Long = strings.ReplaceAll(c.Long, cmdName, new) - c.Example = strings.ReplaceAll(c.Example, cmdName, new) +func FixDocs(newStr string, c *cobra.Command) { + c.Use = strings.ReplaceAll(c.Use, cmdName, newStr) + c.Short = strings.ReplaceAll(c.Short, cmdName, newStr) + c.Long = strings.ReplaceAll(c.Long, cmdName, newStr) + c.Example = strings.ReplaceAll(c.Example, cmdName, newStr) } // containsString returns true if slice contains s diff --git a/cmd/config/runner/runner_test.go b/cmd/config/runner/runner_test.go index e1281bf65..6fd713b69 100644 --- a/cmd/config/runner/runner_test.go +++ b/cmd/config/runner/runner_test.go @@ -98,14 +98,14 @@ ${baseDir}/subpkg2/subpkg3/ } // normalize path format for windows - actualNormalized := strings.Replace( - strings.Replace(actual.String(), "\\", "/", -1), - "//", "/", -1) + actualNormalized := strings.ReplaceAll( + strings.ReplaceAll(actual.String(), "\\", "/"), + "//", "/") - expected := strings.Replace(test.expectedOut, "${baseDir}", dir+"/", -1) - expectedNormalized := strings.Replace( - strings.Replace(expected, "\\", "/", -1), - "//", "/", -1) + expected := strings.ReplaceAll(test.expectedOut, "${baseDir}", dir+"/") + expectedNormalized := strings.ReplaceAll( + strings.ReplaceAll(expected, "\\", "/"), + "//", "/") if !assert.Equal(t, expectedNormalized, actualNormalized) { t.FailNow() } @@ -141,27 +141,27 @@ func createTestDirStructure(dir string) error { if err != nil { return err } - err = ioutil.WriteFile(filepath.Join(dir, "subpkg1", "Krmfile"), []byte(""), 0777) + err = ioutil.WriteFile(filepath.Join(dir, "subpkg1", "Krmfile"), []byte(""), 0644) if err != nil { return err } - err = ioutil.WriteFile(filepath.Join(dir, "subpkg2", "Krmfile"), []byte(""), 0777) + err = ioutil.WriteFile(filepath.Join(dir, "subpkg2", "Krmfile"), []byte(""), 0644) if err != nil { return err } - err = ioutil.WriteFile(filepath.Join(dir, "subpkg2/subpkg3", "Krmfile"), []byte(""), 0777) + err = ioutil.WriteFile(filepath.Join(dir, "subpkg2/subpkg3", "Krmfile"), []byte(""), 0644) if err != nil { return err } - err = ioutil.WriteFile(filepath.Join(dir, "subpkg4", "error.txt"), []byte(""), 0777) + err = ioutil.WriteFile(filepath.Join(dir, "subpkg4", "error.txt"), []byte(""), 0644) if err != nil { return err } - err = ioutil.WriteFile(filepath.Join(dir, "subpkg4", "Krmfile"), []byte(""), 0777) + err = ioutil.WriteFile(filepath.Join(dir, "subpkg4", "Krmfile"), []byte(""), 0644) if err != nil { return err } - err = ioutil.WriteFile(filepath.Join(dir, "Krmfile"), []byte(""), 0777) + err = ioutil.WriteFile(filepath.Join(dir, "Krmfile"), []byte(""), 0644) if err != nil { return err } diff --git a/cmd/pluginator/go.sum b/cmd/pluginator/go.sum index 79d5094ef..03f8f3e1e 100644 --- a/cmd/pluginator/go.sum +++ b/cmd/pluginator/go.sum @@ -612,8 +612,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/cmd/pluginator/internal/krmfunction/converter.go b/cmd/pluginator/internal/krmfunction/converter.go index 4798e92d8..a10491dd0 100644 --- a/cmd/pluginator/internal/krmfunction/converter.go +++ b/cmd/pluginator/internal/krmfunction/converter.go @@ -105,7 +105,7 @@ func (c *Converter) prepareWrapper(content string) string { } // assign to plugin variable if strings.TrimSpace(line) == "var plugin resmap.Configurable" { - line = line + ` + line += ` // KustomizePlugin is a global variable defined in every plugin plugin = &KustomizePlugin ` diff --git a/cmd/pluginator/internal/krmfunction/converter_test.go b/cmd/pluginator/internal/krmfunction/converter_test.go index 4016e5550..6755a84dc 100644 --- a/cmd/pluginator/internal/krmfunction/converter_test.go +++ b/cmd/pluginator/internal/krmfunction/converter_test.go @@ -9,9 +9,11 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func makeTempDir(t *testing.T) string { + t.Helper() s, err := ioutil.TempDir("", "pluginator-*") assert.NoError(t, err) return s @@ -99,6 +101,7 @@ items: } func runKrmFunction(t *testing.T, input []byte, dir string) []byte { + t.Helper() cmd := exec.Command("go", "run", ".") ib := bytes.NewReader(input) cmd.Stdin = ib @@ -118,13 +121,14 @@ func TestTransformerConverter(t *testing.T) { dir := makeTempDir(t) defer os.RemoveAll(dir) - ioutil.WriteFile(filepath.Join(dir, "Plugin.go"), + err := ioutil.WriteFile(filepath.Join(dir, "Plugin.go"), getTransformerCode(), 0644) + require.NoError(t, err) c := NewConverter(filepath.Join(dir, "output"), filepath.Join(dir, "Plugin.go")) - err := c.Convert() + err = c.Convert() assert.NoError(t, err) output := runKrmFunction(t, getTransformerInputResource(), filepath.Join(dir, "output")) @@ -215,13 +219,14 @@ func TestGeneratorConverter(t *testing.T) { dir := makeTempDir(t) defer os.RemoveAll(dir) - ioutil.WriteFile(filepath.Join(dir, "Plugin.go"), + err := ioutil.WriteFile(filepath.Join(dir, "Plugin.go"), getGeneratorCode(), 0644) + require.NoError(t, err) c := NewConverter(filepath.Join(dir, "output"), filepath.Join(dir, "Plugin.go")) - err := c.Convert() + err = c.Convert() assert.NoError(t, err) output := runKrmFunction(t, getGeneratorInputResource(), filepath.Join(dir, "output")) assert.Equal(t, `apiVersion: config.kubernetes.io/v1 diff --git a/cmd/pluginator/internal/krmfunction/funcwrappersrc/fakeplugin.go b/cmd/pluginator/internal/krmfunction/funcwrappersrc/fakeplugin.go index b5a5426d8..1f3d9e7a2 100644 --- a/cmd/pluginator/internal/krmfunction/funcwrappersrc/fakeplugin.go +++ b/cmd/pluginator/internal/krmfunction/funcwrappersrc/fakeplugin.go @@ -1,4 +1,3 @@ -//nolint package funcwrappersrc import ( diff --git a/hack/testExamplesAgainstKustomize.sh b/hack/testExamplesAgainstKustomize.sh index 1a447ee41..f1a85ad90 100755 --- a/hack/testExamplesAgainstKustomize.sh +++ b/hack/testExamplesAgainstKustomize.sh @@ -22,7 +22,7 @@ rm -f $MYGOBIN/kustomize if [ "$version" == "HEAD" ]; then (cd kustomize; go install .) else - GO111MODULE=on go get sigs.k8s.io/kustomize/kustomize/${version} + GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/${version} fi # TODO: change the label? diff --git a/kustomize/commands/build/build_test.go b/kustomize/commands/build/build_test.go index ef90f2cd7..caf89c3fa 100644 --- a/kustomize/commands/build/build_test.go +++ b/kustomize/commands/build/build_test.go @@ -243,10 +243,8 @@ func TestValidation(t *testing.T) { t.Errorf("%s: Expected error %s, but got %v", n, tc.erMsg, err) } - } else { - if err != nil { - t.Errorf("%s: unknown error: %v", n, err) - } + } else if err != nil { + t.Errorf("%s: unknown error: %v", n, err) } }) } diff --git a/kustomize/commands/create/create_test.go b/kustomize/commands/create/create_test.go index 3d0624f74..7d869f4b7 100644 --- a/kustomize/commands/create/create_test.go +++ b/kustomize/commands/create/create_test.go @@ -16,6 +16,7 @@ import ( var factory = provider.NewDefaultDepProvider().GetResourceFactory() func readKustomizationFS(t *testing.T, fSys filesys.FileSystem) *types.Kustomization { + t.Helper() kf, err := kustfile.NewKustomizationFile(fSys) if err != nil { t.Errorf("unexpected new error %v", err) diff --git a/kustomize/commands/edit/add/addbase.go b/kustomize/commands/edit/add/addbase.go index 4f8b433d5..d5835813a 100644 --- a/kustomize/commands/edit/add/addbase.go +++ b/kustomize/commands/edit/add/addbase.go @@ -68,7 +68,6 @@ func (o *addBaseOptions) RunAddBase(fSys filesys.FileSystem) error { return fmt.Errorf("base %s already in kustomization file", path) } m.Resources = append(m.Resources, path) - } return mf.Write(m) diff --git a/kustomize/commands/edit/add/addmetadata_test.go b/kustomize/commands/edit/add/addmetadata_test.go index c3c5ca55c..2c2c7980a 100644 --- a/kustomize/commands/edit/add/addmetadata_test.go +++ b/kustomize/commands/edit/add/addmetadata_test.go @@ -16,6 +16,7 @@ import ( ) func makeKustomization(t *testing.T) *types.Kustomization { + t.Helper() fSys := filesys.MakeFsInMemory() testutils_test.WriteTestKustomization(fSys) kf, err := kustfile.NewKustomizationFile(fSys) diff --git a/kustomize/commands/edit/fix/convert.go b/kustomize/commands/edit/fix/convert.go index b0c8de0f0..43aeadf17 100644 --- a/kustomize/commands/edit/fix/convert.go +++ b/kustomize/commands/edit/fix/convert.go @@ -78,11 +78,9 @@ func filesTouchedByKustomize(k *types.Kustomization, filepath string, fSys files } result = append(result, paths...) } - } // read the resource as a file result = append(result, path.Join(filepath, r)) - } // aggregate all of the paths from the `patches` field @@ -149,7 +147,6 @@ func findVarName(node *kyaml.RNode, varName string, path []string) ([]string, [] var options []*types.FieldOptions switch node.YNode().Kind { - case kyaml.SequenceNode: elements, err := node.Elements() if err != nil { @@ -237,7 +234,6 @@ func constructFieldOptions(value string, varString string) ([]*types.FieldOption func constructTargets(file string, node *kyaml.RNode, fieldPaths []string, options []*types.FieldOptions) ([]*types.TargetSelector, error) { - if len(fieldPaths) != len(options) { // this should never happen return nil, fmt.Errorf("internal error: length of fieldPaths != length of fieldOptions") @@ -287,7 +283,6 @@ func constructTargets(file string, node *kyaml.RNode, fieldPaths []string, // resources may have different IDs than the patch func writePatchTargets(patch types.Patch, node *kyaml.RNode, fieldPaths []string, options []*types.FieldOptions) ([]*types.TargetSelector, error) { - var result []*types.TargetSelector selector := patch.Target.Copy() diff --git a/kustomize/commands/edit/fix/fix.go b/kustomize/commands/edit/fix/fix.go index fd547b5ad..eb1e260fb 100644 --- a/kustomize/commands/edit/fix/fix.go +++ b/kustomize/commands/edit/fix/fix.go @@ -70,7 +70,6 @@ Fixed fields: patchesJson6902 -> patches commonLabels -> labels vars -> replacements`) - } else { fmt.Fprintln(w, ` Fixed fields: diff --git a/kustomize/commands/edit/remove/removemetadata_test.go b/kustomize/commands/edit/remove/removemetadata_test.go index 54ad78fff..53afe6129 100644 --- a/kustomize/commands/edit/remove/removemetadata_test.go +++ b/kustomize/commands/edit/remove/removemetadata_test.go @@ -27,6 +27,7 @@ func makeKustomizationFS() filesys.FileSystem { } func readKustomizationFS(t *testing.T, fSys filesys.FileSystem) *types.Kustomization { + t.Helper() kf, err := kustfile.NewKustomizationFile(fSys) if err != nil { t.Errorf("unexpected new error %v", err) @@ -39,6 +40,7 @@ func readKustomizationFS(t *testing.T, fSys filesys.FileSystem) *types.Kustomiza } func makeKustomization(t *testing.T) *types.Kustomization { + t.Helper() fSys := makeKustomizationFS() return readKustomizationFS(t, fSys) } diff --git a/kustomize/commands/edit/remove/removeresource.go b/kustomize/commands/edit/remove/removeresource.go index ae04657bc..4a85356ef 100644 --- a/kustomize/commands/edit/remove/removeresource.go +++ b/kustomize/commands/edit/remove/removeresource.go @@ -52,7 +52,6 @@ func (o *removeResourceOptions) Validate(args []string) error { // RunRemoveResource runs Resource command (do real work). func (o *removeResourceOptions) RunRemoveResource(fSys filesys.FileSystem) error { - mf, err := kustfile.NewKustomizationFile(fSys) if err != nil { return err diff --git a/kustomize/commands/edit/remove_test/removetest.go b/kustomize/commands/edit/remove_test/removetest.go index 2fdced459..062ee8745 100644 --- a/kustomize/commands/edit/remove_test/removetest.go +++ b/kustomize/commands/edit/remove_test/removetest.go @@ -43,6 +43,7 @@ type Case struct { // collection Name (e.g. transformers or resources) and newRemoveCmdToTest function. func ExecuteTestCases(t *testing.T, testCases []Case, collectionName string, newRemoveCmdToTest func(filesys.FileSystem) *cobra.Command) { + t.Helper() for _, tc := range testCases { t.Run(tc.Description, func(t *testing.T) { fSys := filesys.MakeFsInMemory() diff --git a/kustomize/commands/edit/set/setannotation_test.go b/kustomize/commands/edit/set/setannotation_test.go index a109301fb..9b1a5d06f 100644 --- a/kustomize/commands/edit/set/setannotation_test.go +++ b/kustomize/commands/edit/set/setannotation_test.go @@ -17,6 +17,7 @@ const invalidAnnotationKey string = "invalid annotation key: see the syntax and "https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/" func makeAnnotationKustomization(t *testing.T) *types.Kustomization { + t.Helper() fSys := filesys.MakeFsInMemory() testutils_test.WriteTestKustomization(fSys) kf, err := kustfile.NewKustomizationFile(fSys) diff --git a/kustomize/commands/edit/set/setimage.go b/kustomize/commands/edit/set/setimage.go index 94f02f57c..e68d7b191 100644 --- a/kustomize/commands/edit/set/setimage.go +++ b/kustomize/commands/edit/set/setimage.go @@ -105,7 +105,6 @@ func (o *setImageOptions) Validate(args []string) error { o.imageMap = make(map[string]types.Image) for _, arg := range args { - img, err := parse(arg) if err != nil { return err @@ -129,7 +128,6 @@ func (o *setImageOptions) RunSetImage(fSys filesys.FileSystem) error { // append only new images from kustomize file for _, im := range m.Images { if argIm, ok := o.imageMap[im.Name]; ok { - // Reuse the existing new name when asterisk new name is passed if argIm.NewName == preserveSeparator { argIm = replaceNewName(argIm, im.NewName) @@ -155,7 +153,6 @@ func (o *setImageOptions) RunSetImage(fSys filesys.FileSystem) error { var images []types.Image for _, v := range o.imageMap { - if v.NewName == preserveSeparator { v = replaceNewName(v, "") } @@ -207,7 +204,6 @@ func replaceDigest(image types.Image, digest string) types.Image { } func parse(arg string) (types.Image, error) { - // matches if there is an image name to overwrite // =<:|@> if s := strings.Split(arg, separator); len(s) == 2 { diff --git a/kustomize/commands/edit/set/setlabel_test.go b/kustomize/commands/edit/set/setlabel_test.go index 749dccf30..1c755b3cf 100644 --- a/kustomize/commands/edit/set/setlabel_test.go +++ b/kustomize/commands/edit/set/setlabel_test.go @@ -14,6 +14,7 @@ import ( ) func makeKustomization(t *testing.T) *types.Kustomization { + t.Helper() fSys := filesys.MakeFsInMemory() testutils_test.WriteTestKustomization(fSys) kf, err := kustfile.NewKustomizationFile(fSys) diff --git a/kustomize/commands/edit/set/setreplicas.go b/kustomize/commands/edit/set/setreplicas.go index ab32900aa..695f19ad2 100644 --- a/kustomize/commands/edit/set/setreplicas.go +++ b/kustomize/commands/edit/set/setreplicas.go @@ -69,7 +69,6 @@ func (o *setReplicasOptions) Validate(args []string) error { o.replicasMap = make(map[string]types.Replica) for _, arg := range args { - replica, err := parseReplicasArg(arg) if err != nil { return err @@ -113,7 +112,6 @@ func (o *setReplicasOptions) RunSetReplicas(fSys filesys.FileSystem) error { } func parseReplicasArg(arg string) (types.Replica, error) { - // matches a name and a replica count // = if s := strings.Split(arg, replicasSeparator); len(s) == 2 { diff --git a/kustomize/commands/internal/kustfile/kustomizationfile.go b/kustomize/commands/internal/kustfile/kustomizationfile.go index 3d569cee1..967e8312f 100644 --- a/kustomize/commands/internal/kustfile/kustomizationfile.go +++ b/kustomize/commands/internal/kustfile/kustomizationfile.go @@ -11,8 +11,9 @@ import ( "log" "reflect" "regexp" - "strings" + "golang.org/x/text/cases" + "golang.org/x/text/language" "sigs.k8s.io/kustomize/api/konfig" "sigs.k8s.io/kustomize/api/types" "sigs.k8s.io/kustomize/kyaml/filesys" @@ -116,7 +117,7 @@ type kustomizationFile struct { } // NewKustomizationFile returns a new instance. -func NewKustomizationFile(fSys filesys.FileSystem) (*kustomizationFile, error) { // nolint +func NewKustomizationFile(fSys filesys.FileSystem) (*kustomizationFile, error) { mf := &kustomizationFile{fSys: fSys} err := mf.validate() if err != nil { @@ -291,7 +292,8 @@ func findMatchedField(line []byte) (bool, string) { // an empty []byte is returned. func marshalField(field string, kustomization *types.Kustomization) ([]byte, error) { r := reflect.ValueOf(*kustomization) - v := r.FieldByName(strings.Title(field)) + titleCaser := cases.Title(language.English, cases.NoLower) + v := r.FieldByName(titleCaser.String(field)) if !v.IsValid() || isEmpty(v) { return []byte{}, nil @@ -299,7 +301,7 @@ func marshalField(field string, kustomization *types.Kustomization) ([]byte, err k := &types.Kustomization{} kr := reflect.ValueOf(k) - kv := kr.Elem().FieldByName(strings.Title(field)) + kv := kr.Elem().FieldByName(titleCaser.String(field)) kv.Set(v) return yaml.Marshal(k) diff --git a/kustomize/commands/internal/util/util.go b/kustomize/commands/internal/util/util.go index 943c4d4d6..c084909cd 100644 --- a/kustomize/commands/internal/util/util.go +++ b/kustomize/commands/internal/util/util.go @@ -72,13 +72,14 @@ func ConvertSliceToMap(inputs []string, kind string) (map[string]string, error) result := make(map[string]string) for _, input := range inputs { c := strings.Index(input, ":") - if c == 0 { + switch { + case c == 0: // key is not passed return nil, fmt.Errorf("invalid %s: '%s' (%s)", kind, input, "need k:v pair where v may be quoted") - } else if c < 0 { + case c < 0: // only key passed result[input] = "" - } else { + default: // both key and value passed key := input[:c] value := trimQuotes(input[c+1:]) diff --git a/kustomize/commands/openapi/openapi.go b/kustomize/commands/openapi/openapi.go index 84e9b9626..4fdcad882 100644 --- a/kustomize/commands/openapi/openapi.go +++ b/kustomize/commands/openapi/openapi.go @@ -13,7 +13,6 @@ import ( // NewCmdOpenAPI makes a new openapi command. func NewCmdOpenAPI(w io.Writer) *cobra.Command { - openApiCmd := &cobra.Command{ Use: "openapi", Short: "Commands for interacting with the OpenAPI data", diff --git a/kustomize/go.mod b/kustomize/go.mod index c58248aae..8f580c17b 100644 --- a/kustomize/go.mod +++ b/kustomize/go.mod @@ -8,6 +8,7 @@ require ( github.com/spf13/cobra v1.4.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.7.0 + golang.org/x/text v0.3.7 sigs.k8s.io/kustomize/api v0.11.4 sigs.k8s.io/kustomize/cmd/config v0.10.6 sigs.k8s.io/kustomize/kyaml v0.13.6 diff --git a/kustomize/go.sum b/kustomize/go.sum index 8497bec71..9cc0094ec 100644 --- a/kustomize/go.sum +++ b/kustomize/go.sum @@ -621,8 +621,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/kyaml/.golangci.yml b/kyaml/.golangci.yml deleted file mode 100644 index cd3cee6d4..000000000 --- a/kyaml/.golangci.yml +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2019 The Kubernetes Authors. -# SPDX-License-Identifier: Apache-2.0 - -run: - deadline: 5m - skip-dirs: - - yaml/internal/k8sgen/pkg - -linters: - # please, do not use `enable-all`: it's deprecated and will be removed soon. - # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint - disable-all: true - enable: - - bodyclose - - deadcode - - depguard - # - dogsled # uncomment after upgrading golangci-lint (Issue #3663) - - dupl - - errcheck - - gochecknoinits - - goconst - - gocritic - - gocyclo - - gofmt - - goimports - - golint -# - gosec - - gosimple - - govet - - ineffassign - - interfacer - - lll - - misspell - - nakedret - - scopelint - - staticcheck - - structcheck - - stylecheck - - typecheck - - unconvert - - unparam - - unused - - varcheck - # - whitespace # uncomment after upgrading golangci-lint (Issue #3663) - - -linters-settings: - dupl: - threshold: 400 - lll: - line-length: 170 - gocyclo: - min-complexity: 30 - golint: - min-confidence: 0.85 diff --git a/kyaml/Makefile b/kyaml/Makefile index 3dca1442f..825abb9fa 100644 --- a/kyaml/Makefile +++ b/kyaml/Makefile @@ -12,11 +12,8 @@ export PATH := $(MYGOBIN):$(PATH) $(MYGOBIN)/addlicense: go get github.com/google/addlicense -# TODO: Issue #3663 -# Update this version of golangci-lint -# Ideally use same version as in {REPO}/hack/go.mod $(MYGOBIN)/golangci-lint: - go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.17.0 + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2 $(MYGOBIN)/k8scopy: ( cd ../cmd/k8scopy; go install . ) @@ -24,7 +21,7 @@ $(MYGOBIN)/k8scopy: $(MYGOBIN)/stringer: go get golang.org/x/tools/cmd/stringer -all: license fix vet fmt test tidy +all: license fix vet fmt test lint tidy k8sGenDir := yaml/internal/k8sgen/pkg @@ -36,7 +33,11 @@ clean: lint: $(MYGOBIN)/golangci-lint $(MYGOBIN)/golangci-lint \ - run ./... + run ./... \ + --path-prefix=kyaml \ + -c ../.golangci.yml \ + --skip-dirs yaml/internal/k8sgen/pkg \ + --skip-dirs internal/forked license: $(MYGOBIN)/addlicense diff --git a/kyaml/copyutil/copyutil.go b/kyaml/copyutil/copyutil.go index 3b7d01784..e66ec6911 100644 --- a/kyaml/copyutil/copyutil.go +++ b/kyaml/copyutil/copyutil.go @@ -188,8 +188,7 @@ func SyncFile(src, dst string) error { // deleteFile deletes file from path, returns no error if file doesn't exist func deleteFile(path string) error { - _, err := os.Stat(path) - if err != nil { + if _, err := os.Stat(path); err != nil { // return nil if file doesn't exist return nil } diff --git a/kyaml/filesys/confirmeddir_test.go b/kyaml/filesys/confirmeddir_test.go index bcdb817c3..fdc9ae90a 100644 --- a/kyaml/filesys/confirmeddir_test.go +++ b/kyaml/filesys/confirmeddir_test.go @@ -14,8 +14,7 @@ import ( func TestJoin(t *testing.T) { fSys := MakeFsInMemory() - err := fSys.Mkdir("/foo") - if err != nil { + if err := fSys.Mkdir("/foo"); err != nil { t.Fatalf("unexpected err: %v", err) } d, f, err := fSys.CleanedAbs("/foo") diff --git a/kyaml/filesys/filesystem_test.go b/kyaml/filesys/filesystem_test.go index 9599e6c45..a84943c96 100644 --- a/kyaml/filesys/filesystem_test.go +++ b/kyaml/filesys/filesystem_test.go @@ -26,6 +26,7 @@ func TestNotExistErr(t *testing.T) { } func testNotExistErr(t *testing.T, fs FileSystem) { + t.Helper() const path = "bad-dir/file.txt" err := fs.RemoveAll(path) diff --git a/kyaml/filesys/fsnode.go b/kyaml/filesys/fsnode.go index 983815fa9..7b84b5118 100644 --- a/kyaml/filesys/fsnode.go +++ b/kyaml/filesys/fsnode.go @@ -163,7 +163,6 @@ func (n *fsNode) AddFile( } func (n *fsNode) addDir(path string) (result *fsNode, err error) { - parent := n dName, subDirName := mySplit(path) if dName != "" { diff --git a/kyaml/filesys/fsnode_test.go b/kyaml/filesys/fsnode_test.go index 27751f302..b880f1bce 100644 --- a/kyaml/filesys/fsnode_test.go +++ b/kyaml/filesys/fsnode_test.go @@ -93,10 +93,10 @@ func TestMakeFsInMemory(t *testing.T) { t, "MakeFsInMemory", true, topCases, MakeFsInMemory()) } -//nolint:gocyclo func runBasicOperations( t *testing.T, tName string, isFSysRooted bool, cases []pathCase, fSys FileSystem) { + t.Helper() for _, c := range cases { err := fSys.WriteFile(c.arg, []byte(content)) if c.errStr != "" { @@ -371,6 +371,7 @@ func TestAddFile(t *testing.T) { func checkNode( t *testing.T, what string, f *fsNode, name string, size int, isDir bool, path string) { + t.Helper() if f.isNodeADir() != isDir { t.Fatalf("%s; unexpected isNodeADir = %v", what, f.isNodeADir()) } @@ -388,6 +389,7 @@ func checkNode( func checkOsStat( t *testing.T, what string, f File, name string, size int, isDir bool) { + t.Helper() info, err := f.Stat() if err != nil { t.Fatalf("%s; unexpected stat error %v", what, err) @@ -449,10 +451,10 @@ var bunchOfFiles = []struct { addAsDir: true, }, { - path: filepath.Join("x"), + path: "x", }, { - path: filepath.Join("y"), + path: "y", }, { path: filepath.Join("b", "d", "a", "c", "i", "beans"), @@ -474,6 +476,7 @@ var bunchOfFiles = []struct { } func makeLoadedFileTree(t *testing.T) *fsNode { + t.Helper() n := MakeEmptyDirInMemory() var err error expectedFileCount := 0 @@ -488,8 +491,7 @@ func makeLoadedFileTree(t *testing.T) *fsNode { t.Fatalf("unexpected error %v", err) } } - fc := n.FileCount() - if fc != expectedFileCount { + if fc := n.FileCount(); fc != expectedFileCount { t.Fatalf("expected file count %d, got %d", expectedFileCount, fc) } @@ -559,15 +561,14 @@ func TestRemove(t *testing.T) { orgCount -= 3 // Now drop one more for a total of four dropped. - result, _ = n.Find(filepath.Join("y")) + result, _ = n.Find("y") err = result.Remove() if err != nil { t.Fatalf("%s; unable to remove: %v", path, err) } orgCount -= 1 - fc := n.FileCount() - if fc != orgCount { + if fc := n.FileCount(); fc != orgCount { t.Fatalf("expected file count %d, got %d", orgCount, fc) } @@ -692,7 +693,7 @@ func TestFind(t *testing.T) { }, { what: "directory", - arg: filepath.Join("b"), + arg: "b", expectDir: true, }, { @@ -869,7 +870,7 @@ func TestFileOps(t *testing.T) { defer f.Close() for { - buf := make([]byte, rand.Intn(10)) + buf := make([]byte, rand.Intn(10)) // nolint:gosec n, err := f.Read(buf) if err != nil && err != io.EOF { t.Fatalf("unexpected error: %v", err) diff --git a/kyaml/filesys/fsondisk.go b/kyaml/filesys/fsondisk.go index 7fd02a255..4808f8d2e 100644 --- a/kyaml/filesys/fsondisk.go +++ b/kyaml/filesys/fsondisk.go @@ -9,6 +9,8 @@ import ( "log" "os" "path/filepath" + + "sigs.k8s.io/kustomize/kyaml/errors" ) var _ FileSystem = fsOnDisk{} @@ -128,7 +130,7 @@ func (fsOnDisk) ReadFile(name string) ([]byte, error) { return ioutil.ReadFile(n // WriteFile delegates to ioutil.WriteFile with read/write permissions. func (fsOnDisk) WriteFile(name string, c []byte) error { - return ioutil.WriteFile(name, c, 0666) + return errors.Wrap(ioutil.WriteFile(name, c, 0666)) //nolint:gosec } // Walk delegates to filepath.Walk. diff --git a/kyaml/filesys/fsondisk_test.go b/kyaml/filesys/fsondisk_test.go index 8de95f7ea..80a9cba01 100644 --- a/kyaml/filesys/fsondisk_test.go +++ b/kyaml/filesys/fsondisk_test.go @@ -17,6 +17,7 @@ import ( ) func makeTestDir(t *testing.T) (FileSystem, string) { + t.Helper() fSys := MakeFsOnDisk() td, err := ioutil.TempDir("", "kustomize_testing_dir") if err != nil { @@ -194,8 +195,8 @@ func TestReadFilesRealFS(t *testing.T) { "file-1.xtn", }, expectedDirs: map[string][]string{ - testDir: []string{dir}, - dir: []string{nestedDir}, + testDir: {dir}, + dir: {nestedDir}, }, }, "AllHiddenFiles": { @@ -206,7 +207,7 @@ func TestReadFilesRealFS(t *testing.T) { ".some-file-4.xtn", }, expectedDirs: map[string][]string{ - testDir: []string{hiddenDir}, + testDir: {hiddenDir}, }, }, "foo_File": { diff --git a/kyaml/filesys/util.go b/kyaml/filesys/util.go index 4d8958a2b..fdbe5e2c7 100644 --- a/kyaml/filesys/util.go +++ b/kyaml/filesys/util.go @@ -121,7 +121,7 @@ func InsertPathPart(path string, pos int, part string) string { result := make([]string, len(parts)+1) copy(result, parts[0:pos]) result[pos] = part - return PathJoin(append(result, parts[pos:]...)) + return PathJoin(append(result, parts[pos:]...)) // nolint: makezero } func IsHiddenFilePath(pattern string) bool { diff --git a/kyaml/filesys/util_test.go b/kyaml/filesys/util_test.go index da8d3f6bc..24c08cfb5 100644 --- a/kyaml/filesys/util_test.go +++ b/kyaml/filesys/util_test.go @@ -159,6 +159,7 @@ func TestPathSplitAndJoin(t *testing.T) { } for n, c := range cases { f := func(t *testing.T, original string, expected []string) { + t.Helper() actual := PathSplit(original) if len(actual) != len(expected) { t.Fatalf( diff --git a/kyaml/fn/framework/frameworktestutil/frameworktestutil.go b/kyaml/fn/framework/frameworktestutil/frameworktestutil.go index df1b161f1..8a6ec6c49 100644 --- a/kyaml/fn/framework/frameworktestutil/frameworktestutil.go +++ b/kyaml/fn/framework/frameworktestutil/frameworktestutil.go @@ -81,6 +81,7 @@ type CommandResultsChecker struct { // Assert runs the command with the input provided in each valid test directory // and verifies that the actual output and error match the fixtures in the directory. func (rc *CommandResultsChecker) Assert(t *testing.T) bool { + t.Helper() if rc.ConfigInputFilename == "" { rc.ConfigInputFilename = DefaultConfigInputFilename } @@ -109,6 +110,7 @@ func (rc *CommandResultsChecker) isTestDir(path string) bool { } func (rc *CommandResultsChecker) runInCurrentDir(t *testing.T) (string, string) { + t.Helper() _, err := os.Stat(rc.ConfigInputFilename) if os.IsNotExist(err) { t.Errorf("Test case is missing FunctionConfig input file (default: %s)", DefaultConfigInputFilename) @@ -180,6 +182,7 @@ type ProcessorResultsChecker struct { // Assert runs the processor with the input provided in each valid test directory // and verifies that the actual output and error match the fixtures in the directory. func (rc *ProcessorResultsChecker) Assert(t *testing.T) bool { + t.Helper() if rc.InputFilename == "" { rc.InputFilename = DefaultInputFilename } @@ -205,6 +208,7 @@ func (rc *ProcessorResultsChecker) isTestDir(path string) bool { } func (rc *ProcessorResultsChecker) runInCurrentDir(t *testing.T) (string, string) { + t.Helper() _, err := os.Stat(rc.InputFilename) if os.IsNotExist(err) { t.Errorf("Test case is missing input file (default: %s)", DefaultInputFilename) @@ -232,6 +236,7 @@ type AssertionFunc func(t *testing.T, expected string, actual string) // RequireEachLineMatches is an AssertionFunc that treats each line of expected string // as a regex that must match the actual string. func RequireEachLineMatches(t *testing.T, expected, actual string) { + t.Helper() // Check that each expected line matches the output actual = standardizeSpacing(actual) for _, msg := range strings.Split(standardizeSpacing(expected), "\n") { @@ -242,6 +247,7 @@ func RequireEachLineMatches(t *testing.T, expected, actual string) { // RequireStrippedStringsEqual is an AssertionFunc that does a simple string comparison // of expected and actual after normalizing whitespace. func RequireStrippedStringsEqual(t *testing.T, expected, actual string) { + t.Helper() require.Equal(t, standardizeSpacing(expected), standardizeSpacing(actual)) @@ -273,9 +279,9 @@ type resultsChecker interface { shouldUpdateFixtures() bool // updateFixtures modifies the test fixture files to match the given content updateFixtures(t *testing.T, actualOutput string, actualError string) - // assertOutputMatches compares the expected output to the output recieved. + // assertOutputMatches compares the expected output to the output received. assertOutputMatches(t *testing.T, expected string, actual string) - // assertErrorMatches compares teh expected error to the error received. + // assertErrorMatches compares the expected error to the error received. assertErrorMatches(t *testing.T, expected string, actual string) } @@ -330,6 +336,7 @@ func (rc *checkerCore) shouldUpdateFixtures() bool { } func (rc *checkerCore) updateFixtures(t *testing.T, actualOutput string, actualError string) { + t.Helper() if actualError != "" { require.NoError(t, ioutil.WriteFile(rc.expectedErrorFilename, []byte(actualError), 0600)) } @@ -340,14 +347,17 @@ func (rc *checkerCore) updateFixtures(t *testing.T, actualOutput string, actualE } func (rc *checkerCore) assertOutputMatches(t *testing.T, expected string, actual string) { + t.Helper() rc.outputAssertionFunc(t, expected, actual) } func (rc *checkerCore) assertErrorMatches(t *testing.T, expected string, actual string) { + t.Helper() rc.errorAssertionFunc(t, expected, actual) } func (rc *checkerCore) readAssertionFiles(t *testing.T) (string, string) { + t.Helper() // read the expected results var expectedOutput, expectedError string if rc.expectedOutputFilename != "" { @@ -385,6 +395,7 @@ func (rc *checkerCore) readAssertionFiles(t *testing.T) (string, string) { // under test in each directory, and then runs assertions on the returned output and error results. // It triggers a test failure if no valid test directories were found. func runAllTestCases(t *testing.T, checker resultsChecker) { + t.Helper() checker.resetTestCasesRun() err := filepath.Walk(checker.rootDir(), func(path string, info os.FileInfo, err error) error { @@ -399,6 +410,7 @@ func runAllTestCases(t *testing.T, checker resultsChecker) { } func runDirectoryTestCase(t *testing.T, path string, checker resultsChecker) { + t.Helper() // cd into the directory so we can test functions that refer to local files by relative paths d, err := os.Getwd() require.NoError(t, err) diff --git a/kyaml/fn/framework/function_definition.go b/kyaml/fn/framework/function_definition.go index 8bbdf89a0..683219896 100644 --- a/kyaml/fn/framework/function_definition.go +++ b/kyaml/fn/framework/function_definition.go @@ -82,7 +82,7 @@ type KRMFunctionVersion struct { type KRMFunctionValidation struct { // OpenAPIV3Schema is the OpenAPI v3 schema for an instance of the KRM function. - OpenAPIV3Schema *spec.Schema `yaml:"openAPIV3Schema,omitempty" json:"openAPIV3Schema,omitempty"` + OpenAPIV3Schema *spec.Schema `yaml:"openAPIV3Schema,omitempty" json:"openAPIV3Schema,omitempty"` // nolint: tagliatelle } type KRMFunctionNames struct { diff --git a/kyaml/fn/framework/validation_test.go b/kyaml/fn/framework/validation_test.go index c7a4a4053..199ef4101 100644 --- a/kyaml/fn/framework/validation_test.go +++ b/kyaml/fn/framework/validation_test.go @@ -75,14 +75,16 @@ spec: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + internal value, and may reject unrecognized values. More info: + https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string color: type: string kind: description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + submits requests to. Cannot be updated. In CamelCase. More info: + https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object @@ -141,7 +143,7 @@ func TestSchemaFromFunctionDefinition(t *testing.T) { } else { require.NoError(t, err) var gotProps []string - for prop, _ := range got.Properties { + for prop := range got.Properties { gotProps = append(gotProps, prop) } sort.Strings(tt.wantProps) diff --git a/kyaml/fn/runtime/container/container.go b/kyaml/fn/runtime/container/container.go index 99ad88be3..c7cda7dbd 100644 --- a/kyaml/fn/runtime/container/container.go +++ b/kyaml/fn/runtime/container/container.go @@ -189,7 +189,7 @@ func (c *Filter) getCommand() (string, []string) { } args = append(args, runtimeutil.NewContainerEnvFromStringSlice(c.Env).GetDockerFlags()...) - a := append(args, c.Image) + a := append(args, c.Image) //nolint:gocritic return "docker", a } diff --git a/kyaml/fn/runtime/container/container_test.go b/kyaml/fn/runtime/container/container_test.go index 3774723d6..06c3a7dd2 100644 --- a/kyaml/fn/runtime/container/container_test.go +++ b/kyaml/fn/runtime/container/container_test.go @@ -6,11 +6,11 @@ package container import ( "bytes" "fmt" - "github.com/stretchr/testify/require" "os" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "sigs.k8s.io/kustomize/kyaml/fn/runtime/runtimeutil" "sigs.k8s.io/kustomize/kyaml/kio" "sigs.k8s.io/kustomize/kyaml/yaml" @@ -242,6 +242,7 @@ func TestFilter_ExitCode(t *testing.T) { } func getWorkingDir(t *testing.T) string { + t.Helper() wd, err := os.Getwd() require.NoError(t, err) return wd diff --git a/kyaml/fn/runtime/exec/exec.go b/kyaml/fn/runtime/exec/exec.go index f5a0b384c..e9546820f 100644 --- a/kyaml/fn/runtime/exec/exec.go +++ b/kyaml/fn/runtime/exec/exec.go @@ -34,7 +34,7 @@ func (c *Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) { } func (c *Filter) Run(reader io.Reader, writer io.Writer) error { - cmd := exec.Command(c.Path, c.Args...) + cmd := exec.Command(c.Path, c.Args...) // nolint:gosec cmd.Stdin = reader cmd.Stdout = writer cmd.Stderr = os.Stderr diff --git a/kyaml/fn/runtime/starlark/starlark.go b/kyaml/fn/runtime/starlark/starlark.go index 825ff63a0..9d7450a48 100644 --- a/kyaml/fn/runtime/starlark/starlark.go +++ b/kyaml/fn/runtime/starlark/starlark.go @@ -40,8 +40,7 @@ func (sf *Filter) String() string { } func (sf *Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) { - err := sf.setup() - if err != nil { + if err := sf.setup(); err != nil { return nil, err } sf.FunctionFilter.Run = sf.Run diff --git a/kyaml/go.mod b/kyaml/go.mod index 4da840068..56319c705 100644 --- a/kyaml/go.mod +++ b/kyaml/go.mod @@ -5,7 +5,6 @@ go 1.16 require ( github.com/davecgh/go-spew v1.1.1 github.com/go-errors/errors v1.0.1 - github.com/golang/protobuf v1.5.2 github.com/google/gnostic v0.5.7-v3refs github.com/google/go-cmp v0.5.5 github.com/mailru/easyjson v0.7.0 // indirect @@ -18,19 +17,9 @@ require ( github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 golang.org/x/text v0.3.7 // indirect + google.golang.org/protobuf v1.27.1 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 gopkg.in/yaml.v2 v2.4.0 k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e sigs.k8s.io/yaml v1.2.0 ) - -// These can be removed after upgrading golangci-lint (Issue #3663) -// 07 Mar 2021 commenting these out to perform a release. - -// replace github.com/go-critic/go-critic v0.0.0-20181204210945-c3db6069acc5 => github.com/go-critic/go-critic v0.0.0-20190422201921-c3db6069acc5 -// replace github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6 => github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6 -// replace github.com/golangci/go-tools v0.0.0-20180109140146-af6baa5dc196 => github.com/golangci/go-tools v0.0.0-20190318060251-af6baa5dc196 -// replace github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98 => github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98 -// replace github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547 => github.com/golangci/gosec v0.0.0-20190211064107-66fb7fc33547 -// replace github.com/golangci/lint-1 v0.0.0-20180610141402-ee948d087217 => github.com/golangci/lint-1 v0.0.0-20190420132249-ee948d087217 -// replace mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34 => mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34 diff --git a/kyaml/go.sum b/kyaml/go.sum index e3eb38a94..404b2a9f4 100644 --- a/kyaml/go.sum +++ b/kyaml/go.sum @@ -605,8 +605,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/kyaml/kio/byteio_reader.go b/kyaml/kio/byteio_reader.go index fbcf4b6be..230ab891b 100644 --- a/kyaml/kio/byteio_reader.go +++ b/kyaml/kio/byteio_reader.go @@ -330,7 +330,7 @@ func (r *ByteReader) decode(originalYAML string, index int, decoder *yaml.Decode // derive and add the seqindent annotation seqIndentStyle := yaml.DeriveSeqIndentStyle(originalYAML) if seqIndentStyle != "" { - r.SetAnnotations[kioutil.SeqIndentAnnotation] = fmt.Sprintf("%s", seqIndentStyle) + r.SetAnnotations[kioutil.SeqIndentAnnotation] = seqIndentStyle } } } diff --git a/kyaml/kio/ignorefilesmatcher_test.go b/kyaml/kio/ignorefilesmatcher_test.go index 91e9dc15c..ceb20bf0c 100644 --- a/kyaml/kio/ignorefilesmatcher_test.go +++ b/kyaml/kio/ignorefilesmatcher_test.go @@ -41,7 +41,7 @@ func TestIgnoreFilesMatcher_readIgnoreFile(t *testing.T) { fsMakers := map[string]func(bool) (string, filesys.FileSystem){ // onDisk creates a temp directory and returns a nil FileSystem, testing // the normal conditions under which ignoreFileMatcher is used. - "onDisk": func(writeIgnoreFile bool) (string, filesys.FileSystem) { + "onDisk": func(writeIgnoreFile bool) (string, filesys.FileSystem) { //nolint:unparam dir, err := ioutil.TempDir("", "kyaml-test") require.NoError(t, err) @@ -107,10 +107,10 @@ func TestLocalPackageReader_Read_ignoreFile(t *testing.T) { filepath.Join("a", "c"), }, files: map[string][]byte{ - filepath.Join("pkgFile"): {}, + "pkgFile": {}, filepath.Join("a", "b", "a_test.yaml"): readFileA, filepath.Join("a", "c", "c_test.yaml"): readFileB, - filepath.Join(".krmignore"): []byte(` + ".krmignore": []byte(` a/c/c_test.yaml `, ), @@ -127,10 +127,10 @@ a/c/c_test.yaml filepath.Join("a", "c"), }, files: map[string][]byte{ - filepath.Join("pkgFile"): {}, + "pkgFile": {}, filepath.Join("a", "b", "a_test.yaml"): readFileA, filepath.Join("a", "c", "c_test.yaml"): readFileB, - filepath.Join(".krmignore"): []byte(` + ".krmignore": []byte(` a/c `, ), @@ -146,10 +146,10 @@ a/c filepath.Join("a", "c"), }, files: map[string][]byte{ - filepath.Join("pkgFile"): {}, + "pkgFile": {}, filepath.Join("a", "c", "a_test.yaml"): readFileA, filepath.Join("a", "c", "c_test.yaml"): readFileB, - filepath.Join(".krmignore"): []byte(` + ".krmignore": []byte(` d/e/f.yaml `, ), @@ -168,10 +168,10 @@ a_test.yaml filepath.Join("a", "c"), }, files: map[string][]byte{ - filepath.Join("pkgFile"): {}, + "pkgFile": {}, filepath.Join("a", "c", "a_test.yaml"): readFileA, filepath.Join("a", "c", "c_test.yaml"): readFileB, - filepath.Join(".krmignore"): []byte(` + ".krmignore": []byte(` a/c/c_test.yaml `, ), @@ -187,16 +187,16 @@ a_test.yaml { name: "handles a combination of packages and directories", directories: []string{ - filepath.Join("a"), + "a", filepath.Join("d", "e"), - filepath.Join("f"), + "f", }, files: map[string][]byte{ - filepath.Join("pkgFile"): {}, + "pkgFile": {}, filepath.Join("d", "pkgFile"): {}, filepath.Join("d", "e", "pkgFile"): {}, filepath.Join("f", "pkgFile"): {}, - filepath.Join("manifest.yaml"): []byte(`root: root`), + "manifest.yaml": []byte(`root: root`), filepath.Join("a", "manifest.yaml"): []byte(`a: a`), filepath.Join("d", "manifest.yaml"): []byte(`d: d`), filepath.Join("d", "e", "manifest.yaml"): []byte(`e: e`), @@ -215,14 +215,14 @@ manifest.yaml { name: "ignore file can exclude subpackages", directories: []string{ - filepath.Join("a"), + "a", }, files: map[string][]byte{ - filepath.Join("pkgFile"): {}, + "pkgFile": {}, filepath.Join("a", "pkgFile"): {}, - filepath.Join("manifest.yaml"): []byte(`root: root`), + "manifest.yaml": []byte(`root: root`), filepath.Join("a", "manifest.yaml"): []byte(`a: a`), - filepath.Join(".krmignore"): []byte(` + ".krmignore": []byte(` a `), }, diff --git a/kyaml/kio/kio.go b/kyaml/kio/kio.go index 776b6a73a..9e00509eb 100644 --- a/kyaml/kio/kio.go +++ b/kyaml/kio/kio.go @@ -270,7 +270,10 @@ func ReconcileInternalAnnotations(result []*yaml.RNode, nodeAnnosMap map[string] } // determineAnnotationsFormat determines if the resources are using one of the internal and legacy annotation format or both of them. -func determineAnnotationsFormat(nodeAnnosMap map[string]map[string]string) (useInternal, useLegacy bool, err error) { +func determineAnnotationsFormat(nodeAnnosMap map[string]map[string]string) (bool, bool, error) { + var useInternal, useLegacy bool + var err error + if len(nodeAnnosMap) == 0 { return true, true, nil } @@ -295,7 +298,7 @@ func determineAnnotationsFormat(nodeAnnosMap map[string]map[string]string) (useI } if (foundOneOf && !*internal) || (!foundOneOf && *internal) { err = fmt.Errorf("the annotation formatting in the input resources is not consistent") - return + return useInternal, useLegacy, err } foundOneOf = foundLegacyPath || foundLegacyIndex || foundLegacyId @@ -305,7 +308,7 @@ func determineAnnotationsFormat(nodeAnnosMap map[string]map[string]string) (useI } if (foundOneOf && !*legacy) || (!foundOneOf && *legacy) { err = fmt.Errorf("the annotation formatting in the input resources is not consistent") - return + return useInternal, useLegacy, err } } if internal != nil { @@ -314,7 +317,7 @@ func determineAnnotationsFormat(nodeAnnosMap map[string]map[string]string) (useI if legacy != nil { useLegacy = *legacy } - return + return useInternal, useLegacy, err } func missingInternalOrLegacyAnnotations(rn *yaml.RNode) error { @@ -382,13 +385,14 @@ func checkAnnotationsAltered(rn *yaml.RNode, nodeAnnosMap map[string]map[string] originalPath = originalAnnotations[kioutil.LegacyPathAnnotation] } if originalPath != "" { - if originalPath != internal.path && originalPath != legacy.path && internal.path != legacy.path { + switch { + case originalPath != internal.path && originalPath != legacy.path && internal.path != legacy.path: return fmt.Errorf("resource input to function has mismatched legacy and internal path annotations") - } else if originalPath != internal.path { + case originalPath != internal.path: if _, err := rn.Pipe(yaml.SetAnnotation(kioutil.LegacyPathAnnotation, internal.path)); err != nil { return err } - } else if originalPath != legacy.path { + case originalPath != legacy.path: if _, err := rn.Pipe(yaml.SetAnnotation(kioutil.PathAnnotation, legacy.path)); err != nil { return err } @@ -400,13 +404,14 @@ func checkAnnotationsAltered(rn *yaml.RNode, nodeAnnosMap map[string]map[string] originalIndex = originalAnnotations[kioutil.LegacyIndexAnnotation] } if originalIndex != "" { - if originalIndex != internal.index && originalIndex != legacy.index && internal.index != legacy.index { + switch { + case originalIndex != internal.index && originalIndex != legacy.index && internal.index != legacy.index: return fmt.Errorf("resource input to function has mismatched legacy and internal index annotations") - } else if originalIndex != internal.index { + case originalIndex != internal.index: if _, err := rn.Pipe(yaml.SetAnnotation(kioutil.LegacyIndexAnnotation, internal.index)); err != nil { return err } - } else if originalIndex != legacy.index { + case originalIndex != legacy.index: if _, err := rn.Pipe(yaml.SetAnnotation(kioutil.IndexAnnotation, legacy.index)); err != nil { return err } diff --git a/kyaml/kio/kio_test.go b/kyaml/kio/kio_test.go index e7e5d046a..fb399ad98 100644 --- a/kyaml/kio/kio_test.go +++ b/kyaml/kio/kio_test.go @@ -91,8 +91,7 @@ func TestEmptyInput(t *testing.T) { Outputs: []Writer{output}, } - err := p.Execute() - if err != nil { + if err := p.Execute(); err != nil { t.Fatal(err) } @@ -132,8 +131,7 @@ func TestEmptyInputWithFilter(t *testing.T) { Filters: filters, } - err := p.Execute() - if err != nil { + if err := p.Execute(); err != nil { t.Fatal(err) } @@ -883,7 +881,6 @@ data: assert.Error(t, err) assert.Equal(t, tc.expectedErr, err.Error()) } - }) } } diff --git a/kyaml/kio/kioutil/kioutil_test.go b/kyaml/kio/kioutil/kioutil_test.go index 3bbdea26a..d05462652 100644 --- a/kyaml/kio/kioutil/kioutil_test.go +++ b/kyaml/kio/kioutil/kioutil_test.go @@ -644,7 +644,9 @@ metadata: internal.config.kubernetes.io/e: 'f' internal.config.kubernetes.io/g: 'h' `, - expectedErr: `internal annotations differ: internal.config.kubernetes.io/a, internal.config.kubernetes.io/c, internal.config.kubernetes.io/e, internal.config.kubernetes.io/g`, + expectedErr: `internal annotations differ: ` + + `internal.config.kubernetes.io/a, internal.config.kubernetes.io/c, ` + + `internal.config.kubernetes.io/e, internal.config.kubernetes.io/g`, }, } diff --git a/kyaml/kio/pkgio_reader_test.go b/kyaml/kio/pkgio_reader_test.go index 9d887b98f..721f15c60 100644 --- a/kyaml/kio/pkgio_reader_test.go +++ b/kyaml/kio/pkgio_reader_test.go @@ -65,6 +65,7 @@ func TestLocalPackageReader_Read_pkg(t *testing.T) { {path: "c_test.yaml", content: readFileC}, {path: "d_test.yaml", content: readFileD}, }, func(t *testing.T, path string, mockFS filesys.FileSystem) { + t.Helper() rfr := LocalPackageReader{ PackagePath: path, FileSystem: filesys.FileSystemOrOnDisk{FileSystem: mockFS}, @@ -136,6 +137,7 @@ func TestLocalPackageReader_Read_pkgAndSkipFile(t *testing.T) { {path: "c_test.yaml", content: readFileC}, {path: "d_test.yaml", content: readFileD}, }, func(t *testing.T, path string, mockFS filesys.FileSystem) { + t.Helper() rfr := LocalPackageReader{ PackagePath: path, FileSkipFunc: func(relPath string) bool { return relPath == "d_test.yaml" }, @@ -207,6 +209,7 @@ func TestLocalPackageReader_Read_JSON(t *testing.T) { }`), }, }, func(t *testing.T, path string, mockFS filesys.FileSystem) { + t.Helper() rfr := LocalPackageReader{ PackagePath: path, MatchFilesGlob: []string{"*.json"}, @@ -216,9 +219,19 @@ func TestLocalPackageReader_Read_JSON(t *testing.T) { require.NoError(t, err) require.Len(t, nodes, 2) expected := []string{ - `{"a": "b", metadata: {annotations: {config.kubernetes.io/index: '0', config.kubernetes.io/path: 'a_test.json', internal.config.kubernetes.io/index: '0', internal.config.kubernetes.io/path: 'a_test.json'}}} + `{"a": "b", ` + + `metadata: {annotations: {` + + `config.kubernetes.io/index: '0', ` + + `config.kubernetes.io/path: 'a_test.json', ` + + `internal.config.kubernetes.io/index: '0', ` + + `internal.config.kubernetes.io/path: 'a_test.json'}}} `, - `{"e": "f", "g": {"h": ["i", "j"]}, metadata: {annotations: {config.kubernetes.io/index: '0', config.kubernetes.io/path: 'b_test.json', internal.config.kubernetes.io/index: '0', internal.config.kubernetes.io/path: 'b_test.json'}}} + `{"e": "f", "g": {"h": ["i", "j"]}, ` + + `metadata: {annotations: {` + + `config.kubernetes.io/index: '0', ` + + `config.kubernetes.io/path: 'b_test.json', ` + + `internal.config.kubernetes.io/index: '0', ` + + `internal.config.kubernetes.io/path: 'b_test.json'}}} `, } for i := range nodes { @@ -236,6 +249,7 @@ func TestLocalPackageReader_Read_file(t *testing.T) { {path: "a_test.yaml", content: readFileA}, {path: "b_test.yaml", content: readFileB}, }, func(t *testing.T, path string, mockFS filesys.FileSystem) { + t.Helper() rfr := LocalPackageReader{ PackagePath: filepath.Join(path, "a_test.yaml"), FileSystem: filesys.FileSystemOrOnDisk{FileSystem: mockFS}, @@ -276,6 +290,7 @@ func TestLocalPackageReader_Read_pkgOmitAnnotations(t *testing.T) { {path: "a_test.yaml", content: readFileA}, {path: "b_test.yaml", content: readFileB}, }, func(t *testing.T, path string, mockFS filesys.FileSystem) { + t.Helper() rfr := LocalPackageReader{ PackagePath: path, OmitReaderAnnotations: true, @@ -312,6 +327,7 @@ func TestLocalPackageReader_Read_PreserveSeqIndent(t *testing.T) { {path: "a_test.yaml", content: readFileA}, {path: "b_test.yaml", content: readFileB}, }, func(t *testing.T, path string, mockFS filesys.FileSystem) { + t.Helper() rfr := LocalPackageReader{ PackagePath: path, PreserveSeqIndent: true, @@ -369,6 +385,7 @@ func TestLocalPackageReader_Read_nestedDirs(t *testing.T) { {path: "a/b/a_test.yaml", content: readFileA}, {path: "a/b/b_test.yaml", content: readFileB}, }, func(t *testing.T, path string, mockFS filesys.FileSystem) { + t.Helper() rfr := LocalPackageReader{ PackagePath: path, FileSystem: filesys.FileSystemOrOnDisk{FileSystem: mockFS}, @@ -423,6 +440,7 @@ func TestLocalPackageReader_Read_matchRegex(t *testing.T) { {path: "a/b/a_test.yaml", content: readFileA}, {path: "a/b/b_test.yaml", content: readFileB}, }, func(t *testing.T, path string, mockFS filesys.FileSystem) { + t.Helper() rfr := LocalPackageReader{ PackagePath: path, MatchFilesGlob: []string{`a*.yaml`}, @@ -468,6 +486,7 @@ func TestLocalPackageReader_Read_skipSubpackage(t *testing.T) { {path: "a/c/c_test.yaml", content: readFileB}, {path: "a/c/pkgFile", content: pkgFile}, }, func(t *testing.T, path string, mockFS filesys.FileSystem) { + t.Helper() rfr := LocalPackageReader{ PackagePath: path, PackageFileName: "pkgFile", @@ -513,6 +532,7 @@ func TestLocalPackageReader_Read_includeSubpackage(t *testing.T) { {path: "a/c/c_test.yaml", content: readFileB}, {path: "a/c/pkgFile", content: pkgFile}, }, func(t *testing.T, path string, mockFS filesys.FileSystem) { + t.Helper() rfr := LocalPackageReader{ PackagePath: path, IncludeSubpackages: true, @@ -571,6 +591,7 @@ type mockFile struct { } func testOnDiskAndOnMem(t *testing.T, files []mockFile, f func(t *testing.T, path string, fs filesys.FileSystem)) { + t.Helper() t.Run("on_disk", func(t *testing.T) { var dirs []string for _, file := range files { @@ -617,6 +638,7 @@ func TestLocalPackageReader_ReadBareSeqNodes(t *testing.T) { {path: "a/c"}, {path: "e_test.yaml", content: readFileE}, }, func(t *testing.T, path string, mockFS filesys.FileSystem) { + t.Helper() rfr := LocalPackageReader{ PackagePath: path, FileSystem: filesys.FileSystemOrOnDisk{FileSystem: mockFS}, diff --git a/kyaml/kio/pkgio_writer_test.go b/kyaml/kio/pkgio_writer_test.go index 0ef664852..387eae1d1 100644 --- a/kyaml/kio/pkgio_writer_test.go +++ b/kyaml/kio/pkgio_writer_test.go @@ -25,6 +25,7 @@ import ( // - ReaderAnnotations are cleared when writing the Resources func TestLocalPackageWriter_Write(t *testing.T) { testWriterOnDiskAndOnMem(t, func(t *testing.T, fs filesys.FileSystem) { + t.Helper() d, node1, node2, node3, cleanup := getWriterInputs(t, fs) defer cleanup() @@ -57,6 +58,7 @@ g: // - ReaderAnnotations are kept when writing the Resources func TestLocalPackageWriter_Write_keepReaderAnnotations(t *testing.T) { testWriterOnDiskAndOnMem(t, func(t *testing.T, fs filesys.FileSystem) { + t.Helper() d, node1, node2, node3, cleanup := getWriterInputs(t, fs) defer cleanup() @@ -108,6 +110,7 @@ metadata: // - ClearAnnotations are removed from Resources func TestLocalPackageWriter_Write_clearAnnotations(t *testing.T) { testWriterOnDiskAndOnMem(t, func(t *testing.T, fs filesys.FileSystem) { + t.Helper() d, node1, node2, node3, cleanup := getWriterInputs(t, fs) defer cleanup() @@ -141,6 +144,7 @@ g: // - If a relative path above the package is defined, write fails func TestLocalPackageWriter_Write_failRelativePath(t *testing.T) { testWriterOnDiskAndOnMem(t, func(t *testing.T, fs filesys.FileSystem) { + t.Helper() d, node1, node2, node3, cleanup := getWriterInputs(t, fs) defer cleanup() @@ -171,6 +175,7 @@ metadata: // - If a non-int index is given, fail func TestLocalPackageWriter_Write_invalidIndex(t *testing.T) { testWriterOnDiskAndOnMem(t, func(t *testing.T, fs filesys.FileSystem) { + t.Helper() d, node1, node2, node3, cleanup := getWriterInputs(t, fs) defer cleanup() @@ -201,6 +206,7 @@ metadata: // - If config.kubernetes.io/path is absolute, fail func TestLocalPackageWriter_Write_absPath(t *testing.T) { testWriterOnDiskAndOnMem(t, func(t *testing.T, fs filesys.FileSystem) { + t.Helper() d, node1, node2, node3, cleanup := getWriterInputs(t, fs) defer cleanup() @@ -232,6 +238,7 @@ metadata: // - If config.kubernetes.io/path or index are missing, then default them func TestLocalPackageWriter_Write_missingAnnotations(t *testing.T) { testWriterOnDiskAndOnMem(t, func(t *testing.T, fs filesys.FileSystem) { + t.Helper() d, node1, node2, node3, cleanup := getWriterInputs(t, fs) defer cleanup() @@ -263,6 +270,7 @@ metadata: // - If config.kubernetes.io/path is a directory, fail func TestLocalPackageWriter_Write_pathIsDir(t *testing.T) { testWriterOnDiskAndOnMem(t, func(t *testing.T, fs filesys.FileSystem) { + t.Helper() d, node1, node2, node3, cleanup := getWriterInputs(t, fs) defer cleanup() @@ -289,6 +297,7 @@ metadata: } func testWriterOnDiskAndOnMem(t *testing.T, f func(t *testing.T, fs filesys.FileSystem)) { + t.Helper() t.Run("on_disk", func(t *testing.T) { f(t, filesys.MakeFsOnDisk()) }) // TODO: Once fsnode supports Windows, these tests should also be run. if runtime.GOOS != "windows" { @@ -297,6 +306,7 @@ func testWriterOnDiskAndOnMem(t *testing.T, f func(t *testing.T, fs filesys.File } func getWriterInputs(t *testing.T, mockFS filesys.FileSystem) (string, *yaml.RNode, *yaml.RNode, *yaml.RNode, func()) { + t.Helper() node1, err := yaml.Parse(`a: b #first metadata: annotations: @@ -325,7 +335,7 @@ metadata: // These two lines are similar to calling ioutil.TempDir, but we don't actually create any directory. rand.Seed(time.Now().Unix()) - path := filepath.Join(os.TempDir(), fmt.Sprintf("kyaml-test%d", rand.Int31())) + path := filepath.Join(os.TempDir(), fmt.Sprintf("kyaml-test%d", rand.Int31())) //nolint:gosec require.NoError(t, mockFS.MkdirAll(filepath.Join(path, "a"))) return path, node1, node2, node3, func() { require.NoError(t, mockFS.RemoveAll(path)) } } diff --git a/kyaml/kio/testing.go b/kyaml/kio/testing.go index b973e9fbb..6c46a2804 100644 --- a/kyaml/kio/testing.go +++ b/kyaml/kio/testing.go @@ -20,6 +20,7 @@ type Setup struct { // setupDirectories creates directories for reading test configuration from func SetupDirectories(t *testing.T, dirs ...string) Setup { + t.Helper() d, err := ioutil.TempDir("", "kyaml-test") require.NoError(t, err) err = os.Chdir(d) @@ -33,6 +34,7 @@ func SetupDirectories(t *testing.T, dirs ...string) Setup { // writeFile writes a file under the test directory func (s Setup) WriteFile(t *testing.T, path string, value []byte) { + t.Helper() err := os.MkdirAll(filepath.Dir(filepath.Join(s.Root, path)), 0700) require.NoError(t, err) err = ioutil.WriteFile(filepath.Join(s.Root, path), value, 0600) diff --git a/kyaml/openapi/openapi.go b/kyaml/openapi/openapi.go index 8b644166a..b503b8899 100644 --- a/kyaml/openapi/openapi.go +++ b/kyaml/openapi/openapi.go @@ -316,9 +316,8 @@ func toTypeMeta(ext interface{}) (yaml.TypeMeta, bool) { return yaml.TypeMeta{}, false } - g := m[groupKey].(string) apiVersion := m[versionKey].(string) - if g != "" { + if g, ok := m[groupKey].(string); ok && g != "" { apiVersion = g + "/" + apiVersion } return yaml.TypeMeta{Kind: m[kindKey].(string), APIVersion: apiVersion}, true diff --git a/kyaml/openapi/openapi_benchmark_test.go b/kyaml/openapi/openapi_benchmark_test.go index 6b0681139..d78ba82fc 100644 --- a/kyaml/openapi/openapi_benchmark_test.go +++ b/kyaml/openapi/openapi_benchmark_test.go @@ -7,8 +7,8 @@ import ( "path/filepath" "testing" - "github.com/golang/protobuf/proto" openapi_v2 "github.com/google/gnostic/openapiv2" + "google.golang.org/protobuf/proto" "k8s.io/kube-openapi/pkg/validation/spec" "sigs.k8s.io/kustomize/kyaml/openapi/kubernetesapi" "sigs.k8s.io/kustomize/kyaml/openapi/kubernetesapi/v1218pb" diff --git a/kyaml/order/syncorder.go b/kyaml/order/syncorder.go index 9352fd8cc..57bc86503 100644 --- a/kyaml/order/syncorder.go +++ b/kyaml/order/syncorder.go @@ -39,10 +39,7 @@ func syncOrder(from, to *yaml.RNode) error { return syncOrder(fNode.Value, tNode.Value) }) case yaml.SequenceNode: - return VisitElements(from, to, func(fNode, tNode *yaml.RNode) error { - // Traverse each list element - return syncOrder(fNode, tNode) - }) + return VisitElements(from, to, syncOrder) // Traverse each list element } return nil } diff --git a/kyaml/order/syncorder_test.go b/kyaml/order/syncorder_test.go index 6fa8fe021..94b5cff52 100644 --- a/kyaml/order/syncorder_test.go +++ b/kyaml/order/syncorder_test.go @@ -259,7 +259,7 @@ spec: properties: conditions: items: - description: ControlPlaneRevisionCondition is a repeated struct definining the current conditions of a ControlPlaneRevision. + description: ControlPlaneRevisionCondition is a repeated struct defining the current conditions of a ControlPlaneRevision. properties: lastTransitionTime: description: Last time the condition transitioned from one status to another @@ -347,7 +347,7 @@ spec: type: array items: type: object - description: ControlPlaneRevisionCondition is a repeated struct definining the current conditions of a ControlPlaneRevision. + description: ControlPlaneRevisionCondition is a repeated struct defining the current conditions of a ControlPlaneRevision. properties: type: type: string diff --git a/kyaml/pathutil/pathutil_test.go b/kyaml/pathutil/pathutil_test.go index 6069a581f..39a49611d 100644 --- a/kyaml/pathutil/pathutil_test.go +++ b/kyaml/pathutil/pathutil_test.go @@ -82,15 +82,15 @@ func createTestDirStructure(dir string) error { if err != nil { return err } - err = ioutil.WriteFile(filepath.Join(dir, "subpkg1", "Krmfile"), []byte(""), 0777) + err = ioutil.WriteFile(filepath.Join(dir, "subpkg1", "Krmfile"), []byte(""), 0644) if err != nil { return err } - err = ioutil.WriteFile(filepath.Join(dir, "subpkg2", "Krmfile"), []byte(""), 0777) + err = ioutil.WriteFile(filepath.Join(dir, "subpkg2", "Krmfile"), []byte(""), 0644) if err != nil { return err } - err = ioutil.WriteFile(filepath.Join(dir, "Krmfile"), []byte(""), 0777) + err = ioutil.WriteFile(filepath.Join(dir, "Krmfile"), []byte(""), 0644) if err != nil { return err } diff --git a/kyaml/runfn/runfn_test.go b/kyaml/runfn/runfn_test.go index fcb0ec7e8..460ddae02 100644 --- a/kyaml/runfn/runfn_test.go +++ b/kyaml/runfn/runfn_test.go @@ -342,7 +342,7 @@ metadata: {name: "sort functions -- deepest first", in: []f{ { - path: filepath.Join("a.yaml"), + path: "a.yaml", value: ` metadata: annotations: @@ -382,7 +382,7 @@ metadata: `, }, { - path: filepath.Join("b.yaml"), + path: "b.yaml", value: ` metadata: annotations: @@ -412,7 +412,7 @@ metadata: `, }, { - path: filepath.Join("b.yaml"), + path: "b.yaml", value: ` metadata: annotations: @@ -442,7 +442,7 @@ metadata: `, }, { - path: filepath.Join("b.yaml"), + path: "b.yaml", value: ` metadata: annotations: @@ -473,7 +473,7 @@ metadata: `, }, { - path: filepath.Join("b.yaml"), + path: "b.yaml", value: ` metadata: annotations: @@ -502,7 +502,7 @@ metadata: `, }, { - path: filepath.Join("b.yaml"), + path: "b.yaml", value: ` metadata: annotations: @@ -543,7 +543,7 @@ metadata: `, }, { - path: filepath.Join("b.yaml"), + path: "b.yaml", value: ` metadata: annotations: @@ -1170,6 +1170,7 @@ func TestCmd_Execute_enableLogSteps(t *testing.T) { } func getGeneratorFilterProvider(t *testing.T) func(runtimeutil.FunctionSpec, *yaml.RNode, currentUserFunc) (kio.Filter, error) { + t.Helper() return func(f runtimeutil.FunctionSpec, node *yaml.RNode, currentUser currentUserFunc) (kio.Filter, error) { return kio.FilterFunc(func(items []*yaml.RNode) ([]*yaml.RNode, error) { if f.Container.Image == "generate" { @@ -1238,6 +1239,7 @@ metadata: // setupTest initializes a temp test directory containing test data func setupTest(t *testing.T) string { + t.Helper() dir, err := ioutil.TempDir("", "kustomize-kyaml-test") if !assert.NoError(t, err) { t.FailNow() @@ -1264,6 +1266,7 @@ func setupTest(t *testing.T) string { // a filter to s/kind: Deployment/kind: StatefulSet/g. // this can be used to simulate running a filter. func getFilterProvider(t *testing.T) func(runtimeutil.FunctionSpec, *yaml.RNode, currentUserFunc) (kio.Filter, error) { + t.Helper() return func(f runtimeutil.FunctionSpec, node *yaml.RNode, currentUser currentUserFunc) (kio.Filter, error) { // parse the filter from the input filter := yaml.YFilter{} diff --git a/kyaml/setters2/set_test.go b/kyaml/setters2/set_test.go index 532a03e28..c9385cc55 100644 --- a/kyaml/setters2/set_test.go +++ b/kyaml/setters2/set_test.go @@ -1002,6 +1002,7 @@ spec: // initSchema initializes the openAPI with the definitions from s func SettersSchema(t *testing.T, s string) *spec.Schema { + t.Helper() dir, err := ioutil.TempDir("", "") assert.NoError(t, err) defer os.RemoveAll(dir) diff --git a/kyaml/setters2/settersutil/fieldsetter.go b/kyaml/setters2/settersutil/fieldsetter.go index baf4a5f2e..8b753661e 100644 --- a/kyaml/setters2/settersutil/fieldsetter.go +++ b/kyaml/setters2/settersutil/fieldsetter.go @@ -50,7 +50,7 @@ func (fs *FieldSetter) Filter(input []*yaml.RNode) ([]*yaml.RNode, error) { } // Set updates the OpenAPI definitions and resources with the new setter value -func (fs FieldSetter) Set() (int, error) { +func (fs *FieldSetter) Set() (int, error) { // Update the OpenAPI definitions soa := setters2.SetOpenAPI{ Name: fs.Name, diff --git a/kyaml/setters2/settersutil/settercreator.go b/kyaml/setters2/settersutil/settercreator.go index be551c741..ded388a8a 100644 --- a/kyaml/setters2/settersutil/settercreator.go +++ b/kyaml/setters2/settersutil/settercreator.go @@ -64,7 +64,7 @@ func (c *SetterCreator) Filter(input []*yaml.RNode) ([]*yaml.RNode, error) { return nil, c.Create() } -func (c SetterCreator) Create() error { +func (c *SetterCreator) Create() error { err := c.validateSetterInfo() if err != nil { return err diff --git a/kyaml/testutil/testutil.go b/kyaml/testutil/testutil.go index b9f6b5397..5f1b8accc 100644 --- a/kyaml/testutil/testutil.go +++ b/kyaml/testutil/testutil.go @@ -6,12 +6,11 @@ package testutil import ( "bytes" "runtime" + "testing" "sigs.k8s.io/kustomize/kyaml/kio" "sigs.k8s.io/kustomize/kyaml/yaml" - "testing" - goerrors "github.com/go-errors/errors" "github.com/stretchr/testify/assert" @@ -43,6 +42,7 @@ func UpdateYamlBytes(b []byte, function ...yaml.Filter) ([]byte, error) { } func AssertErrorContains(t *testing.T, err error, value string, msg ...string) { + t.Helper() if !assert.Error(t, err, msg) { t.FailNow() } @@ -52,6 +52,7 @@ func AssertErrorContains(t *testing.T, err error, value string, msg ...string) { } func AssertNoError(t *testing.T, err error, msg ...string) { + t.Helper() if !assert.NoError(t, err, msg) { gerr, ok := err.(*goerrors.Error) if ok { @@ -62,6 +63,7 @@ func AssertNoError(t *testing.T, err error, msg ...string) { } func SkipWindows(t *testing.T) { + t.Helper() if runtime.GOOS == "windows" { t.Skip() } diff --git a/kyaml/yaml/example_test.go b/kyaml/yaml/example_test.go index 89da82731..f581d88bb 100644 --- a/kyaml/yaml/example_test.go +++ b/kyaml/yaml/example_test.go @@ -281,7 +281,7 @@ func ExampleElementMatcher_Filter_objectNotFound() { if err != nil { log.Fatal(err) } - append, err := Parse(` + toAppend, err := Parse(` name: baz image: nginx `) @@ -289,7 +289,7 @@ image: nginx log.Fatal(err) } elem, err := obj.Pipe(ElementMatcher{ - Keys: []string{"name"}, Values: []string{"baz"}, Create: append}) + Keys: []string{"name"}, Values: []string{"baz"}, Create: toAppend}) if err != nil { log.Fatal(err) } @@ -315,7 +315,7 @@ func ExampleElementMatcher_Filter_objectFound() { if err != nil { log.Fatal(err) } - append, err := Parse(` + toAppend, err := Parse(` name: baz image: nginx `) @@ -323,7 +323,7 @@ image: nginx log.Fatal(err) } elem, err := obj.Pipe(ElementMatcher{ - Keys: []string{"name"}, Values: []string{"baz"}, Create: append}) + Keys: []string{"name"}, Values: []string{"baz"}, Create: toAppend}) if err != nil { log.Fatal(err) } diff --git a/kyaml/yaml/fns.go b/kyaml/yaml/fns.go index c4ab1fb53..c5ac0acfa 100644 --- a/kyaml/yaml/fns.go +++ b/kyaml/yaml/fns.go @@ -552,7 +552,6 @@ func (l PathGetter) getFilter(part, nextPart string, fieldPath *[]string) (Filte } func (l PathGetter) elemFilter(part string) (Filter, error) { - var match *RNode name, value, err := SplitIndexNameValue(part) if err != nil { return nil, errors.Wrap(err) @@ -567,10 +566,9 @@ func (l PathGetter) elemFilter(part string) (Filter, error) { // append a ScalarNode elem = NewScalarRNode(value) elem.YNode().Style = l.Style - match = elem } else { // append a MappingNode - match = NewRNode(&yaml.Node{Kind: yaml.ScalarNode, Value: value, Style: l.Style}) + match := NewRNode(&yaml.Node{Kind: yaml.ScalarNode, Value: value, Style: l.Style}) elem = NewRNode(&yaml.Node{ Kind: yaml.MappingNode, Content: []*yaml.Node{{Kind: yaml.ScalarNode, Value: name}, match.YNode()}, diff --git a/kyaml/yaml/fns_test.go b/kyaml/yaml/fns_test.go index ae6f00747..8ad049e8e 100644 --- a/kyaml/yaml/fns_test.go +++ b/kyaml/yaml/fns_test.go @@ -23,19 +23,19 @@ c: d func TestResourceNode_SetValue(t *testing.T) { instance := *NewScalarRNode("foo") - copy := instance + instanceCopy := instance instance.SetYNode(&yaml.Node{Kind: yaml.ScalarNode, Value: "bar"}) assert.Equal(t, `bar -`, assertNoErrorString(t)(copy.String())) +`, assertNoErrorString(t)(instanceCopy.String())) assert.Equal(t, `bar `, assertNoErrorString(t)(instance.String())) instance = *NewScalarRNode("foo") - copy = instance + instanceCopy = instance instance.SetYNode(nil) instance.SetYNode(&yaml.Node{Kind: yaml.ScalarNode, Value: "bar"}) assert.Equal(t, `foo -`, assertNoErrorString(t)(copy.String())) +`, assertNoErrorString(t)(instanceCopy.String())) assert.Equal(t, `bar `, assertNoErrorString(t)(instance.String())) } @@ -864,7 +864,6 @@ func TestMapEntrySetter(t *testing.T) { assert.NotNil(t, err) assert.Equal(t, tc.expectedErr.Error(), err.Error()) } - }) } } @@ -1092,15 +1091,14 @@ func (c filter) Filter(object *RNode) (*RNode, error) { } func TestResourceNode_Pipe(t *testing.T) { - r0, r1, r2, r3 := &RNode{}, &RNode{}, &RNode{}, &RNode{} + var r0, r1, r2, r3 *RNode var called []string // check the nil value case - r0 = nil _, err := r0.Pipe(FieldMatcher{Name: "foo"}) assert.NoError(t, err) - r0 = &RNode{} + r0, r1, r2, r3 = &RNode{}, &RNode{}, &RNode{}, &RNode{} // all filters successful v, err := r0.Pipe( filter{fn: func(object *RNode) (*RNode, error) { @@ -1281,6 +1279,7 @@ metadata: } func assertNoError(t *testing.T) func(o *RNode, err error) *RNode { + t.Helper() return func(o *RNode, err error) *RNode { assert.NoError(t, err) return o @@ -1288,6 +1287,7 @@ func assertNoError(t *testing.T) func(o *RNode, err error) *RNode { } func assertNoErrorString(t *testing.T) func(string, error) string { + t.Helper() return func(s string, err error) string { assert.NoError(t, err) return s diff --git a/kyaml/yaml/kfns_test.go b/kyaml/yaml/kfns_test.go index 371a7aea3..e26ff1194 100644 --- a/kyaml/yaml/kfns_test.go +++ b/kyaml/yaml/kfns_test.go @@ -74,8 +74,6 @@ data: if err != nil { t.Fatalf("unexpected error %v", err) } - output := rn.MustString() - expected := `apiVersion: v1 kind: ConfigMap data: @@ -84,7 +82,7 @@ metadata: labels: foo: 'bar' ` - if output != expected { + if output := rn.MustString(); output != expected { t.Fatalf("expected \n%s\nbut got \n%s\n", expected, output) } } @@ -102,7 +100,6 @@ data: if err != nil { t.Fatalf("unexpected error %v", err) } - output := rn.MustString() expected := `apiVersion: v1 kind: ConfigMap @@ -114,7 +111,7 @@ data: altGreeting: "Good Morning!" enableRisky: "false" ` - if output != expected { + if output := rn.MustString(); output != expected { t.Fatalf("expected \n%s\nbut got \n%s\n", expected, output) } } diff --git a/kyaml/yaml/match.go b/kyaml/yaml/match.go index a7cdf83d8..d53f563d6 100644 --- a/kyaml/yaml/match.go +++ b/kyaml/yaml/match.go @@ -99,7 +99,6 @@ func (p *PathMatcher) filter(rn *RNode) (*RNode, error) { } func (p *PathMatcher) doMatchEvery(rn *RNode) (*RNode, error) { - if err := rn.VisitElements(p.visitEveryElem); err != nil { return nil, err } @@ -108,7 +107,6 @@ func (p *PathMatcher) doMatchEvery(rn *RNode) (*RNode, error) { } func (p *PathMatcher) visitEveryElem(elem *RNode) error { - fieldName := p.Path[0] // recurse on the matching element pm := &PathMatcher{Path: p.Path[1:]} diff --git a/kyaml/yaml/rnode_test.go b/kyaml/yaml/rnode_test.go index d308efed2..bb9398734 100644 --- a/kyaml/yaml/rnode_test.go +++ b/kyaml/yaml/rnode_test.go @@ -1168,7 +1168,6 @@ items: assert.NotNil(t, err) assert.Equal(t, tc.expectedErr.Error(), err.Error()) } - }) } } @@ -2181,8 +2180,7 @@ func TestRoundTripJSON(t *testing.T) { if err != nil { t.Fatalf("unexpected MarshalJSON err: %v", err) } - actual := string(data) - if actual != deploymentLittleJson { + if actual := string(data); actual != deploymentLittleJson { t.Fatalf("expected %s, got %s", deploymentLittleJson, actual) } } diff --git a/kyaml/yaml/types_test.go b/kyaml/yaml/types_test.go index ab2f4e465..7497a094d 100644 --- a/kyaml/yaml/types_test.go +++ b/kyaml/yaml/types_test.go @@ -32,8 +32,7 @@ func TestCopyYNode(t *testing.T) { Line: 7000, Column: 8000, } - ynAddr := &yn - if !reflect.DeepEqual(&yn, ynAddr) { + if ynAddr := &yn; !reflect.DeepEqual(&yn, ynAddr) { t.Fatalf("truly %v should equal %v", &yn, ynAddr) } ynC := CopyYNode(&yn) diff --git a/kyaml/yaml/util.go b/kyaml/yaml/util.go index dc7880781..8c9439342 100644 --- a/kyaml/yaml/util.go +++ b/kyaml/yaml/util.go @@ -67,5 +67,4 @@ func keyLineBeforeSeqElem(lines []string, seqElemIndex int) string { return parts[0] // throw away the trailing comment part } return "" - } diff --git a/plugin/builtin/annotationstransformer/go.mod b/plugin/builtin/annotationstransformer/go.mod index f49ee6594..dbe3c9772 100644 --- a/plugin/builtin/annotationstransformer/go.mod +++ b/plugin/builtin/annotationstransformer/go.mod @@ -3,8 +3,6 @@ module sigs.k8s.io/kustomize/plugin/builtin/annotationstransformer go 1.16 require ( - github.com/PuerkitoBio/purell v1.1.1 // indirect - golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect sigs.k8s.io/kustomize/api v0.8.9 sigs.k8s.io/yaml v1.2.0 ) diff --git a/plugin/builtin/annotationstransformer/go.sum b/plugin/builtin/annotationstransformer/go.sum index 5916f6cf2..5c24b2765 100644 --- a/plugin/builtin/annotationstransformer/go.sum +++ b/plugin/builtin/annotationstransformer/go.sum @@ -604,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/configmapgenerator/go.sum b/plugin/builtin/configmapgenerator/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/configmapgenerator/go.sum +++ b/plugin/builtin/configmapgenerator/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/hashtransformer/go.sum b/plugin/builtin/hashtransformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/hashtransformer/go.sum +++ b/plugin/builtin/hashtransformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go b/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go index aeeb13164..83c896b9d 100644 --- a/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go +++ b/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go @@ -472,7 +472,7 @@ func TestHelmChartInflationGeneratorWithIncludeCRDs(t *testing.T) { // and has backticks, which makes string literals wonky testData, err := ioutil.ReadFile("include_crds_testdata.txt") if err != nil { - t.Errorf("unable to read test data for includeCRDs: %w", err) + t.Error(fmt.Errorf("unable to read test data for includeCRDs: %w", err)) } rm := th.LoadAndRunGenerator(` diff --git a/plugin/builtin/helmchartinflationgenerator/go.sum b/plugin/builtin/helmchartinflationgenerator/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/helmchartinflationgenerator/go.sum +++ b/plugin/builtin/helmchartinflationgenerator/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/iampolicygenerator/go.sum b/plugin/builtin/iampolicygenerator/go.sum index 2a378810d..fbb5f03cd 100644 --- a/plugin/builtin/iampolicygenerator/go.sum +++ b/plugin/builtin/iampolicygenerator/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -441,8 +440,8 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -604,8 +603,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/imagetagtransformer/go.sum b/plugin/builtin/imagetagtransformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/imagetagtransformer/go.sum +++ b/plugin/builtin/imagetagtransformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/labeltransformer/go.mod b/plugin/builtin/labeltransformer/go.mod index 3fd951caa..644acacf2 100644 --- a/plugin/builtin/labeltransformer/go.mod +++ b/plugin/builtin/labeltransformer/go.mod @@ -3,8 +3,6 @@ module sigs.k8s.io/kustomize/plugin/builtin/labeltransformer go 1.16 require ( - github.com/PuerkitoBio/purell v1.1.1 // indirect - golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect sigs.k8s.io/kustomize/api v0.8.9 sigs.k8s.io/yaml v1.2.0 ) diff --git a/plugin/builtin/labeltransformer/go.sum b/plugin/builtin/labeltransformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/labeltransformer/go.sum +++ b/plugin/builtin/labeltransformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/legacyordertransformer/go.sum b/plugin/builtin/legacyordertransformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/legacyordertransformer/go.sum +++ b/plugin/builtin/legacyordertransformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/namespacetransformer/go.sum b/plugin/builtin/namespacetransformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/namespacetransformer/go.sum +++ b/plugin/builtin/namespacetransformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/patchjson6902transformer/go.mod b/plugin/builtin/patchjson6902transformer/go.mod index 03d34e3e2..dafc0863d 100644 --- a/plugin/builtin/patchjson6902transformer/go.mod +++ b/plugin/builtin/patchjson6902transformer/go.mod @@ -3,10 +3,8 @@ module sigs.k8s.io/kustomize/plugin/builtin/patchjson6902transformer go 1.16 require ( - github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/evanphx/json-patch v4.11.0+incompatible github.com/pkg/errors v0.9.1 - golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect sigs.k8s.io/kustomize/api v0.8.9 sigs.k8s.io/kustomize/kyaml v0.13.6 sigs.k8s.io/yaml v1.2.0 diff --git a/plugin/builtin/patchjson6902transformer/go.sum b/plugin/builtin/patchjson6902transformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/patchjson6902transformer/go.sum +++ b/plugin/builtin/patchjson6902transformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/patchstrategicmergetransformer/go.sum b/plugin/builtin/patchstrategicmergetransformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/patchstrategicmergetransformer/go.sum +++ b/plugin/builtin/patchstrategicmergetransformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/patchtransformer/go.sum b/plugin/builtin/patchtransformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/patchtransformer/go.sum +++ b/plugin/builtin/patchtransformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/prefixtransformer/go.sum b/plugin/builtin/prefixtransformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/prefixtransformer/go.sum +++ b/plugin/builtin/prefixtransformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/replacementtransformer/go.sum b/plugin/builtin/replacementtransformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/replacementtransformer/go.sum +++ b/plugin/builtin/replacementtransformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/replicacounttransformer/go.sum b/plugin/builtin/replicacounttransformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/replicacounttransformer/go.sum +++ b/plugin/builtin/replicacounttransformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/secretgenerator/go.mod b/plugin/builtin/secretgenerator/go.mod index 1fd6ee963..651d4b2cb 100644 --- a/plugin/builtin/secretgenerator/go.mod +++ b/plugin/builtin/secretgenerator/go.mod @@ -3,8 +3,6 @@ module sigs.k8s.io/kustomize/plugin/builtin/secretgenerator go 1.16 require ( - github.com/PuerkitoBio/purell v1.1.1 // indirect - golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect sigs.k8s.io/kustomize/api v0.8.9 sigs.k8s.io/yaml v1.2.0 ) diff --git a/plugin/builtin/secretgenerator/go.sum b/plugin/builtin/secretgenerator/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/secretgenerator/go.sum +++ b/plugin/builtin/secretgenerator/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/suffixtransformer/go.sum b/plugin/builtin/suffixtransformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/suffixtransformer/go.sum +++ b/plugin/builtin/suffixtransformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/builtin/valueaddtransformer/go.sum b/plugin/builtin/valueaddtransformer/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/builtin/valueaddtransformer/go.sum +++ b/plugin/builtin/valueaddtransformer/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/someteam.example.com/v1/bashedconfigmap/go.sum b/plugin/someteam.example.com/v1/bashedconfigmap/go.sum index 5916f6cf2..5c24b2765 100644 --- a/plugin/someteam.example.com/v1/bashedconfigmap/go.sum +++ b/plugin/someteam.example.com/v1/bashedconfigmap/go.sum @@ -604,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/someteam.example.com/v1/calvinduplicator/go.sum b/plugin/someteam.example.com/v1/calvinduplicator/go.sum index 5916f6cf2..5c24b2765 100644 --- a/plugin/someteam.example.com/v1/calvinduplicator/go.sum +++ b/plugin/someteam.example.com/v1/calvinduplicator/go.sum @@ -604,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/someteam.example.com/v1/dateprefixer/go.mod b/plugin/someteam.example.com/v1/dateprefixer/go.mod index 7d570efd6..bb3629662 100644 --- a/plugin/someteam.example.com/v1/dateprefixer/go.mod +++ b/plugin/someteam.example.com/v1/dateprefixer/go.mod @@ -3,9 +3,7 @@ module sigs.k8s.io/kustomize/plugin/someteam.example.com/v1/dateprefixer go 1.16 require ( - github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/pkg/errors v0.9.1 - golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect sigs.k8s.io/kustomize/api v0.8.9 sigs.k8s.io/yaml v1.2.0 ) diff --git a/plugin/someteam.example.com/v1/dateprefixer/go.sum b/plugin/someteam.example.com/v1/dateprefixer/go.sum index 5f42ae153..5c24b2765 100644 --- a/plugin/someteam.example.com/v1/dateprefixer/go.sum +++ b/plugin/someteam.example.com/v1/dateprefixer/go.sum @@ -125,6 +125,7 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -160,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -441,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -605,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/someteam.example.com/v1/printpluginenv/go.sum b/plugin/someteam.example.com/v1/printpluginenv/go.sum index 5916f6cf2..5c24b2765 100644 --- a/plugin/someteam.example.com/v1/printpluginenv/go.sum +++ b/plugin/someteam.example.com/v1/printpluginenv/go.sum @@ -604,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/someteam.example.com/v1/secretsfromdatabase/go.sum b/plugin/someteam.example.com/v1/secretsfromdatabase/go.sum index 380dde078..5c24b2765 100644 --- a/plugin/someteam.example.com/v1/secretsfromdatabase/go.sum +++ b/plugin/someteam.example.com/v1/secretsfromdatabase/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,7 +441,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -606,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/someteam.example.com/v1/sedtransformer/go.sum b/plugin/someteam.example.com/v1/sedtransformer/go.sum index 5916f6cf2..5c24b2765 100644 --- a/plugin/someteam.example.com/v1/sedtransformer/go.sum +++ b/plugin/someteam.example.com/v1/sedtransformer/go.sum @@ -604,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/someteam.example.com/v1/someservicegenerator/go.sum b/plugin/someteam.example.com/v1/someservicegenerator/go.sum index 5916f6cf2..5c24b2765 100644 --- a/plugin/someteam.example.com/v1/someservicegenerator/go.sum +++ b/plugin/someteam.example.com/v1/someservicegenerator/go.sum @@ -604,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/someteam.example.com/v1/starlarkmixer/go.sum b/plugin/someteam.example.com/v1/starlarkmixer/go.sum index 5916f6cf2..5c24b2765 100644 --- a/plugin/someteam.example.com/v1/starlarkmixer/go.sum +++ b/plugin/someteam.example.com/v1/starlarkmixer/go.sum @@ -604,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/someteam.example.com/v1/stringprefixer/go.sum b/plugin/someteam.example.com/v1/stringprefixer/go.sum index 5916f6cf2..5c24b2765 100644 --- a/plugin/someteam.example.com/v1/stringprefixer/go.sum +++ b/plugin/someteam.example.com/v1/stringprefixer/go.sum @@ -604,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/someteam.example.com/v1/validator/go.sum b/plugin/someteam.example.com/v1/validator/go.sum index 5916f6cf2..5c24b2765 100644 --- a/plugin/someteam.example.com/v1/validator/go.sum +++ b/plugin/someteam.example.com/v1/validator/go.sum @@ -604,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/plugin/untested/v1/gogetter/go.sum b/plugin/untested/v1/gogetter/go.sum index 61d0421e6..5c24b2765 100644 --- a/plugin/untested/v1/gogetter/go.sum +++ b/plugin/untested/v1/gogetter/go.sum @@ -161,7 +161,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -442,8 +441,8 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -605,8 +604,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=