From d961a6dceb7a1ccf999d2bb09cff032c0ff42038 Mon Sep 17 00:00:00 2001 From: Michael Bridgen Date: Tue, 3 Jul 2018 16:39:17 +0100 Subject: [PATCH] Allow dots in resource names Kubernetes resource names are DNS_SUBDOMAINs, which are basically DNS_LABELs joined together with dots. It's perfectly reasonable to have a name `foo.bar.baz`, for example. --- flux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux.go b/flux.go index 2e0cbc8af..cd2f812c0 100644 --- a/flux.go +++ b/flux.go @@ -14,8 +14,8 @@ var ( ErrInvalidServiceID = errors.New("invalid service ID") LegacyServiceIDRegexp = regexp.MustCompile("^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$") - ResourceIDRegexp = regexp.MustCompile("^([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$") - UnqualifiedResourceIDRegexp = regexp.MustCompile("^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$") + ResourceIDRegexp = regexp.MustCompile("^([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)/([a-zA-Z0-9_.-]+)$") + UnqualifiedResourceIDRegexp = regexp.MustCompile("^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_.-]+)$") ) // ResourceID is an opaque type which uniquely identifies a resource in an