Skip to content

validation: Allow mounting the same volume at multiple paths - #1611

Merged
Michelle Au (msau42) merged 3 commits into
agent-substrate:mainfrom
shrutiyam-glitch:mount-path-vol
Sep 14, 2026
Merged

Michelle Au (msau42) merged 3 commits into
agent-substrate:mainfrom
shrutiyam-glitch:mount-path-vol

Conversation

@shrutiyam-glitch

@shrutiyam-glitch shrutiyam-glitch commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1612

Rekeys Container.volume_mounts by mount_path (instead of name) to align with standard Kubernetes pod semantics and allow mounting the same volume at multiple distinct paths within a container.

The container runtimes (ateom-gvisor and ateom-microvm) already support binding a single volume to multiple target paths. However, the API validation layer previously rejected this because volume_mounts was keyed by name (+k8s:listMapKey=name).

Key Changes

  • Proto & Validation: Changed Container.volume_mounts list map key to +k8s:listMapKey=mount_path in pkg/proto/ateapipb/ateapi.proto.

  • Custom Validation: Updated ValidateCustom_Container_VolumeMounts in cmd/ateapi/internal/controlapi/actor_template.go to remove duplicate volume name checks while continuing to reject nested/overlapping mount paths.

  • Unit Tests: Updated actor_template_test.go to assert that mounting the same volume at two paths is allowed, and mounting two volumes at the same path is rejected.

  • E2E Tests: Added test coverage in internal/e2e/suites/imagevolume/imagevolume_test.go:

    • Verified multi-mount visibility for read-only image volumes (SameImageVolumeAtTwoPaths).
    • Verified write-sharing across multi-mounted durable directories (SameDurableVolumeAtTwoPathsSharesWrites).
    • Verified multi-mount write-sharing for CSI external volumes (SameExternalVolumeAtTwoPathsSharesWrites).
    • Verified all multi-path mounts and shared writes survive an actor Suspend -> Resume cycle (SurvivesSuspendResume).
  • Tests pass

  • Appropriate changes to documentation are included in the PR

if got["error"] != "" {
t.Fatalf("reading through %s what was written through %s: %s", scratchPathB, scratchPathA, got["error"])
}
if got["content"] != probeWrittenContent {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want to verify the content at both paths?

})

t.Run("SameImageVolumeAtTwoPaths", func(t *testing.T) {
got := probeJSON(ctx, t, router, actorRef, "/readfile?path="+mountPathAlias+"/"+payloadName)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the mount verification is pretty similar for all volume types, with only the path and payload being different. Is it worth writing a helper function for it?

requireContentAtBoth(ctx, t, router, actorRef, writePath, aliasPath, probeWrittenContent)
}

func TestImageVolume(t *testing.T) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we are no longer testing just image volumes. Maybe we should rename the test and the file name to something like TestCombinedVolumes?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks !

@msau42
Michelle Au (msau42) merged commit 25c06b9 into agent-substrate:main Sep 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validation: allow mounting the same volume at multiple paths

2 participants