Repository navigation
Description
There is no way to turn DNS registration off for a launch, and the config key that looks like the way — dns.enabled — is parsed and then never read by anything.
Measured on v0.101.0 (072c4b0, binary and source the same commit).
dns.enabled is a dead switch
pkg/config/config.go:37 declares it, :77 assigns it:
cfg.Enabled = fileConfig.DNS.EnabledThat line is the only reference to the field outside the struct definition:
$ git grep -nE 'DNS\.Enabled|dnsCfg\.Enabled|dnsConfig\.Enabled'
pkg/config/config.go:77: cfg.Enabled = fileConfig.DNS.Enabled
The single LoadDNSConfig caller (cmd/launch_single.go:883) uses dnsConfig.Domain and dnsConfig.APIEndpoint and never consults Enabled. So dns.enabled: false in ~/.spawn/config.yaml does nothing at all — registration proceeds. I was about to rely on it as the documented off-ramp; it reads exactly like a working switch.
Two smaller things fall out of the same line:
Enabledis aboolwith no empty sentinel, so unlikeDomain/APIEndpointabove it (guarded by!= "") the assignment is unconditional. A config file that is present but says nothing aboutdns:unmarshals toEnabled: falseand overwrites thetruedefault. Inert today, but it means the field can never express "inherit" once something does read it.defaults: {}in the config file can't carry it either —dnsisn't among the keyspkg/config/defaults.goaccepts.
Registration is unconditional for every named launch
cmd/launch_config.go:195-196:
if dnsName == "" && name != "" {
dnsName = name
}--dns defaults to "" (cmd/launch_flags.go:244), so the fallback makes dnsName non-empty for every launch that has a name — which is every launch, since the positional name is required. The registration guard at cmd/launch_single.go:881 is dnsName != "" && waitForSSH, so it always fires.
The only reachable escape is --wait-for-ssh=false (:877, the #56 behavior), which is not a DNS flag: it also gives up the SSH readiness wait, so a caller that needs "instance reachable, no DNS" can't have it. There's no SPAWN_DNS_ENABLED env override either — pkg/config/config.go:81-86 reads only SPAWN_DNS_DOMAIN and SPAWN_DNS_API_ENDPOINT.
Request
spawn launch --no-dns (and honoring dns.enabled: false, or removing the key if it isn't going to mean anything).
The use case is a benchmark fleet: hosts are addressed by IP out of the launcher's own inventory (spawn list --output json), a friendly name is never used, and registration is pure cost. In an account not wired for spore.host DNS it's 4 minutes per host of guaranteed-failing retries (see the companion issue on curl exit 6 being classified transient, spawn#548) — but even where it succeeds, a caller that will never resolve the name should be able to say so.
Fixing either issue alone helps; fixing this one takes the cost to zero, and fixing the other one bounds it for everybody who doesn't know the flag exists.
Activity
fix: DNS registration is now skippable and no longer burns 4 min on a…
fix: DNS registration is now skippable and no longer burns 4 min on a…
test(sweep): classify every launch flag for the sweep path (#698)
test(sweep): correct the DNS flag classifications
test(sweep): correct the DNS flag classifications (#701)
security: delete ShellEscape and migrate every caller to real single-…
fix(sweep): honour CLI flags instead of dropping 83 of 127 (#697) (#724)