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/bug
    priority/important-soon
    area/data-passing
    on Nov 21, 2026
  2. NachiketPatil26 commented on Nov 24, 2026

    @NachiketPatil26
    Contributor

    Hey @briankane, I'd like to pick this up since it came out of #262. Plan is to return from sync() right after updating the in-memory store, and change TestWorkflowContextInMemory so it fails if Patch gets called. Could you assign it to me?

  3. added theissue type on Nov 26, 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-passingpriority/important-soontype/bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions