From 56772595e49b1f37d7ad6f4237b590dd470b734e Mon Sep 17 00:00:00 2001 From: fl-sean03 Date: Fri, 27 Feb 2026 05:50:49 +0000 Subject: [PATCH] fix: document int32/int64 CRD format annotations as valid (no stripping) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Re: EItanya's review — "what do other kube native projects do?" Researched cert-manager, Istio, Crossplane, Argo CD, KEDA, and Knative. None of them strip format: int32/int64 from their CRDs. These are valid OpenAPI 3.0 format values that controller-gen emits based on Go types. The Kubernetes warnings about unrecognized formats were a bug in the apiserver (kubernetes/kubernetes#133880), fixed in v1.34.1+ (kubernetes/kubernetes#133896). The fix restricts format warnings to string-type properties only, since format validation is only semantically meaningful for strings in JSON Schema. The controller-tools maintainers themselves tried removing these format values (kubernetes-sigs/controller-tools#1274) but reverted within 24 hours (kubernetes-sigs/controller-tools#1275) because they are part of the OpenAPI spec. Previous approach in this PR stripped the annotations via sed/perl post-processing. This revision removes all stripping logic and instead adds a brief explanatory comment in the Makefile for future contributors who encounter these warnings on older K8s versions. Signed-off-by: opspawn Signed-off-by: fl-sean03 --- go/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go/Makefile b/go/Makefile index 9533342b1..4671e591b 100644 --- a/go/Makefile +++ b/go/Makefile @@ -24,6 +24,8 @@ help: ## list makefile targets .PHONY: manifests manifests: controller-gen generate ## Generate ClusterRole and CustomResourceDefinition objects. $(CONTROLLER_GEN) rbac:roleName=manager-role crd paths="./..." output:crd:artifacts:config=config/crd/bases + @# controller-gen emits format: int32/int64 — these are valid OpenAPI values. + @# K8s warnings about them were a bug, fixed in v1.34.1+ (kubernetes/kubernetes#133896). .PHONY: generate generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.