Skip to content

Conversation

@Devinwong
Copy link
Collaborator

What this PR does / why we need it:
Fixing a few bugs we found recently:

  1. const value of LoadBalancerStandard from "Standard" to "standard"
  2. return getServicePrincipalFileContent with double encoding because we assume the SP content is already encoded.
  3. Update e2e ValidateLeakedSecrets to check the whole word instead of partial word match.
  4. Added more tests.
  5. Downloading more logs for debugging.

Which issue(s) this PR fixes:

Fixes #

Copy link

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 fixes several bugs related to scriptless node provisioning:

Changes:

  • Changed the LoadBalancerStandard constant value from "Standard" to "standard" for consistency with other constants
  • Fixed double base64 encoding issue with service principal secrets by removing the extra encoding layer in aks-node-controller
  • Updated e2e secret leak validation to use exact word matching instead of partial matching to reduce false positives
  • Added test coverage for kubelet flag validation and service principal configuration
  • Enhanced e2e log collection to include additional configuration files for debugging

Reviewed changes

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

Show a summary per file
File Description
aks-node-controller/helpers/const.go Changed LoadBalancerStandard constant from "Standard" to "standard" for consistency
aks-node-controller/helpers/utils_test.go Updated test expectations to match new lowercase constant values and added comprehensive tests for kubelet flag validation
aks-node-controller/parser/helper.go Removed getServicePrincipalFileContent helper function that was adding extra base64 encoding
aks-node-controller/parser/parser.go Updated to directly use ServicePrincipalSecret without additional encoding
aks-node-controller/parser/parser_test.go Added test to verify service principal secret is passed without double encoding
e2e/node_config.go Updated test templates to use base64 encoded service principal secrets
e2e/validators.go Added fileHasExactContent function and ValidateFileExcludesExactContent for exact word matching, updated ValidateLeakedSecrets to use exact matching
e2e/vmss.go Added extraction of aks-node-controller configuration files and azure.json for debugging

}

// ValidateFileHasContent passes the test if the specified file contains the specified contents.
// The contents doesn't need to surrounded by non-word characters.
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Typo in the comment: "doesn't need to surrounded" should be "doesn't need to be surrounded".

Copilot uses AI. Check for mistakes.
}

// ValidateFileExcludesContent fails the test if the specified file contains the specified contents.
// The contents doesn't need to surrounded by non-word characters.
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Typo in the comment: "doesn't need to surrounded" should be "doesn't need to be surrounded".

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Jan 21, 2026

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

@Devinwong
Copy link
Collaborator Author

Devinwong commented Jan 23, 2026

Windows e2e failed. But the changes here is Linux Scriptless only.
Also see the same errors for tests Test_Windows2022_McrChinaCloud_Windows, Test_Windows2025Gen2_McrChinaCloud_Windows. so less likely introduced by this PR.

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.

4 participants