Skip to content

Conversation

pjohnst5
Copy link
Contributor

@pjohnst5 pjohnst5 commented Sep 4, 2025

Scaffolding for new CNS /ibdevices API

This is a quick exploration of how CNS would create the MTPNC on a /ibdevices POST

I see we already have some MTPNC reconciling logic in CNS if Swiftv2 is enabled, so will chat with stakeholders about that

@Copilot Copilot AI review requested due to automatic review settings September 4, 2025 19:47
@pjohnst5 pjohnst5 requested a review from a team as a code owner September 4, 2025 19:47
@pjohnst5 pjohnst5 requested a review from paulyufan2 September 4, 2025 19:47
Copy link
Contributor

@Copilot Copilot AI left a comment

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 introduces scaffolding for a new CNS /ibdevices API endpoint. It adds the initial handler structure without implementing the actual POST and GET operations, which will be completed in future PRs.

  • Adds new IB devices handler function with placeholder TODO comments for POST and GET methods
  • Registers the new handler for both v1 and v2 API paths

Reviewed Changes

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

File Description
cns/restserver/restserver.go Registers the ibDevicesHandler for both v1 and v2 API paths
cns/restserver/api.go Implements the ibDevicesHandler function with method routing and placeholder TODOs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pjohnst5
Copy link
Contributor Author

pjohnst5 commented Sep 4, 2025

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pjohnst5 pjohnst5 changed the title Scaffolding for new /ibdevices CNS API [Draft] New /ibdevices CNS API Sep 5, 2025
@pjohnst5 pjohnst5 marked this pull request as draft September 5, 2025 21:42
@pjohnst5 pjohnst5 changed the title [Draft] New /ibdevices CNS API [Draft] POST /ibdevices CNS API Sep 9, 2025
@pjohnst5 pjohnst5 changed the title [Draft] POST /ibdevices CNS API [Draft] New /ibdevices CNS API Sep 9, 2025
@pjohnst5 pjohnst5 changed the title [Draft] New /ibdevices CNS API [WIP] New /ibdevices CNS API Sep 15, 2025

func (service *HTTPRestService) createMTPNC(ctx context.Context, pod *v1.Pod, ibMACs []net.HardwareAddr) error {
// create the MTPNC for the pod
mtpnc := &v1alpha1.MultitenantPodNetworkConfig{
Copy link
Contributor

Choose a reason for hiding this comment

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

where is IBMACs being populated? and we should assign Unprogrammed status here if ib mac not in-use

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