mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-10-28 07:41:27 +00:00
node_agents.default_domain gives each agent a base domain. Services
placed on it (explicit pin or spread) with no explicit service_domains
get <name>.<default_domain> — resolved in serviceDomainNames so edge
routing, wake placeholders, and public_url all see the same names.
Spread services union every eligible node's base domain; explicit
domains always win.
Surfaces: PUT /agents/:id {default_domain} (hostname-validated), CLI
nodes update --domain, MCP arg docs, OpenAPI + regenerated types,
node-detail inline editor.
Also marks the already-shipped backup-import roadmap item.
Generated with [Devin](https://devin.ai)
Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
27 lines
663 B
Go
27 lines
663 B
Go
package api
|
|
|
|
import "testing"
|
|
|
|
func TestDNSLabel(t *testing.T) {
|
|
cases := map[string]string{
|
|
"my-app": "my-app",
|
|
"My App_2": "my-app-2",
|
|
" web ": "web",
|
|
"__weird__name": "weird-name",
|
|
"---": "",
|
|
"": "",
|
|
}
|
|
for in, want := range cases {
|
|
if got := dnsLabel(in); got != want {
|
|
t.Errorf("dnsLabel(%q) = %q, want %q", in, got, want)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestDNSLabelLengthCap(t *testing.T) {
|
|
long := "a" + string(make([]byte, 0)) + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
|
|
if got := dnsLabel(long); len(got) > 63 {
|
|
t.Fatalf("label over 63 chars: %d", len(got))
|
|
}
|
|
}
|