Skip to content

[shimV2] added network controller implementation#2633

Open
rawahars wants to merge 2 commits intomicrosoft:mainfrom
rawahars:network-controller
Open

[shimV2] added network controller implementation#2633
rawahars wants to merge 2 commits intomicrosoft:mainfrom
rawahars:network-controller

Conversation

@rawahars
Copy link
Contributor

Summary

This change adds the network controller implementation for V2 shims which manages the network lifecycle for a single pod running inside a UVM. The implementation provides a clear lifecycle state machine, separates platform-specific logic for LCOW and WCOW. This controller will be initialized from VMController which can inject the low-level managers to perform VM host + guest network operations.

The main changes are grouped below.

Network controller implementation:

  • Implemented the Controller interface and its concrete Manager type, providing Setup and Teardown methods to manage HCN namespaces and endpoints for a pod (internal/controller/network/interface.go, internal/controller/network/network.go).

Platform-specific guest operations:

  • Added platform-specific files for LCOW and WCOW, implementing guest-side network namespace and endpoint management with proper separation via build tags (internal/controller/network/network_lcow.go, internal/controller/network/network_wcow.go).

Lifecycle state management:

  • Defined a State type to track the network lifecycle, including transitions for setup, teardown, and error handling (internal/controller/network/state.go).

@rawahars rawahars requested a review from a team as a code owner March 17, 2026 21:57
This change adds the network controller implementation for V2 shims which manages the network lifecycle for a single pod running inside a UVM.

Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
@rawahars rawahars force-pushed the network-controller branch from 0336432 to e901ab7 Compare March 20, 2026 19:11
vmNetManager vmmanager.NetworkManager,
linuxGuestMgr guestmanager.LCOWNetworkManager,
windowsGuestMgr guestmanager.WCOWNetworkManager,
vmNetManager vmNetworkManager,
Copy link
Contributor

Choose a reason for hiding this comment

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

How can the caller call this with an unexported interface type? I didn't know that was possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this relies on Go's implicit interfaces. As long as the provided argument implements the required method set, Go verifies the structural match at compile time.

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.

2 participants