diff --git a/build/root/Makefile.generated_files b/build/root/Makefile.generated_files index 8e4eab05317..cce8b60cbad 100644 --- a/build/root/Makefile.generated_files +++ b/build/root/Makefile.generated_files @@ -404,7 +404,7 @@ OPENAPI_FILENAME := $(OPENAPI_BASENAME).go OPENAPI_OUTPUT_PKG := pkg/generated/openapi BOILERPLATE_FILENAME := vendor/k8s.io/code-generator/hack/boilerplate.go.txt REPORT_FILENAME := $(OUT_DIR)/violations.report -KNOWN_VIOLATION_FILENAME := hack/testdata/api-rules/violations.report +KNOWN_VIOLATION_FILENAME := hack/testdata/api-rules/violation_exceptions.list API_RULE_CHECK_FAILURE_MESSAGE := "Error: API rules check failed. Reported violations \"$(REPORT_FILENAME)\" differ from known violations \"$(KNOWN_VIOLATION_FILENAME)\". Please fix API source file if new violation is detected, or update known violations \"$(KNOWN_VIOLATION_FILENAME)\" if existing violation is being fixed. Please refer to hack/testdata/api-rules/README.md and https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators/rules for more information about the API rules being enforced." # The tool used to generate open apis. diff --git a/hack/testdata/api-rules/README.md b/hack/testdata/api-rules/README.md index 3db39936b41..caae1042430 100644 --- a/hack/testdata/api-rules/README.md +++ b/hack/testdata/api-rules/README.md @@ -1,10 +1,10 @@ ## Existing API Rule Violations This folder contains the checked-in report file of known API rule violations. -This report file violations.report is used by Make rule during OpenAPI spec generation to make +The file violation\_exceptions.list is used by Make rule during OpenAPI spec generation to make sure that no new API rule violation is introduced into our code base. -The report file [**violations.report**](./violations.report) is in format of: +The report file [violation\_exceptions.list](./violation_exceptions.list) is in format of: * ***API rule violation: \,\,\,\*** @@ -14,9 +14,9 @@ e.g. Make rule returns error when new generated violation report differs from this checked-in violation report. If new API rule violation is detected, please fix -the API Go source file to pass the API rule check. The entries in the checked-in +the API Go source file to pass the API rule check. **The entries in the checked-in violation report should only be removed when existing API rule violation is -being fixed, but not added. +being fixed, but not added.** For more information about the API rules being checked, please refer to https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators/rules diff --git a/hack/testdata/api-rules/violations.report b/hack/testdata/api-rules/violation_exceptions.list similarity index 100% rename from hack/testdata/api-rules/violations.report rename to hack/testdata/api-rules/violation_exceptions.list