chore: fix diffs for scriptless phase 2.5#8871
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the aks-node-controller “scriptless” CSE environment variable generation to better match the existing “scriptful” (NBC/CSE) behavior, reducing diffs between the two paths.
Changes:
- Emit
"none"(instead of"") forNETWORK_PLUGIN/NETWORK_POLICYwhen the corresponding enum is*_NONE, aligning with scriptful output for BYO-CNI / no-policy scenarios. - Derive
ENABLE_KUBELET_SERVING_CERTIFICATE_ROTATIONfrom either kubelet config-fileserverTLSBootstrapor the--rotate-server-certificateskubelet flag to preserve parity across config-file enabled/disabled modes. - Add unit tests covering the updated enum-to-string behavior and the rotation derivation logic.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| aks-node-controller/parser/parser.go | Switch ENABLE_KUBELET_SERVING_CERTIFICATE_ROTATION to use a helper that checks both config-file and flag representations. |
| aks-node-controller/parser/helper.go | Add none handling for network plugin/policy enums and introduce getEnableKubeletServingCertificateRotation. |
| aks-node-controller/parser/helper_test.go | Add tests for network plugin/policy string mapping and serving cert rotation derivation. |
| aks-node-controller/helpers/const.go | Define NetworkPluginNone / NetworkPolicyNone constants used by the parser helpers. |
| //nolint:exhaustive // NetworkPlugin_NETWORK_PLUGIN_UNSPECIFIED should return "" | ||
| func getStringFromNetworkPluginType(enum aksnodeconfigv1.NetworkPlugin) string { | ||
| switch enum { | ||
| case aksnodeconfigv1.NetworkPlugin_NETWORK_PLUGIN_AZURE: | ||
| return helpers.NetworkPluginAzure | ||
| case aksnodeconfigv1.NetworkPlugin_NETWORK_PLUGIN_KUBENET: | ||
| return helpers.NetworkPluginKubenet | ||
| case aksnodeconfigv1.NetworkPlugin_NETWORK_PLUGIN_NONE: | ||
| // The scriptful (NBC/CSE) path emits the raw "none" string for the network | ||
| // plugin; mirror it here so NETWORK_PLUGIN matches for BYO-CNI clusters. | ||
| return helpers.NetworkPluginNone | ||
| default: | ||
| return "" | ||
| } | ||
| } |
There was a problem hiding this comment.
Fixed in the latest commit — NETWORK_PLUGIN_UNSPECIFIED is now handled explicitly as a named case returning "", and the //nolint:exhaustive directive has been removed.
| //nolint:exhaustive // NetworkPolicy_NETWORK_POLICY_UNSPECIFIED should return "" | ||
| func getStringFromNetworkPolicyType(enum aksnodeconfigv1.NetworkPolicy) string { | ||
| switch enum { |
There was a problem hiding this comment.
add suggestion to batch
AgentBaker Linux gate detectiveRun: 171663540 Likely cause/signature: Oversized generated customData for ACL SecondaryNIC/SecondaryNIC DualStack; unlikely caused by this PR based on matching prior signature and open repair item #38757358. Evidence: build timeline/logs and E2E test results for run 171663540. |
… use constants in tests Co-authored-by: lilypan26 <106703606+lilypan26@users.noreply.github.com>
AgentBaker Linux gate detectiveRun: 171740449 Likely cause/signature: VHD base prep did not complete or the marker was absent when VHDCaching validation ran; this matches the existing gate flakiness signature. Evidence: build metadata, failed E2E log, and timeline for run 171740449. |
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #