Skip to content

PUT/DELETE NC and subnet join related changes for RNC via NMA - #4597

Open
Saksham Mittal (smittal22) wants to merge 10 commits into
masterfrom
cns-changes-rnc
Open

PUT/DELETE NC and subnet join related changes for RNC via NMA#4597
Saksham Mittal (smittal22) wants to merge 10 commits into
masterfrom
cns-changes-rnc

Conversation

@smittal22

Copy link
Copy Markdown
Contributor

Reason for Change:

Issue Fixed:

Requirements:

Notes:

Copilot AI review requested due to automatic review settings July 28, 2026 17:39
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR starts wiring “RNC via NMA” support into CNS publish/unpublish flows by threading a UseRNCPublisher flag through request contracts and the wireserver proxy, and introducing a subnet-join step (in addition to vnet join) when that flag is enabled.

Changes:

  • Add UseRNCPublisher to NMAgent publish/unpublish request bodies and thread it through CNS publish/unpublish handler logic.
  • Extend wireserver proxy operations to optionally set useLegacyChannel=false and add a new JoinSubnet call for RNC flows.
  • Add CNS response code SubnetJoinFailed and in-memory subnet-joined state tracking.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
nmagent/requests.go Adds UseRNCPublisher to NC put/delete request JSON contracts.
cns/wireserver/proxy.go Updates Join/Publish/Unpublish to optionally use non-legacy channel; adds JoinSubnet request.
cns/types/codes.go Introduces SubnetJoinFailed response code and string mapping.
cns/restserver/util.go Adds subnet joined-state helpers (isSubnetJoined, setSubnetStateJoined).
cns/restserver/restserver.go Extends wireserverProxy interface and restserver state with joinedSubnets.
cns/restserver/const.go Adds named-lock key for subnet joined-state.
cns/restserver/api.go Implements RNC-aware JoinNetwork/JoinSubnet and passes the flag into publish/unpublish calls.
cns/NetworkContainerContract.go Extends publish/unpublish request contracts to carry SubnetName (for subnet join).
cns/fakes/wireserverproxyfake.go Updates fake proxy to match the expanded wireserver proxy interface.
Comments suppressed due to low confidence (2)

cns/restserver/api.go:1006

  • On subnet join error, the response Message formats the wrong error variable (err is nil here), so the client gets a misleading message.
					ReturnCode: types.SubnetJoinFailed,
					Message:    fmt.Sprintf("failed to join subnet %s in network %s: %v", req.SubnetName, req.NetworkID, err),
				},
				PublishErrorStr: errSubnetJoin.Error(),

cns/restserver/api.go:1202

  • This is the unpublish path but the error message says "failed to publish nc". This makes troubleshooting confusing.
			Response: cns.Response{
				ReturnCode: types.NetworkContainerUnpublishFailed,
				Message:    fmt.Sprintf("failed to publish nc %s: %v", req.NetworkContainerID, err),
			},
			UnpublishErrorStr: err.Error(),

Comment thread cns/restserver/api.go Outdated
Comment thread cns/fakes/wireserverproxyfake.go
Comment thread cns/restserver/restserver.go Outdated
Comment thread cns/restserver/api.go
@smittal22

Copy link
Copy Markdown
Contributor Author

/azp

@azure-pipelines

Copy link
Copy Markdown
Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@smittal22

Copy link
Copy Markdown
Contributor Author

/azp run Azure Container Networking PR

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@smittal22

Copy link
Copy Markdown
Contributor Author

Copilot review the PR

Copilot AI and others added 3 commits August 11, 2026 19:43
Co-authored-by: smittal22 <111590532+smittal22@users.noreply.github.com>
Co-authored-by: smittal22 <111590532+smittal22@users.noreply.github.com>
Co-authored-by: smittal22 <111590532+smittal22@users.noreply.github.com>
@smittal22
Saksham Mittal (smittal22) requested a review from a team as a code owner August 13, 2026 17:37
@azure-pipelines

Copy link
Copy Markdown
There was an error handling pipeline event f4a401db-7416-4c05-a345-3484056d7a57.

@smittal22 Saksham Mittal (smittal22) changed the title [WIP] initial put/delete NC and subnet join related changes for RNC via NMA PUT/DELETE NC and subnet join related changes for RNC via NMA Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions Bot added the stale Stale due to inactivity. label Aug 28, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Pull request closed due to inactivity.

@github-actions github-actions Bot closed this Sep 5, 2026
@github-actions
github-actions Bot deleted the cns-changes-rnc branch September 5, 2026 00:03
@smittal22
Saksham Mittal (smittal22) restored the cns-changes-rnc branch September 11, 2026 18:19
@smittal22

Copy link
Copy Markdown
Contributor Author

Reopening PR

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Comment thread nmagent/requests.go
GREKey uint16 `json:"greKey"`
AzID uint `json:"azID"`
AZREnabled bool `json:"azrEnabled"`
UseRNCPublisher bool `json:"useRNCPublisher"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this needed?

// PublishNetworkContainerRequest specifies request to publish network container via NMAgent.
type PublishNetworkContainerRequest struct {
NetworkID string
SubnetName string

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this just for logging and debugging?

@github-actions github-actions Bot removed the stale Stale due to inactivity. label Sep 12, 2026
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.

4 participants