@@ -140,11 +140,21 @@ codegen-schema-openapi: $(KIND) $(HELM) ## Generate openapi schemas (v2 and v3)
140
140
@kubectl get --raw /openapi/v3/apis/admissionregistration.k8s.io/v1 > ./schemas/openapi/v3/apis/admissionregistration.k8s.io/v1.json
141
141
@$(KIND ) delete cluster --name schema
142
142
143
+ .PHONY : codegen-schema-json
144
+ codegen-schema-json : codegen-schema-openapi # # Generate json schemas
145
+ @rm -rf ./schemas/json
146
+ @mkdir -p ./schemas/json
147
+ @chmod 777 ./schemas/json
148
+ @docker run --rm --name openapi2jsonschema --mount type=bind,source=" $( PWD) " /schemas/openapi/v3,target=/v3 --mount type=bind,source=" $( PWD) " /schemas/json,target=/json ghcr.io/fjogeleit/openapi2jsonschema:master /v3/apis/kyverno.io/v1.json --kubernetes --stand-alone --expanded -o /json/v3
149
+ @docker run --rm --name openapi2jsonschema --mount type=bind,source=" $( PWD) " /schemas/openapi/v3,target=/v3 --mount type=bind,source=" $( PWD) " /schemas/json,target=/json ghcr.io/fjogeleit/openapi2jsonschema:master /v3/apis/kyverno.io/v2beta1.json --kubernetes --stand-alone --expanded -o /json/v3
150
+ @docker run --rm --name openapi2jsonschema --mount type=bind,source=" $( PWD) " /schemas/openapi/v3,target=/v3 --mount type=bind,source=" $( PWD) " /schemas/json,target=/json ghcr.io/fjogeleit/openapi2jsonschema:master /v3/apis/kyverno.io/v2.json --kubernetes --stand-alone --expanded -o /json/v3
151
+ @docker run --rm --name openapi2jsonschema --mount type=bind,source=" $( PWD) " /schemas/openapi/v3,target=/v3 --mount type=bind,source=" $( PWD) " /schemas/json,target=/json ghcr.io/fjogeleit/openapi2jsonschema:master /v3/apis/admissionregistration.k8s.io/v1.json --kubernetes --stand-alone --expanded -o /json/v3
152
+
143
153
.PHONY : codegen-all
144
- codegen-all : codegen-helm-docs codegen-schema-openapi # # Generate all codegen
154
+ codegen-all : codegen-helm-docs codegen-schema-json # # Generate all codegen
145
155
146
156
.PHONY : verify-schemas
147
- verify-schemas : codegen-schema-openapi # # Check openapi and json schemas are up to date
157
+ verify-schemas : codegen-schema-json # # Check openapi and json schemas are up to date
148
158
@echo Checking openapi schemas are up to date... >&2
149
159
@git --no-pager diff -- schemas
150
160
@echo ' If this test fails, it is because the git diff is non-empty after running "make codegen-schema-openapi".' >&2
@@ -160,7 +170,7 @@ verify-helm-docs: codegen-helm-docs ## Check Helm charts are up to date
160
170
@git diff --quiet --exit-code -- charts
161
171
162
172
.PHONY : verify-codegen
163
- verify-codegen : verify-helm-docs # # Verify all generated code and docs are up to date
173
+ verify-codegen : verify-helm-docs verify-schemas # # Verify all generated code and docs are up to date
164
174
165
175
# ########
166
176
# BUILD #
0 commit comments