@@ -26,15 +26,15 @@ func TestGenerateNoProxy(t *testing.T) {
26
26
cluster : & clusterv1.Cluster {},
27
27
expectedNoProxy : []string {
28
28
"localhost" , "127.0.0.1" , "kubernetes" , "kubernetes.default" ,
29
- ".svc" , ".svc.cluster.local" ,
29
+ ".svc" , ".svc.cluster.local" , ".svc.cluster.local." ,
30
30
},
31
31
}, {
32
32
name : "no networking config with additional no proxy" ,
33
33
cluster : & clusterv1.Cluster {},
34
34
additonalNo : []string {"example.com" },
35
35
expectedNoProxy : []string {
36
36
"localhost" , "127.0.0.1" , "kubernetes" , "kubernetes.default" ,
37
- ".svc" , ".svc.cluster.local" , "example.com" ,
37
+ ".svc" , ".svc.cluster.local" , ".svc.cluster.local." , " example.com" ,
38
38
},
39
39
}, {
40
40
name : "custom pod network" ,
@@ -49,7 +49,7 @@ func TestGenerateNoProxy(t *testing.T) {
49
49
},
50
50
expectedNoProxy : []string {
51
51
"localhost" , "127.0.0.1" , "10.0.0.0/24" , "10.0.1.0/24" , "kubernetes" ,
52
- "kubernetes.default" , ".svc" , ".svc.cluster.local" ,
52
+ "kubernetes.default" , ".svc" , ".svc.cluster.local" , ".svc.cluster.local." ,
53
53
},
54
54
}, {
55
55
name : "Unknown infrastructure cluster" ,
@@ -62,7 +62,7 @@ func TestGenerateNoProxy(t *testing.T) {
62
62
},
63
63
expectedNoProxy : []string {
64
64
"localhost" , "127.0.0.1" , "kubernetes" , "kubernetes.default" ,
65
- ".svc" , ".svc.cluster.local" ,
65
+ ".svc" , ".svc.cluster.local" , ".svc.cluster.local." ,
66
66
},
67
67
}, {
68
68
name : "AWS cluster" ,
@@ -75,7 +75,7 @@ func TestGenerateNoProxy(t *testing.T) {
75
75
},
76
76
expectedNoProxy : []string {
77
77
"localhost" , "127.0.0.1" , "kubernetes" , "kubernetes.default" ,
78
- ".svc" , ".svc.cluster.local" , "169.254.169.254" , ".elb.amazonaws.com" ,
78
+ ".svc" , ".svc.cluster.local" , ".svc.cluster.local." , " 169.254.169.254" , ".elb.amazonaws.com" ,
79
79
},
80
80
}, {
81
81
name : "AWS managed (EKS) cluster" ,
@@ -88,7 +88,7 @@ func TestGenerateNoProxy(t *testing.T) {
88
88
},
89
89
expectedNoProxy : []string {
90
90
"localhost" , "127.0.0.1" , "kubernetes" , "kubernetes.default" ,
91
- ".svc" , ".svc.cluster.local" , "169.254.169.254" , ".elb.amazonaws.com" ,
91
+ ".svc" , ".svc.cluster.local" , ".svc.cluster.local." , " 169.254.169.254" , ".elb.amazonaws.com" ,
92
92
},
93
93
}, {
94
94
name : "Azure cluster" ,
@@ -101,7 +101,7 @@ func TestGenerateNoProxy(t *testing.T) {
101
101
},
102
102
expectedNoProxy : []string {
103
103
"localhost" , "127.0.0.1" , "kubernetes" , "kubernetes.default" ,
104
- ".svc" , ".svc.cluster.local" , "169.254.169.254" ,
104
+ ".svc" , ".svc.cluster.local" , ".svc.cluster.local." , " 169.254.169.254" ,
105
105
},
106
106
}, {
107
107
name : "Azure managed (AKS) cluster" ,
@@ -114,7 +114,7 @@ func TestGenerateNoProxy(t *testing.T) {
114
114
},
115
115
expectedNoProxy : []string {
116
116
"localhost" , "127.0.0.1" , "kubernetes" , "kubernetes.default" ,
117
- ".svc" , ".svc.cluster.local" , "169.254.169.254" ,
117
+ ".svc" , ".svc.cluster.local" , ".svc.cluster.local." , " 169.254.169.254" ,
118
118
},
119
119
}, {
120
120
name : "GCP cluster" ,
@@ -127,7 +127,8 @@ func TestGenerateNoProxy(t *testing.T) {
127
127
},
128
128
expectedNoProxy : []string {
129
129
"localhost" , "127.0.0.1" , "kubernetes" , "kubernetes.default" ,
130
- ".svc" , ".svc.cluster.local" , "169.254.169.254" , "metadata" , "metadata.google.internal" ,
130
+ ".svc" , ".svc.cluster.local" , ".svc.cluster.local." ,
131
+ "169.254.169.254" , "metadata" , "metadata.google.internal" ,
131
132
},
132
133
}, {
133
134
name : "custom service network" ,
@@ -142,7 +143,7 @@ func TestGenerateNoProxy(t *testing.T) {
142
143
},
143
144
expectedNoProxy : []string {
144
145
"localhost" , "127.0.0.1" , "172.16.0.0/24" , "172.16.1.0/24" , "kubernetes" ,
145
- "kubernetes.default" , ".svc" , ".svc.cluster.local" ,
146
+ "kubernetes.default" , ".svc" , ".svc.cluster.local" , ".svc.cluster.local." ,
146
147
},
147
148
}, {
148
149
name : "custom servicedomain" ,
@@ -155,7 +156,7 @@ func TestGenerateNoProxy(t *testing.T) {
155
156
},
156
157
expectedNoProxy : []string {
157
158
"localhost" , "127.0.0.1" , "kubernetes" , "kubernetes.default" ,
158
- ".svc" , ".svc.foo.bar" ,
159
+ ".svc" , ".svc.foo.bar" , ".svc.foo.bar." ,
159
160
},
160
161
}, {
161
162
name : "all options" ,
@@ -175,7 +176,7 @@ func TestGenerateNoProxy(t *testing.T) {
175
176
additonalNo : []string {"example.com" },
176
177
expectedNoProxy : []string {
177
178
"localhost" , "127.0.0.1" , "10.10.0.0/16" , "172.16.0.0/16" , "kubernetes" ,
178
- "kubernetes.default" , ".svc" , ".svc.foo.bar" , "example.com" ,
179
+ "kubernetes.default" , ".svc" , ".svc.foo.bar" , ".svc.foo.bar." , " example.com" ,
179
180
},
180
181
}}
181
182
0 commit comments