mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-31 08:16:23 +00:00
tailcfg: add ServiceName
Rather than using a string everywhere and needing to clarify that the string should have the svc: prefix, create a separate type for Service names. Updates tailscale/corp#24607 Change-Id: I720e022f61a7221644bb60955b72cacf42f59960 Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>
This commit is contained in:
committed by
Adrian Dewhurst
parent
d1b378504c
commit
0fa7b4a236
@@ -66,7 +66,7 @@ func parseServiceNames(servicesArg string) ([]string, error) {
|
||||
if servicesArg != "" {
|
||||
services = strings.Split(servicesArg, ",")
|
||||
for _, svc := range services {
|
||||
err := tailcfg.CheckServiceName(svc)
|
||||
err := tailcfg.ServiceName(svc).Validate()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("service %q: %s", svc, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user