From 5b8b5820125de5b4cdce087e69237075f162e293 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Fri, 22 Nov 2024 12:57:18 +0100 Subject: [PATCH] DNM:test make crd-schema-check --- .pre-commit-config.yaml | 1 + Makefile | 2 +- apis/bases/core.openstack.org_openstackcontrolplanes.yaml | 4 ++++ apis/core/v1beta1/openstackcontrolplane_types.go | 3 +++ .../bases/core.openstack.org_openstackcontrolplanes.yaml | 4 ++++ hack/crd-schema-checker.sh | 6 ++++++ 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56ad6d089..2c1c5fbd7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,6 +31,7 @@ repos: entry: make args: ['crd-schema-check'] pass_filenames: false + verbose: true - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 diff --git a/Makefile b/Makefile index 427fdc11d..e99527156 100644 --- a/Makefile +++ b/Makefile @@ -481,4 +481,4 @@ webhook-cleanup: PHONY: crd-schema-check crd-schema-check: manifests INSTALL_DIR=$(LOCALBIN) CRD_SCHEMA_CHECKER_VERSION=release-4.16 hack/build-crd-schema-checker.sh - INSTALL_DIR=$(LOCALBIN) BRANCH=$(BRANCH) hack/crd-schema-checker.sh + INSTALL_DIR=$(LOCALBIN) BRANCH="$${PULL_BASE_SHA:-$(BRANCH)}" hack/crd-schema-checker.sh diff --git a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml index 669280c40..09eb2afed 100644 --- a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -10879,6 +10879,8 @@ spec: format: int32 minimum: 0 type: integer + foo: + type: integer nodeSelector: additionalProperties: type: string @@ -14696,6 +14698,8 @@ spec: type: string type: object type: array + required: + - foo type: object type: object type: object diff --git a/apis/core/v1beta1/openstackcontrolplane_types.go b/apis/core/v1beta1/openstackcontrolplane_types.go index 6add4f982..b46408cdb 100644 --- a/apis/core/v1beta1/openstackcontrolplane_types.go +++ b/apis/core/v1beta1/openstackcontrolplane_types.go @@ -511,6 +511,9 @@ type RabbitmqTemplate struct { // +operator-sdk:csv:customresourcedefinitions:type=spec // NodeSelector to target subset of worker nodes running this service NodeSelector *map[string]string `json:"nodeSelector,omitempty"` + + // +kubebuilder:validation:Required + Foo int `json:"foo"` } // OvnSection defines the desired state of OVN services diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index 669280c40..09eb2afed 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -10879,6 +10879,8 @@ spec: format: int32 minimum: 0 type: integer + foo: + type: integer nodeSelector: additionalProperties: type: string @@ -14696,6 +14698,8 @@ spec: type: string type: object type: array + required: + - foo type: object type: object type: object diff --git a/hack/crd-schema-checker.sh b/hack/crd-schema-checker.sh index 284e688cc..2bde46736 100755 --- a/hack/crd-schema-checker.sh +++ b/hack/crd-schema-checker.sh @@ -11,6 +11,12 @@ function cleanup { trap cleanup EXIT +git remote -v || true + +git --no-pager branch -lr || true + +git log --oneline | head -n 10 || true + for crd in config/crd/bases/*.yaml; do mkdir -p "$(dirname "$TMP_DIR/$crd")"