Add public, tier, node fields to ServiceDef

RouteDef gains Public field (bool) for edge routing. ServiceDef gains
Tier field. Node validation relaxed: defaults to tier=worker when both
node and tier are empty (v2 compatibility).

ToProto/FromProto updated to round-trip all new fields. Without this,
public=true in TOML was silently dropped and edge routing never triggered.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 22:42:00 -07:00
parent 9918859705
commit 22a836812f
2 changed files with 21 additions and 16 deletions

View File

@@ -119,14 +119,8 @@ func TestValidation(t *testing.T) {
},
wantErr: "service name is required",
},
{
name: "missing node",
def: &ServiceDef{
Name: "svc",
Components: []ComponentDef{{Name: "api", Image: "img:v1"}},
},
wantErr: "service node is required",
},
// v2: missing node no longer errors — defaults to tier=worker.
// Tested separately in TestValidationNodeTierDefault.
{
name: "empty components",
def: &ServiceDef{