@@ -4,10 +4,11 @@ import (
44 "bytes"
55 "encoding/json"
66 "errors"
7- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
87 "reflect"
98 "testing"
109 "time"
10+
11+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1112)
1213
1314var parseTimeTests = []struct {
@@ -49,8 +50,11 @@ var clusterNames = []struct {
4950 {"acid-test" , "test" , "" , errors .New ("name must match {TEAM}-{NAME} format" )},
5051 {"-test" , "" , "" , errors .New ("team name is empty" )},
5152 {"-test" , "-" , "" , errors .New ("name must match {TEAM}-{NAME} format" )},
52- {"" , "-" , "" , errors .New ("name is too short" )},
53- {"-" , "-" , "" , errors .New ("name is too short" )},
53+ {"" , "-" , "" , errors .New ("cluster name must match {TEAM}-{NAME} format. Got cluster name '', team name '-'" )},
54+ {"-" , "-" , "" , errors .New ("cluster name must match {TEAM}-{NAME} format. Got cluster name '-', team name '-'" )},
55+ // user may specify the team part of the full cluster name differently from the team name returned by the Teams API
56+ // in the case the actual Teams API name is long enough, this will fail the check
57+ {"foo-bar" , "qwerty" , "" , errors .New ("cluster name must match {TEAM}-{NAME} format. Got cluster name 'foo-bar', team name 'qwerty'" )},
5458}
5559
5660var cloneClusterDescriptions = []struct {
0 commit comments