From 79fdba4ac788d0b11ad3b1725335810e80135ff3 Mon Sep 17 00:00:00 2001 From: Murat Kabilov Date: Wed, 12 Apr 2017 16:24:56 +0200 Subject: [PATCH] make sure name of the cluster matches format {teamname}-{clustername} --- pkg/spec/postgresql.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/spec/postgresql.go b/pkg/spec/postgresql.go index 4d85c3157..b5b7ef7b0 100644 --- a/pkg/spec/postgresql.go +++ b/pkg/spec/postgresql.go @@ -196,8 +196,8 @@ func clusterName(clusterName string, teamName string) (string, error) { if len(clusterName) < teamNameLen+2 { return "", fmt.Errorf("Name is too short") } - if strings.ToLower(clusterName[:teamNameLen]) != strings.ToLower(teamName) { - return "", fmt.Errorf("Name must start with the team name") + if strings.ToLower(clusterName[:teamNameLen+1]) != strings.ToLower(teamName) + "-" { + return "", fmt.Errorf("Name must start with the team name and dash") } return clusterName[teamNameLen+1:], nil