@@ -4,10 +4,11 @@ import (
4
4
"bytes"
5
5
"encoding/json"
6
6
"errors"
7
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
8
7
"reflect"
9
8
"testing"
10
9
"time"
10
+
11
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
11
12
)
12
13
13
14
var parseTimeTests = []struct {
@@ -49,8 +50,11 @@ var clusterNames = []struct {
49
50
{"acid-test" , "test" , "" , errors .New ("name must match {TEAM}-{NAME} format" )},
50
51
{"-test" , "" , "" , errors .New ("team name is empty" )},
51
52
{"-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'" )},
54
58
}
55
59
56
60
var cloneClusterDescriptions = []struct {
0 commit comments