-
Notifications
You must be signed in to change notification settings - Fork 247
feat: scriptless mode in NBC so we can move in phases #7805
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
base: main
Are you sure you want to change the base?
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 implements Phase 1 of transitioning to scriptless node bootstrapping by moving LocalDNS configuration from CustomData to CSE environment variables, while maintaining backward compatibility during the migration period.
Changes:
- LocalDNS configuration moved from cloud-init CustomData to CSE environment variables (SHOULD_ENABLE_LOCALDNS, LOCALDNS_CPU_LIMIT, LOCALDNS_MEMORY_LIMIT, LOCALDNS_GENERATED_COREFILE)
- Refactored LocalDNS enablement logic to support both legacy (corefile in VHD) and new (corefile generated at provision time) deployment modes
- Modified GenerateLocalDNSCoreFile to return empty string instead of error when LocalDNS is disabled, allowing graceful handling
- E2E tests updated to use minimal customData placeholder while CSE variables carry the configuration
Reviewed changes
Copilot reviewed 35 out of 133 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/agent/testdata/*/CSECommand | Snapshot tests regenerated with new SHOULD_ENABLE_LOCALDNS, LOCALDNS_CPU_LIMIT, LOCALDNS_MEMORY_LIMIT, LOCALDNS_GENERATED_COREFILE environment variables |
| pkg/agent/baker_test.go | Removed tests expecting errors when LocalDNSProfile is nil or disabled (now returns empty string) |
| pkg/agent/baker.go | Changed GenerateLocalDNSCoreFile to return ("", nil) instead of errors when LocalDNS disabled |
| parts/linux/cloud-init/artifacts/cse_main.sh | Simplified LocalDNS enablement to single conditional path |
| parts/linux/cloud-init/artifacts/cse_config.sh | Refactored enableLocalDNS functions: extracted generateLocalDNSFiles, unified enableLocalDNS logic to handle both legacy and new modes |
| parts/linux/cloud-init/artifacts/cse_cmd.sh | Added 4 new LocalDNS-related environment variables to CSE command |
| e2e/vmss.go | Changed customData to minimal placeholder (base64 "#cloud-config\n") for scriptless testing |
e1f4978 to
6c50700
Compare
6c50700 to
65d3eee
Compare
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
Copilot reviewed 35 out of 133 changed files in this pull request and generated 2 comments.
65d3eee to
e379183
Compare
e379183 to
531b94d
Compare
531b94d to
3e49fca
Compare
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
Copilot reviewed 40 out of 138 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
pkg/agent/baker.go:1867
- The comment above the return is now inaccurate:
GenerateLocalDNSCoreFilereturns the plain Corefile string (not gzipped+base64). Either update the comment to reflect the new contract or move the encoding responsibility documentation to the template funcs (GetGeneratedLocalDNSCoreFile/GetCSEGeneratedLocalDNSCoreFile).
# WARNING: Changes to this file will be overwritten and not persisted.
# ***********************************************************************************
parts/linux/cloud-init/artifacts/cse_config.sh:1196
enableLocalDNSexits the whole script on failure (systemctlEnableAndStart ... || exit $ERR_LOCALDNS_FAIL). Since it’s wrapped inlogs_to_events, exiting inside the function can bypass the wrapper’s error logging/cleanup. Prefer returning a non-zero status and let the caller handle exiting.
echo "localdns should be enabled."
systemctlEnableAndStart localdns 30 || exit $ERR_LOCALDNS_FAIL
echo "Enable localdns succeeded."
| owner: root | ||
| content: | | ||
| Executing in scriptless CSE mode. No cloud-init scripts will be written to the VM. | ||
| Any overriden files will be listed here - Hotfix mode |
Copilot
AI
Feb 10, 2026
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.
Spelling: "Any overriden files" should be "Any overridden files".
| Any overriden files will be listed here - Hotfix mode | |
| Any overridden files will be listed here - Hotfix mode |
What this PR does / why we need it:
Switch to using scriptless but with CSE for Phase 1
Which issue(s) this PR fixes:
Fixes #