Skip to content

Commit 0a4726a

Browse files
authored
revert subdomains of names feature (#2360)
1 parent 93640c5 commit 0a4726a

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

pkg/gateway/gateway.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func (g *gatewayModule) validateNameContracts() error {
348348
baseDomain := cfg.Domain
349349
if baseDomain == "" {
350350
// domain doesn't exist so no name workloads exist
351-
// or the domain was unset and name wokrloads will never be deleted
351+
// or the domain was unset and name workloads will never be deleted
352352
// should iterate over workloads instead?
353353
return nil
354354
}
@@ -574,10 +574,7 @@ func (g *gatewayModule) SetNamedProxy(wlID string, config zos.GatewayNameProxy)
574574
return "", errors.New("node doesn't support name proxy (doesn't have a domain)")
575575
}
576576

577-
subdomains := strings.Split(config.Name, ".")
578-
reservedName := subdomains[len(subdomains)-1]
579-
580-
if err := g.validateNameContract(reservedName, twinID); err != nil {
577+
if err := g.validateNameContract(config.Name, twinID); err != nil {
581578
return "", errors.Wrap(err, "failed to verify name contract")
582579
}
583580

pkg/gridtypes/zos/gw_name.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/threefoldtech/zos/pkg/gridtypes"
99
)
1010

11-
var gwNameRegex = regexp.MustCompile(`^([a-zA-Z0-9-_]+\.)?[a-zA-Z0-9-_]+$`)
11+
var gwNameRegex = regexp.MustCompile(`^[a-zA-Z0-9-_]+$`)
1212

1313
// GatewayNameProxy definition. this will proxy name.<zos.domain> to backends
1414
type GatewayNameProxy struct {

0 commit comments

Comments
 (0)