diff --git a/api/Makefile b/api/Makefile index 1c10c3ffa..e9f44059b 100644 --- a/api/Makefile +++ b/api/Makefile @@ -11,3 +11,18 @@ build: generate: $(MYGOBIN)/k8scopy $(MYGOBIN)/stringer go generate ./... + +lint: lint-api-static + +## lint-api-static runs the linter on the API module +## with build-tag kustomize_disable_go_plugin_support +## this aims to catch any issues with the API module +## that would prevent the API module from being used +## when the go plugin support is disabled. +lint-api-static: + $(MYGOBIN)/golangci-lint cache clean # Workaround for https://github.com/golangci/golangci-lint/issues/3228 + $(MYGOBIN)/golangci-lint \ + -c $$KUSTOMIZE_ROOT/.golangci.yml \ + --build-tags kustomize_disable_go_plugin_support \ + --path-prefix api \ + run ./... diff --git a/api/internal/plugins/loader/load_go_plugin_disabled.go b/api/internal/plugins/loader/load_go_plugin_disabled.go index 654e22da3..5531b7967 100644 --- a/api/internal/plugins/loader/load_go_plugin_disabled.go +++ b/api/internal/plugins/loader/load_go_plugin_disabled.go @@ -14,11 +14,12 @@ package loader import ( + "fmt" + "sigs.k8s.io/kustomize/api/resmap" - "sigs.k8s.io/kustomize/kyaml/errors" "sigs.k8s.io/kustomize/kyaml/resid" ) func (l *Loader) loadGoPlugin(_ resid.ResId, _ string) (resmap.Configurable, error) { - return nil, errors.New("plugin load is disabled") + return nil, fmt.Errorf("plugin load is disabled") }