From 46494307ca42557110992d42ef1ca20eaa53d2d7 Mon Sep 17 00:00:00 2001 From: Arsolitt Date: Wed, 20 May 2026 13:51:15 +0300 Subject: [PATCH] build(kafka): assert *bool patch applied in Makefile generate target Add a hard assertion after the sed substitution so the build fails immediately if cozyvalues-gen output format changes and the patch silently no-ops, instead of letting an incorrect non-pointer type slip through. Assisted-By: Claude Signed-off-by: Arsolitt --- packages/apps/kafka/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/apps/kafka/Makefile b/packages/apps/kafka/Makefile index cb3e87a8f..00baff300 100644 --- a/packages/apps/kafka/Makefile +++ b/packages/apps/kafka/Makefile @@ -4,6 +4,7 @@ PRESET_ENUM := ["nano","micro","small","medium","large","xlarge","2xlarge"] generate: cozyvalues-gen -m 'kafka' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/kafka/types.go sed -i 's/Enabled bool `json:"enabled,omitempty"`/Enabled *bool `json:"enabled,omitempty"`/' ../../../api/apps/v1alpha1/kafka/types.go + grep -q 'Enabled \*bool `json:"enabled,omitempty"`' ../../../api/apps/v1alpha1/kafka/types.go || (echo "ERROR: failed to patch TLS.Enabled to *bool in types.go" && exit 1) jq '.properties.tls.properties.enabled.type = ["boolean", "null"]' values.schema.json > values.schema.json.tmp && mv values.schema.json.tmp values.schema.json jq -e '.properties.tls.properties.enabled.type == ["boolean", "null"]' values.schema.json > /dev/null || (echo "ERROR: jq patch failed" && exit 1) ../../../hack/update-crd.sh