File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ CONTROLLER ?= $(GO) tool sigs.k8s.io/controller-tools/cmd/controller-gen
1414# Run tests using the latest tools.
1515CHAINSAW ?= $(GO ) run github.com/kyverno/chainsaw@latest
1616CHAINSAW_TEST ?= $(CHAINSAW ) test
17+ CRD_CHECKER ?= $(GO ) run github.com/openshift/crd-schema-checker/cmd/crd-schema-checker@latest
1718ENVTEST ?= $(GO ) run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
1819KUTTL ?= $(GO ) run github.com/kudobuilder/kuttl/cmd/kubectl-kuttl@latest
1920KUTTL_TEST ?= $(KUTTL ) test
@@ -148,6 +149,12 @@ check: ## Run basic go tests with coverage output
148149check : get-pgmonitor
149150 QUERIES_CONFIG_DIR=" $( CURDIR) /${QUERIES_CONFIG_DIR} " $(GO_TEST ) -cover ./...
150151
152+ # Informational only; no criteria to enforce at this time.
153+ .PHONY : check-crd
154+ check-crd :
155+ $(foreach CRD, $(wildcard config/crd/bases/* .yaml) , \
156+ $(CRD_CHECKER ) check-manifests --new-crd-filename ' $(CRD)' 2>&1 | awk -f hack/check-manifests.awk $(newline ) )
157+
151158# Available versions: curl -s 'https://storage.googleapis.com/kubebuilder-tools/' | grep -o '<Key>[^<]*</Key>'
152159# - KUBEBUILDER_ATTACH_CONTROL_PLANE_OUTPUT=true
153160.PHONY : check-envtest
@@ -254,3 +261,9 @@ generate-rbac: ## Generate RBAC
254261 ) rbac:roleName=' postgres-operator' $(\
255262 ) paths=' ./cmd/...' paths=' ./internal/...' $(\
256263 ) output:dir=' config/rbac' # {directory}/role.yaml
264+
265+ # https://www.gnu.org/software/make/manual/make.html#Multi_002dLine
266+ define newline
267+
268+
269+ endef
Original file line number Diff line number Diff line change 1+ # Copyright 2025 Crunchy Data Solutions, Inc.
2+ #
3+ # SPDX-License-Identifier: Apache-2.0
4+
5+ ## TODO: Exit successfully only when there are no errors.
6+ #/^ERROR:/ { rc = 1 }
7+ #END { exit rc }
8+
9+ # Shorten these frequent messages about validation rules.
10+ /The maximum allowable value is 10000000[. ] / {
11+ sub (/ The maximum allowable value is 10000000. /, " " )
12+ sub (/ allowed budget /, " &, 10M" )
13+ }
14+
15+ # These are informational, but "MustNot" sounds like something is wrong.
16+ /^ info: "MustNotExceedCostBudget" / {
17+ sub (/"MustNotExceedCostBudget" /, " \" CostBudget\" " )
18+ }
19+
20+ # Color errors and warnings when attached to a terminal.
21+ ENVIRON [ " MAKE_TERMOUT" ] != " " {
22+ sub (/^ ERROR: /, " \033 [0;31m&\033 [0m" )
23+ sub (/^ Warning: /, " \033 [1;33m&\033 [0m" )
24+ }
25+
26+ { print }
You can’t perform that action at this time.
0 commit comments