fix(agent): allow DHCP on isolated sites without gateway or DNS forwarders - #458
Open
ArshSSandhu wants to merge 1 commit into
Open
fix(agent): allow DHCP on isolated sites without gateway or DNS forwarders#458ArshSSandhu wants to merge 1 commit into
ArshSSandhu wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the agent’s dnsmasq rendering logic to support “isolated” sites (air‑gapped/no upstream network) by treating gateway and DNS forwarders as optional while still applying DHCP + internal DNS config when core DHCP settings are present.
Changes:
- Relax dnsmasq render preconditions to require only
internalDomain,dhcpRange, andsubnetMask. - Allow an empty dnsmasq
serversfile when no DNS forwarders are configured. - Adjust DHCP router option handling for sites without a gateway (but see review comment).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| agent/src/apply.ts | Loosens dnsmasq “render/skip” gating to enable isolated-site DHCP/internal DNS. |
| agent/templates/dnsmasq/servers.ejs | Makes DNS forwarders optional and safely renders an empty servers file when absent. |
| agent/templates/dnsmasq/dhcp-opts.ejs | Attempts to handle missing gateway for DHCP router option (needs adjustment per comment). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -1 +1 @@ | |||
| option:router,<%= site.gateway %> | |||
| <%_ if (site.gateway) { _%>option:router,<%= site.gateway %><%_ } else { _%>option:router<%_ } _%> | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
npm cinpm run buildgit diff --checkRelated Issue
Fixes #455