Fix: make apply-job, read-app and apply-terraform-provider pass vela-…
Merged
VA
4d ago+16+16+01234567890123456789-6-6-0123456789
Description of your changes
KubeVela v1.12.0-alpha.1 validates WorkflowStepDefinition CUE templates at admission (kubevela/kubevela#7325). Three step definitions in the vela-workflow chart fail that check, so installing or upgrading the chart against vela-core 1.12 is rejected. This PR fixes them:
read-app: removes the unusedencoding/yamlimport.apply-terraform-provider: removes the unusedstringsimport.apply-job: readsapply.value.status/apply.value.specinstead ofapply.status/apply.spec.op.#Applyreturns the applied object undervalue, so the old fields never existed. The conditions are guarded with!= _|_checks socontinueis always a plain boolean.
The apply-job change also fixes a runtime bug that predates 1.12. With v0.7.2, every step using apply-job failed immediately with invalid cue task for evaluation: getNodeContext: nodeContext out of sync, even when the Job succeeded.
Fixes #277
I have:
- Read and followed KubeVela's contribution process.
- Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
- Run
make reviewableto ensure this PR is ready for review. - Added
backport release-x.ylabels to auto-backport this PR if necessary.
How has this code been tested
- Admission validation: ran every WorkflowStepDefinition in
charts/vela-workflow/templates/definitionsthroughValidateWorkflowStepCuexTemplatefrom kubevela (the function behind the 1.12 webhook). Before: 21 pass, 3 fail. After: 24 pass. - End to end on k3d (Kubernetes v1.31.5): vela-core 1.12.0-alpha.1, plus the vela-workflow v0.7.2 chart and image with only these three files replaced. The chart installs cleanly.
Summary by cubic
Fixes CUE validation failures in apply-job, read-app, and apply-terraform-provider against vela-core 1.12, plus a pre-existing runtime bug in apply-job.
apply-jobguards reads ofapply.value.statusandapply.value.spec.completionswith!= _|_checks, so unset fields no longer fail the step or raise the "nodeContext out of sync" error on v0.7.2.- Removes the unused
stringsandencoding/yamlimports.