Feat: add new providers for config wf definitions#225
Merged
briankane merged 6 commits intokubevela:mainfrom Feb 10, 2026
Merged
Conversation
43e5e6b to
ca794aa
Compare
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (39.84%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #225 +/- ##
==========================================
+ Coverage 62.49% 67.60% +5.11%
==========================================
Files 62 65 +3
Lines 4415 5408 +993
==========================================
+ Hits 2759 3656 +897
- Misses 1324 1366 +42
- Partials 332 386 +54
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fe30b54 to
fc0afbf
Compare
- Added a new config management provider to handle CRUD operations for configs. - Implemented , , , and functions. - Updated workflow step definitions for config management with new annotations. - Refactored existing workflow run controller to utilize the new config factory. - Introduced a new Kubernetes-backed factory for storing configs as Secrets. - Added tests for the new config provider and legacy compatibility. - Updated cue templates to reflect the new provider structure. Signed-off-by: Anaswara Suresh <anaswarasuresh2212@gmail.com> Co-authored-by: Anaswara Suresh <anaswarasuresh2212@gmail.com> Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
…a fields Signed-off-by: Anaswara Suresh <anaswarasuresh2212@gmail.com> Co-authored-by: Anaswara Suresh <anaswarasuresh2212@gmail.com> Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
- Rename ConfigItem to Item in pkg/config to fix revive stutter warning (config.ConfigItem → config.Item) - Update TestLegacyGetProvidersRegistered to check for renamed provider keys (create-config, read-config, list-config, delete-config) Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
fc0afbf to
3d3108d
Compare
Signed-off-by: Anaswara Suresh <anaswarasuresh2212@gmail.com> Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Co-authored-by: Anaswara Suresh <anaswarasuresh2212@gmail.com>
There was a problem hiding this comment.
1 issue found across 16 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="pkg/config/k8s_factory.go">
<violation number="1" location="pkg/config/k8s_factory.go:353">
P2: CreateOrUpdateConfig updates the Secret and applies new output objects but never deletes output objects removed from the previous Secret’s objects-reference list, leaving orphaned resources after config updates.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Chaitanyareddy0702
approved these changes
Feb 10, 2026
briankane
approved these changes
Feb 10, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add config management workflow step definitions (
create-config,read-config,list-config,delete-config) to the standalone workflow controller, synced from the KubeVela repository. These definitions previously referenced thevela/opprovider but had no backing Go implementation — they were broken stubs.What this PR adds
New-style config provider (
vela/config) — registered as a separate CUE internal package with$params/$returnsdispatch pattern. Helm chart definitions use this style.Legacy config provider (
vela/op) — registered under the sharedopnamespace for backward compatibility with legacy-style definitions usingop.#CreateConfig,op.#ReadConfig, etc.ConfigFactory interface (
pkg/config/types.go) — abstraction for config CRUD operations with nil-guard inWithRuntimeParamsto preserve upstream-injected factories (used by KubeVela integration).K8sFactory implementation (
pkg/config/k8s_factory.go) — Kubernetes-backed factory storing configs as Secrets withconfig.oam.dev/catalog: velacore-configlabels. Supports CUE template rendering, 3-way merge patch for updates, and output object lifecycle management.Legacy provider key collision fix — renamed legacy config provider keys from
read/list/deletetoread-config/list-config/delete-configto avoid silent overwrite by kube provider in the flatopnamespace.Checklist
make reviewableto ensure this PR is ready for reviewbackport release-x.ylabels to auto-backport this PR if necessaryHow has this code been tested
Detailed documentation and testing results can be found here - Config Sync Implementation: KubeVela to Workflow
End-to-end tested on a k3d cluster (k3s v1.31.5, darwin/arm64) with custom-built controller image.
Environment setup:
k3d cluster create config-test --wait docker buildx build --platform linux/arm64 -t vela-workflow:config-test --load . k3d image import vela-workflow:config-test -c config-test helm upgrade --install vela-workflow ./charts/vela-workflow -n vela-system \ --create-namespace \ --set image.repository=vela-workflow \ --set image.tag=config-test \ --set image.pullPolicy=Never \ --waitTest Suite A — New-style definitions (
vela/configprovider)create-config→ verify Secret created with correct labels + dataread-config→ succeeds on existing configlist-config→ returns empty list for unmatched template filterdelete-config→ succeeds, Secret removed from clusterTest Suite B — Legacy-style definitions (
vela/opprovider)create-config→ verify Secret created with correct dataread-config→ succeeds (was nil-pointer panic before collision fix)list-config→ succeedsdelete-config→ succeeds, Secret removedTest Suite C — Edge cases
{}→ succeedscontext.namespaceread-object→ unaffected by key rename19/19 tests passed.
Special notes for reviewer
1. Legacy provider key collision (bug fix)
The legacy config and kube providers both registered
read,list,deletein the flatopnamespace. Since kube was registered last inpkg/providers/legacy/legacy.go, it silently overwrote config's functions — causingop.#ReadConfigto dispatch tokube.Readand panic.Fix: Renamed config's keys to
create-config,read-config,list-config,delete-config.2. Nil-guard in WithRuntimeParams
The
if params.ConfigFactory != nilcheck atpkg/providers/types/types.go:176preserves any ConfigFactory already in context (set by KubeVela'sgenerator.go). In standalone mode, the controller sets it viacontext.WithValue.3. K8sFactory scope
K8sFactory is a simplified standalone implementation. KubeVela's full
kubeConfigFactoryhas additional features (Nacos sync, config distribution, Terraform integration) not needed here. KubeVela will inject its own factory via a thin adapter when using this library.Summary by cubic
Adds a new config management provider (vela/config) with CRUD, CUE template rendering, and a Kubernetes Secret–backed factory. Charts switch to the new provider, the controller injects the factory, legacy key collisions are fixed, and example workflows are added for both new and legacy styles.
New Features
Bug Fixes
Written for commit 48b5818. Summary will update on new commits.