From 4cea82721b063d0792fdc37743d525a1aeb3a07d Mon Sep 17 00:00:00 2001 From: 9547 Date: Mon, 7 Jun 2021 23:33:02 +0800 Subject: [PATCH] cluster: support char dot(.) in cluster name --- pkg/cluster/clusterutil/cluster_name.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/clusterutil/cluster_name.go b/pkg/cluster/clusterutil/cluster_name.go index c9eaeeec09..cb8f82f5d3 100644 --- a/pkg/cluster/clusterutil/cluster_name.go +++ b/pkg/cluster/clusterutil/cluster_name.go @@ -28,7 +28,7 @@ var ( ) var ( - clusterNameRegexp = regexp.MustCompile(`^[a-zA-Z0-9\-_]+$`) + clusterNameRegexp = regexp.MustCompile(`^[a-zA-Z0-9\-_\.]+$`) ) // ValidateClusterNameOrError validates a cluster name and returns error if the name is invalid. @@ -40,7 +40,7 @@ func ValidateClusterNameOrError(n string) error { if !clusterNameRegexp.MatchString(n) { return ErrInvalidClusterName. New("Cluster name '%s' is invalid", n). - WithProperty(cliutil.SuggestionFromString("The cluster name should only contains alphabets, numbers, hyphen (-) and underscore (_).")) + WithProperty(cliutil.SuggestionFromString("The cluster name should only contain alphabets, numbers, hyphen (-), underscore (_), and dot (.).")) } return nil }