mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-09 14:02:56 +09:00
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 <noreply@anthropic.com> Signed-off-by: Arsolitt <arsolitt@gmail.com>
This commit is contained in:
1 file changed
+1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user