make sure name of the cluster matches format {teamname}-{clustername}

This commit is contained in:
Murat Kabilov 2017-04-12 16:24:56 +02:00
parent 71b93b4cc2
commit 79fdba4ac7
1 changed files with 2 additions and 2 deletions

View File

@ -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