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