@@ -14,44 +14,44 @@ func TestValidateAppHostnameLength(t *testing.T) {
14
14
t .Parallel ()
15
15
16
16
tests := []struct {
17
- name string
17
+ name string
18
18
subdomainName string
19
- expected bool
19
+ expected bool
20
20
}{
21
21
{
22
- name : "empty hostname" ,
22
+ name : "empty hostname" ,
23
23
subdomainName : "" ,
24
- expected : true ,
24
+ expected : true ,
25
25
},
26
26
{
27
- name : "valid short hostname" ,
27
+ name : "valid short hostname" ,
28
28
subdomainName : "app--agent--workspace--user" ,
29
- expected : true ,
29
+ expected : true ,
30
30
},
31
31
{
32
- name : "valid hostname with max length segment" ,
32
+ name : "valid hostname with max length segment" ,
33
33
subdomainName : "a12345678901234567890123456789012345678901234567890123456789012--agent--workspace--user" , // 63 chars in first segment
34
- expected : true ,
34
+ expected : true ,
35
35
},
36
36
{
37
- name : "invalid hostname with long app name" ,
37
+ name : "invalid hostname with long app name" ,
38
38
subdomainName : "toolongappnamethatexceedsthednslimitof63charactersforsureandshouldfail--agent--workspace--user" , // 78 chars in first segment
39
- expected : false ,
39
+ expected : false ,
40
40
},
41
41
{
42
- name : "invalid hostname with long agent name" ,
42
+ name : "invalid hostname with long agent name" ,
43
43
subdomainName : "app--toolongagentnamethatexceedsthednslimitof63charactersforsureandshouldfail--workspace--user" , // 72 chars in agent segment
44
- expected : false ,
44
+ expected : false ,
45
45
},
46
46
{
47
- name : "invalid hostname with long workspace name" ,
47
+ name : "invalid hostname with long workspace name" ,
48
48
subdomainName : "app--agent--toolongworkspacenamethatexceedsthednslimitof63charactersforsureandshouldfail--user" , // 77 chars in workspace segment
49
- expected : false ,
49
+ expected : false ,
50
50
},
51
51
{
52
- name : "invalid hostname with long username" ,
52
+ name : "invalid hostname with long username" ,
53
53
subdomainName : "app--agent--workspace--toolongusernamethatexceedsthednslimitof63charactersforsureandshouldfail" , // 72 chars in username segment
54
- expected : false ,
54
+ expected : false ,
55
55
},
56
56
}
57
57
@@ -119,4 +119,4 @@ func TestAppsWithHostnameLengthValidation(t *testing.T) {
119
119
require .Equal (t , tt .expectedHealth , apps [0 ].Health )
120
120
})
121
121
}
122
- }
122
+ }
0 commit comments