diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e360b718c..330d07222 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -85,7 +85,7 @@ repos: files: "(.*\\.go|go.mod)$" args: - --license-filepath - - header.txt + - hack/license-header.txt - --comment-style - // - --use-current-year @@ -95,9 +95,8 @@ repos: files: (^Makefile|\.(ya?ml|mk))$ args: - --license-filepath - - header.txt + - hack/license-header.txt - --use-current-year - exclude: ^(pkg/addons/templates/.+\.yaml|charts/.+/templates/role\.yaml||charts/.+/crds/.+\.yaml)$ - id: insert-license name: License headers - Markdown stages: [commit] @@ -105,7 +104,7 @@ repos: exclude: ^CHANGELOG.md$ args: - --license-filepath - - header.txt + - hack/license-header.txt - --comment-style - - --use-current-year diff --git a/charts/capi-runtime-extensions/templates/role.yaml b/charts/capi-runtime-extensions/templates/role.yaml index fe4293106..de6fad97a 100644 --- a/charts/capi-runtime-extensions/templates/role.yaml +++ b/charts/capi-runtime-extensions/templates/role.yaml @@ -1,3 +1,5 @@ +# Copyright 2023 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole diff --git a/hack/boilerplate.go.txt b/hack/license-header.go.txt similarity index 100% rename from hack/boilerplate.go.txt rename to hack/license-header.go.txt diff --git a/header.txt b/hack/license-header.txt similarity index 100% rename from header.txt rename to hack/license-header.txt diff --git a/hack/license-header.yaml.txt b/hack/license-header.yaml.txt new file mode 100644 index 000000000..78c912b18 --- /dev/null +++ b/hack/license-header.yaml.txt @@ -0,0 +1,2 @@ +# Copyright 2023 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/make/go.mk b/make/go.mk index 46cb701cd..7845cea6a 100644 --- a/make/go.mk +++ b/make/go.mk @@ -177,10 +177,11 @@ go-fix.%: ; $(info $(M) go fixing $* module) go-generate: ## Runs go generate go-generate: ; $(info $(M) running go generate) go generate -x ./... - controller-gen rbac:roleName=capi-runtime-extensions-manager-role crd webhook paths="./..." \ - output:crd:artifacts:config=charts/capi-runtime-extensions/crds \ - output:rbac:artifacts:config=charts/capi-runtime-extensions/templates - controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..." + controller-gen \ + rbac:headerFile="hack/license-header.yaml.txt",roleName=capi-runtime-extensions-manager-role \ + object:headerFile="hack/license-header.go.txt" \ + output:rbac:artifacts:config=charts/capi-runtime-extensions/templates \ + paths="./..." $(MAKE) go-fix .PHONY: go-mod-upgrade