make sure name of the cluster matches format {teamname}-{clustername}
This commit is contained in:
		
							parent
							
								
									71b93b4cc2
								
							
						
					
					
						commit
						79fdba4ac7
					
				|  | @ -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 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue