Skip to content

Commit 99dfaf6

Browse files
fix: remove kubeconform and kustomize validation for fragment output (#45)
Fragment files (kubernetes-workload-fragment.yaml, etc.) are schema documents with a wrapper object (e.g. { kind: "KubernetesWorkloadFragment", manifests: [...] }), not bare Kubernetes YAML with apiVersion at the root. Kubeconform and kustomize both require standard apiVersion/kind and always fail on this format, producing spurious E_KUBECONFORM_FAILED errors. Render correctness is enforced by the deploy-config-schema CLI itself during fragment rendering in step (8). Co-authored-by: JorisJonkers Agent <agents@jorisjonkers.dev>
1 parent 643a961 commit 99dfaf6

1 file changed

Lines changed: 10 additions & 27 deletions

File tree

actions/deploy-artifact/run.sh

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -243,34 +243,17 @@ main() {
243243
--out "out/metadata/${env}/kustomization-health.yml"
244244
done
245245

246-
# (9) Kubeconform validation
247-
if command -v kubeconform >/dev/null 2>&1; then
248-
kubeconform \
249-
-schema-location default \
250-
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' \
251-
-strict \
252-
out/manifests/ || {
253-
emit_gate_summary "deploy-artifact" "Deploy Artifact" "fail" \
254-
"kubeconform-failed" "none"
255-
fail "E_KUBECONFORM_FAILED"
256-
}
257-
fi
258-
259-
# (10) Kustomize build dry-run
260-
if command -v kustomize >/dev/null 2>&1; then
261-
for env in "${envs[@]}"; do
262-
kustomize build "out/manifests/${env}" --dry-run 2>&1 > /dev/null || {
263-
emit_gate_summary "deploy-artifact" "Deploy Artifact" "fail" \
264-
"kustomize-build-failed" "none"
265-
fail "E_KUSTOMIZE_BUILD_FAILED: env=${env}"
266-
}
267-
done
268-
fi
246+
# NOTE: steps 9 (kubeconform) and 10 (kustomize build dry-run) are intentionally
247+
# absent. Fragment output files (kubernetes-workload-fragment.yaml, etc.) are
248+
# schema documents wrapping K8s manifests (e.g. { kind: "KubernetesWorkloadFragment",
249+
# manifests: [...] }), not bare Kubernetes YAML. Kubeconform and kustomize both
250+
# expect standard apiVersion/kind at the top level and will always fail on this
251+
# format. Render correctness is guaranteed by the schema CLI in step (8).
269252

270-
# (11) Reject kind: Secret in rendered output
253+
# (9) Reject kind: Secret in rendered output
271254
reject_secret_kind "out/manifests/"
272255

273-
# (12) Validate raw manifests (only when raw-manifests enabled in deployment.yml)
256+
# (10) Validate raw manifests (only when raw-manifests enabled in deployment.yml)
274257
local has_raw_manifests_dir="${deploy_dir}/raw-manifests"
275258
if [[ -d "$has_raw_manifests_dir" ]]; then
276259
deploy-config-schema artifact validate-raw-manifests \
@@ -285,7 +268,7 @@ main() {
285268
}
286269
fi
287270

288-
# (13) Emit artifact contract (includes SC-9 render hash).
271+
# (11) Emit artifact contract (includes SC-9 render hash).
289272
# CLI: artifact emit-contract
290273
# --artifact-name <name>
291274
# --environments <e1,e2>
@@ -309,7 +292,7 @@ main() {
309292
--output-root out \
310293
--out out/artifact-contract.yaml
311294

312-
# (14) Export render-hash to GITHUB_OUTPUT (correction #8: also declared in outputs block)
295+
# (12) Export render-hash to GITHUB_OUTPUT (correction #8: also declared in outputs block)
313296
local render_hash
314297
render_hash=$(yq '.spec.renderHash' out/artifact-contract.yaml)
315298
if [[ -z "$render_hash" || "$render_hash" == "null" ]]; then

0 commit comments

Comments
 (0)