Skip to content

Conversation

@awesomenix
Copy link
Contributor

What this PR does / why we need it:

Current kubelet flags expects a map which is odd since the caller already know the ordering and filtering, provide a raw way to use cmd flags as is.

Which issue(s) this PR fixes:

Fixes #

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 introduces a new kubelet_cmd_flags field to provide a raw string representation of kubelet command-line flags, addressing limitations with the existing map-based kubelet_flags approach that loses ordering and filtering control.

Changes:

  • Added kubelet_cmd_flags string field to KubeletConfig proto definition
  • Updated parser to prioritize kubelet_cmd_flags over kubelet_flags when present
  • Modified tests to validate both flag formats and use agent.GetOrderedKubeletConfigFlagString()

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
aks-node-controller/proto/aksnodeconfig/v1/kubelet_config.proto Added new optional kubelet_cmd_flags string field to support raw flag format
aks-node-controller/pkg/gen/aksnodeconfig/v1/kubelet_config.pb.go Generated Go code for new proto field including getter method
aks-node-controller/parser/parser_test.go Updated test to use kubelet_cmd_flags via agent.GetOrderedKubeletConfigFlagString()
aks-node-controller/parser/helper_test.go Added test case for kubelet_cmd_flags and improved comparison with trimmed whitespace
aks-node-controller/parser/helper.go Modified getKubeletFlags() to return kubelet_cmd_flags if present, falling back to sorted map
aks-node-controller/Makefile Updated docker platform specification and branch reference from master to main

Comment on lines +600 to +602
if kubeletConfig.GetKubeletCmdFlags() != "" {
return kubeletConfig.GetKubeletCmdFlags()
}
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The function now has two different return paths with distinct behaviors (raw string vs. sorted map), but this is not documented. Add a comment explaining that kubelet_cmd_flags takes precedence when present, and that the fallback behavior constructs flags from the map.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@awesomenix could you please document this new field here? KubeletConfig in aks-node-controller/proto/README.md. Thanks for making this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 2, 2026, 11:44 PM

Copy link
Collaborator

@Devinwong Devinwong left a comment

Choose a reason for hiding this comment

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

approved with a minor suggestion

Copy link
Contributor

Copilot AI commented Feb 2, 2026

@awesomenix I've opened a new pull request, #7772, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: awesomenix <[email protected]>
@awesomenix awesomenix enabled auto-merge (squash) February 3, 2026 04:43
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.

3 participants