Skip to content

[Bug] With the in-memory context on, Commit still patches a ConfigMap that was never created #335

Open

Description

@briankane

Describe the bug

WorkflowContext.sync() (pkg/context/context.go) updates the in-memory store when EnableInMemoryContext
is set, then falls through to cli.Patch(ctx, wf.store, ...). In that mode the ConfigMap is never created
in the API server, so the patch returns NotFound and Commit fails.

TestWorkflowContextInMemory stubs MockPatch to return nil, so the test passes over it.

Expected behavior

With the in-memory context on, sync() returns after updating the store and never calls the API server;
the test asserts that Patch is not called.

Additional context

Found reviewing #262 and reproduced against a real API server (envtest, k8s 1.37) on main at 599b593:
newContext with the flag on, one SetVar, then Commit returns
save context to configMap(default/workflow-g2app-context): configmaps "workflow-g2app-context" not found.
The flag is off by default; KubeVela exposes it as
--optimize-enable-in-memory-workflow-context.

Activity

  1. added
    type/bugSomething isn't working
    priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.
    area/data-passingInputs, outputs, parameterKey and the workflow context store (pkg/hooks, pkg/context)
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/data-passingInputs, outputs, parameterKey and the workflow context store (pkg/hooks, pkg/context)priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.type/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions