-
Notifications
You must be signed in to change notification settings - Fork 260
chore: break up cns main.go #4038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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.
|
/azp run Azure Container Networking PR |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure Container Networking PR |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
G'day @rbtr , looks like this passed in the pipeline |
|
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) |

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