Skip to content

Conversation

@awesomenix
Copy link
Contributor

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 #

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 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

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

Copilot reviewed 35 out of 133 changed files in this pull request and generated 2 comments.

@awesomenix awesomenix force-pushed the nishp/deprecate/notused branch from 65d3eee to e379183 Compare February 10, 2026 08:30
Copilot AI review requested due to automatic review settings February 10, 2026 10:21
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

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: GenerateLocalDNSCoreFile returns 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

  • enableLocalDNS exits the whole script on failure (systemctlEnableAndStart ... || exit $ERR_LOCALDNS_FAIL). Since it’s wrapped in logs_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
Copy link

Copilot AI Feb 10, 2026

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".

Suggested change
Any overriden files will be listed here - Hotfix mode
Any overridden files will be listed here - Hotfix mode

Copilot uses AI. Check for mistakes.
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.

1 participant