* 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>
* feat(multicluster): Enhance unit test coverage for multicluster utilities
This commit introduces a comprehensive suite of unit tests for the multicluster management functions in pkg/multicluster.
Key changes include:
- `cluster_management_test.go`: Improves the structure of TestDetachCluster and TestRenameCluster by organizing test cases into a collection, which enhances clarity and
simplifies adding new scenarios.
- `utils_test.go` and `virtual_cluster_test.go`: Adds new test cases to validate additional utility and virtual cluster helper functions, increasing overall test
coverage.
These additions improve the overall test coverage and ensure the correctness and reliability of multicluster operations.
Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
* feat(multicluster): Add unit tests for multicluster workflow provider
This commit introduces new unit tests for the multicluster workflow provider located in pkg/workflow/providers/multicluster.
Key additions include:
- Comprehensive tests for the Deploy workflow step, covering parameter validation, error handling, and successful deployment scenarios.
- New tests for GetPlacementsFromTopologyPolicies to ensure correct placement resolution from topology policies, including error cases and default behaviors.
These additions improve the test coverage and ensure the robustness of the multicluster workflow provider.
Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
* fix(multicluster): Correct duplicate import in utils_test.go
This commit resolves a linting error (ST1019) in pkg/multicluster/utils_test.go caused by the k8s.io/api/core/v1 package being imported twice with different aliases (v1
and corev1).
The redundant import alias v1 has been removed, and the corresponding type reference for []v1.Secret has been updated to []corev1.Secret to maintain consistency.
Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
* test(multicluster): fix cross-test side effects
The TestListExistingClusterSecrets function mutates the global
variable ClusterGatewaySecretNamespace without restoring its original
value. This can lead to unpredictable behavior in other tests that
rely on this variable.
This commit fixes the issue by saving the value of
ClusterGatewaySecretNamespace before the test runs and restoring it
afterward using a defer statement.
Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
* test(multicluster): remove redundant test case in TestContext
The `TestContextWithClusterName` sub-test in `TestContext` is redundant, as its functionality is already covered by the more comprehensive `TestClusterNameInContext` sub-test.
This commit removes the unnecessary test to improve the clarity and maintainability of the test suite without sacrificing coverage.
Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
---------
Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
* fix: check component status after initial deployment
Signed-off-by: Brian Kane <briankane1@gmail.com>
* Fix: applications should correctly reflect component health throughout the apps lifecycle
Signed-off-by: Brian Kane <briankane1@gmail.com>
* Fix: check component status after initial deployment
Signed-off-by: Brian Kane <briankane1@gmail.com>
---------
Signed-off-by: Brian Kane <briankane1@gmail.com>
Co-authored-by: Mikhail Elenskii <elenskii-mikhail@outlook.com>
* Feat: change the default workflow step with deploy type
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: format the cue script of the deploy step
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: unit test case
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
* Fix: error words
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>