Skip to content

Export GLOBAL_NAMESERVERS_YAML consistently across all return paths#79

Merged
EdGeraghty merged 3 commits intocustom-nameserversfrom
copilot/sub-pr-78
Apr 15, 2026
Merged

Export GLOBAL_NAMESERVERS_YAML consistently across all return paths#79
EdGeraghty merged 3 commits intocustom-nameserversfrom
copilot/sub-pr-78

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 15, 2026

This stacked PR addresses review feedback on the custom nameservers implementation in container-entrypoint.sh.
The issue was inconsistent export behaviour: GLOBAL_NAMESERVERS_YAML was exported only in the non-empty path, but not in early-return empty paths.

  • What changed

    • Updated build_global_nameservers_yaml() to export GLOBAL_NAMESERVERS_YAML in both empty-list branches:
      • when ns_array is empty
      • when all parsed entries are invalid and items is empty
    • Kept existing parsing, validation, and YAML generation logic unchanged.
  • Behavioural impact

    • GLOBAL_NAMESERVERS_YAML is now exported uniformly regardless of whether nameservers are present, absent, or filtered out.
    • This removes path-dependent environment behaviour and avoids surprises if the function is reused independently.
  • Code snippet

    if [[ ${#ns_array[@]} -eq 0 ]]; then
      export GLOBAL_NAMESERVERS_YAML='[]'
      return
    fi
    
    if [[ ${#items[@]} -eq 0 ]]; then
      export GLOBAL_NAMESERVERS_YAML='[]'
      return
    fi

Copilot AI changed the title [WIP] [WIP] Addressing feedback on custom nameservers implementation Export GLOBAL_NAMESERVERS_YAML consistently across all return paths Apr 15, 2026
@github-actions
Copy link
Copy Markdown

🆕 New Headscale Config Options

+ - 2606```

Copilot AI requested a review from EdGeraghty April 15, 2026 18:01
@EdGeraghty EdGeraghty marked this pull request as ready for review April 15, 2026 18:03
@github-actions
Copy link
Copy Markdown

🆕 New Headscale Config Options

+ - 2606```

@EdGeraghty EdGeraghty merged commit df4f795 into custom-nameservers Apr 15, 2026
3 checks passed
@EdGeraghty EdGeraghty deleted the copilot/sub-pr-78 branch April 15, 2026 18:04
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.

2 participants