Skip to content

Commit d63f82e

Browse files
committed
build(postgres): assert schema shape before patching tls.enabled.type
Add a precondition that fails early if cozyvalues-gen no longer emits tls.enabled.type as the bare "boolean" string the patch step expects. Without the guard, a generator output that drops or moves the field would silently create it via the assignment, and the post-patch equality check would still pass against the synthetic value. Signed-off-by: Arsolitt <[email protected]>
1 parent 051731c commit d63f82e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎packages/apps/postgres/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ generate:
44
cozyvalues-gen -m 'postgresql' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/postgresql/types.go
55
# Patch tls.enabled to be nullable (cozyvalues-gen emits "type": "boolean" only;
66
# we need ["boolean","null"] for the tri-state).
7+
jq -e '.properties.tls.properties.enabled.type == "boolean"' values.schema.json > /dev/null || (echo "ERROR: expected cozyvalues-gen to emit tls.enabled.type as \"boolean\" before patching — output may have drifted" && exit 1)
78
jq '.properties.tls.properties.enabled.type = ["boolean", "null"]' values.schema.json > values.schema.json.tmp && mv values.schema.json.tmp values.schema.json
89
jq -e '.properties.tls.properties.enabled.type == ["boolean", "null"]' values.schema.json > /dev/null || (echo "ERROR: jq patch for tls.enabled.type failed — cozyvalues-gen output may have drifted" && exit 1)
910
../../../hack/update-crd.sh

0 commit comments

Comments
 (0)