Files
kubevela/pkg/workflow/providers
Vishal Kumar d7f67354f8 Feat: Added new deploy-components workflow step (#7213)
* feat(workflow): add deploy-components step for per-component multi-cluster targeting

Adds a pure-CUE workflow-step definition that lets each component in an
Application resolve its own target cluster(s) via topology policies,
filling the gap between apply-component (single component, static
cluster) and deploy (all components, cross-product against policies).

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* chore(workflow): add rendered deploy-components WorkflowStepDefinition manifest

Generated from vela-templates/definitions/internal/workflowstep/deploy-components.cue
via make def-install, for installation as part of the vela-core Helm chart.

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* test(e2e): add multicluster e2e for deploy-components step

Covers per-component topology-policy targeting (each component lands only
on its resolved cluster, no cross-product) and fast-fail validation when a
referenced component name is not present in the application.

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* docs(workflow): add example doc for deploy-components step

Required by the definition-doc CI check for any new WorkflowStepDefinition.

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* fix(workflow): normalize deploy-components import block to grouped form

The rendered manifest was generated with flat "import X" lines; the
project's CUE formatter (as used by CI's make reviewable) renders
multi-import blocks grouped as import (...). Fixes the check-diff CI job.

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* fix(workflow): gate deploy-components applies on validation to prevent partial rollout

Previously, _missingComponents was derived from deploy's own realized keys,
which meant an invalid component name could only be detected after applies
for valid components had already started -- a partial rollout on failure.

Compute _missingComponents directly from the loaded component set instead
(via iteration, matching the pattern deploy itself already uses reliably --
an indexed lookup against the same field was empirically found to evaluate
before the load task resolves, causing false positives), and wrap deploy in
an if-guard so no component is applied unless every referenced name is
valid. Verified against a live multicluster setup: the negative case now
applies zero resources before failing, and the positive case is unaffected.

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* style(workflow): tighten deploy-components comments

Comments narrated the debugging history behind each constraint; state
them as plain engineering facts instead.

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* fix(workflow): correct mistyped #do string in multicluster.#GetPlacementsFromTopologyPolicies

The exported CUE symbol's #do value ("get-placements-from-tmulticlusterology-policies")
never matched the registered provider handler key ("get-placements-from-topology-policies"),
making it unusable by any CUE template. Fix the string and rename the symbol
to match. Unused elsewhere in the tree, so no other callers are affected.

deploy-components keeps its own local copy (for backport safety) but now
documents that it mirrors the corrected symbol.

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* refactor(workflow): use the shared topology-placement symbol in deploy-components

Now that multicluster.#GetPlacementsFromTopologyPolicies is fixed, drop the
local #GetPlacements duplicate and reference the shared symbol directly.
deploy-components is new in this release, so there's no backport scenario
where it could ship without the fix landing alongside it.

Verified against a live multicluster controller build: positive case
resolves placements and applies correctly, negative case still gates
deploy on validation with zero partial rollout.

Signed-off-by: vishal210893 <vishal210893@gmail.com>

---------

Signed-off-by: vishal210893 <vishal210893@gmail.com>
2026-07-03 14:35:11 +01:00
..