Skip to content

Conversation

@pjohnst5
Copy link
Contributor

Continuing the efforts of #3465 in breaking up cns main.go
Similarly, no code changes, just re-arranging a bit into own files

@pjohnst5 pjohnst5 requested a review from a team as a code owner September 12, 2025 21:47
@pjohnst5 pjohnst5 requested review from camrynl and Copilot September 12, 2025 21:47
Copy link
Contributor

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 continues the refactoring effort to break up the large main.go file in the CNS service by extracting code into separate, focused files without making any functional changes.

  • Extracts version-related functionality into a dedicated version.go file
  • Moves command-line argument definitions to args.go for better organization
  • Separates node registration and managed mode functionality into managed.go
  • Creates aks.go for AKS-specific initialization flows including CRD state management and multi-tenant controller setup

Reviewed Changes

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

Show a summary per file
File Description
cns/service/version.go Contains version variable and printVersion function
cns/service/managed.go Node registration logic and interfaces for managed DNC mode
cns/service/main.go Cleaned up by removing extracted code and updating function calls
cns/service/args.go Command-line argument definitions moved from main.go
cns/service/aks.go AKS-specific initialization including CRD controllers and multi-tenant setup

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

@pjohnst5
Copy link
Contributor Author

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pjohnst5
Copy link
Contributor Author

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pjohnst5
Copy link
Contributor Author

G'day @rbtr , looks like this passed in the pipeline
Would you be able to review it?
It's basically the same as yours, I rebased it and moved 4 more things (which I'm happy to undo any if need be)
image

@pjohnst5
Copy link
Contributor Author

We're going to go slow on this one, I'm going to open a new PR to first merge in args.go and version.go (safe, small stuff first)

@pjohnst5 pjohnst5 closed this Sep 16, 2025
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