guest/spec: remove VirtualPod path helpers and dead code#2700
Open
shreyanshjain7174 wants to merge 2 commits intomicrosoft:mainfrom
Open
guest/spec: remove VirtualPod path helpers and dead code#2700shreyanshjain7174 wants to merge 2 commits intomicrosoft:mainfrom
shreyanshjain7174 wants to merge 2 commits intomicrosoft:mainfrom
Conversation
added 2 commits
April 22, 2026 11:42
Replace the separate VirtualPod tracking (dedicated type, 7 exported
methods, parent cgroup manager, reverse-lookup map) with a unified
uvmPod type and a single pods map on Host. All pod types (V1 sandbox,
virtual pod, V2 shim) now go through the same code path:
- createPodInUVM allocates a cgroup under /pods/{sandboxID}
- addContainerToPod tracks container→pod membership
- RemoveContainer handles cleanup uniformly
Cgroup hierarchy changes from:
/containers/{id} (V1 sandbox)
/containers/virtual-pods/{virtualPodID} (virtual pod)
to:
/pods/{sandboxID} (all pod types)
Workload containers nest under their pod:
/pods/{sandboxID}/{containerID}
Signed-off-by: Shreyansh Jain <shreyanshjain7174@gmail.com>
Signed-off-by: Shreyansh Sancheti <shsancheti@microsoft.com>
Remove 13 VirtualPod-specific path functions from spec.go that became dead code after the pod unification in the parent commit. All callers now use the *FromRoot variants introduced in microsoft#2653. Also removes SandboxLogsDir and SandboxLogPath — both were only reachable through VirtualPodAwareSandboxRootDir which is now gone. Updates ExtendPolicyWithNetworkingMounts in pkg/securitypolicy to accept a sandboxRoot string and use GenerateWorkloadContainerNetworkMountsFromRoot. Signed-off-by: Shreyansh Jain <shreyanshjain7174@gmail.com> Signed-off-by: Shreyansh Sancheti <shsancheti@microsoft.com>
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.
Depends on #2699 — must merge first.
Removes 13 VirtualPod-specific path helpers from
internal/guest/spec/spec.gothat became dead code after the pod unification in #2699. All callers now use the*FromRootvariants added in #2653.Removed functions:
VirtualPodRootDir,VirtualPodMountsDir,VirtualPodTmpfsMountsDir,VirtualPodHugePagesMountsDir, and all sevenVirtualPodAware*selection/mount-source functions. Also removesSandboxLogsDirandSandboxLogPath— both were only reachable throughVirtualPodAwareSandboxRootDir.Updates
ExtendPolicyWithNetworkingMountsinpkg/securitypolicyto accept asandboxRootstring and callGenerateWorkloadContainerNetworkMountsFromRootinstead of the old ID-based variant.No behavioral change — the same paths are produced, just through
*FromRoothelpers that take a resolved root directory instead of deriving it from a hardcoded prefix + ID.