@@ -12,6 +12,9 @@ import (
12
12
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
13
13
)
14
14
15
+ // TODO(nfuden): Fix clusterloadassignment issues that forced xds-metrics to be excluded.
16
+ // Consider https://github.com/envoyproxy/envoy/issues/7529#issuecomment-1227724217
17
+
15
18
var _ e2e.NewSuiteFunc = NewCheckSuite
16
19
17
20
// checkSuite contains the set of tests to validate the behavior of `glooctl check`
@@ -23,6 +26,7 @@ type checkSuite struct {
23
26
testInstallation * e2e.TestInstallation
24
27
}
25
28
29
+ // NewCheckSuite for glooctl check validation
26
30
func NewCheckSuite (ctx context.Context , testInst * e2e.TestInstallation ) suite.TestingSuite {
27
31
return & checkSuite {
28
32
ctx : ctx ,
@@ -31,6 +35,7 @@ func NewCheckSuite(ctx context.Context, testInst *e2e.TestInstallation) suite.Te
31
35
}
32
36
33
37
func (s * checkSuite ) TestCheck () {
38
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
34
39
output , err := s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
35
40
"-n" , s .testInstallation .Metadata .InstallNamespace , "-x" , "xds-metrics" )
36
41
s .NoError (err )
@@ -47,6 +52,7 @@ func (s *checkSuite) TestCheck() {
47
52
}
48
53
49
54
func (s * checkSuite ) TestCheckExclude () {
55
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
50
56
for excludeKey , expectedOutput := range checkCommonGlooGatewayOutputByKey {
51
57
output , err := s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
52
58
"-n" , s .testInstallation .Metadata .InstallNamespace , "-x" , fmt .Sprintf ("xds-metrics,%s" , excludeKey ))
@@ -65,8 +71,9 @@ func (s *checkSuite) TestCheckExclude() {
65
71
}
66
72
67
73
func (s * checkSuite ) TestCheckReadOnly () {
74
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
68
75
output , err := s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
69
- "-n" , s .testInstallation .Metadata .InstallNamespace , "--read-only" )
76
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "--read-only" , "-x" , "xds-metrics" )
70
77
s .NoError (err )
71
78
72
79
for _ , expectedOutput := range checkCommonGlooGatewayOutputByKey {
@@ -89,13 +96,14 @@ func (s *checkSuite) TestCheckReadOnly() {
89
96
func (s * checkSuite ) TestCheckKubeContext () {
90
97
// When passing an invalid kube-context, `glooctl check` should succeed
91
98
_ , err := s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
92
- "-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , "invalid-context" )
99
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , "invalid-context" , "-x" , "xds-metrics" )
93
100
s .Error (err )
94
101
s .Contains (err .Error (), "Could not get kubernetes client: Error retrieving Kubernetes configuration: context \" invalid-context\" does not exist" )
95
102
96
103
// When passing the kube-context of the running cluster, `glooctl check` should succeed
104
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
97
105
_ , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
98
- "-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , s .testInstallation .ClusterContext .KubeContext )
106
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , s .testInstallation .ClusterContext .KubeContext , "-x" , "xds-metrics" )
99
107
s .NoError (err )
100
108
}
101
109
@@ -107,7 +115,7 @@ func (s *checkSuite) TestCheckTimeout() {
107
115
s .NoError (err )
108
116
109
117
_ , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
110
- "-n" , s .testInstallation .Metadata .InstallNamespace ,
118
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "-x" , "xds-metrics" ,
111
119
"-c" , shortTimeoutValues .Name ())
112
120
s .Error (err )
113
121
s .Contains (err .Error (), "context deadline exceeded" )
@@ -118,38 +126,36 @@ func (s *checkSuite) TestCheckTimeout() {
118
126
_ , err = normalTimeoutValues .Write ([]byte (`checkTimeoutSeconds: 300s` ))
119
127
s .NoError (err )
120
128
121
- // Note: This test does not use `"-x", "xds-metrics"`, so it will require the xds-metrics check to pass with no errors
122
- // In gloo-ee the prometheus metrics must be enabled for the check to pass
129
+ // exclude xds-metrics due to Envoy bug: see TODO at top of file
123
130
_ , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
124
- "-n" , s .testInstallation .Metadata .InstallNamespace ,
131
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "-x" , "xds-metrics" ,
125
132
"-c" , normalTimeoutValues .Name ())
126
133
s .NoError (err )
127
134
}
128
135
129
136
func (s * checkSuite ) TestCheckNamespace () {
130
137
// namespace does not exist
131
- output , err := s .testInstallation .Actions .Glooctl ().Check (s .ctx , "-n" , "not-gloo-system" )
138
+ output , err := s .testInstallation .Actions .Glooctl ().Check (s .ctx , "-n" , "not-gloo-system" , "-x" , "xds-metrics" )
132
139
s .Error (err )
133
140
s .Contains (output , "Could not communicate with kubernetes cluster: namespaces \" not-gloo-system\" not found" )
134
141
135
142
// gloo not in namespace
136
- output , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx , "-n" , "default" )
143
+ output , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx , "-n" , "default" , "-x" , "xds-metrics" )
137
144
s .Error (err )
138
145
s .Contains (output , "Warning: The provided label selector (gloo) applies to no pods" )
139
146
140
147
// pod does not exist
141
- // Note: This test does not use `"-x", "xds-metrics"`, so it will require the xds-metrics check to pass with no errors
142
- // In gloo-ee the prometheus metrics must be enabled for the check to pass
148
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
143
149
output , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
144
- "-n" , s .testInstallation .Metadata .InstallNamespace ,
150
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "-x" , "xds-metrics" ,
145
151
"-p" , "not-gloo" )
146
152
s .NoError (err )
147
153
s .Contains (output , "Warning: The provided label selector (not-gloo) applies to no pods" )
148
154
s .Contains (output , "No problems detected." )
149
155
150
156
// resource namespace does not exist
151
157
output , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
152
- "-n" , s .testInstallation .Metadata .InstallNamespace ,
158
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "-x" , "xds-metrics" ,
153
159
"-r" , "not-gloo-system" )
154
160
s .Error (err )
155
161
s .Contains (output , fmt .Sprintf ("No namespaces specified are currently being watched (defaulting to '%s' namespace)" , s .testInstallation .Metadata .InstallNamespace ))
@@ -189,6 +195,7 @@ func (s *checkSuite) TestNoGateways() {
189
195
Namespace : s .testInstallation .Metadata .InstallNamespace ,
190
196
}, gomega .Equal (0 ))
191
197
198
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
192
199
_ , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
193
200
"-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , s .testInstallation .ClusterContext .KubeContext , "-x" , "xds-metrics" )
194
201
s .Error (err )
@@ -216,6 +223,7 @@ func (s *checkSuite) TestEdgeGatewayScaled() {
216
223
Namespace : s .testInstallation .Metadata .InstallNamespace ,
217
224
}, gomega .Equal (0 ))
218
225
226
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
219
227
output , err := s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
220
228
"-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , s .testInstallation .ClusterContext .KubeContext , "-x" , "xds-metrics" )
221
229
s .NoError (err )
@@ -249,9 +257,10 @@ func (s *checkSuite) TestEdgeResourceError() {
249
257
s .NoError (err )
250
258
251
259
// Run check. This needs to run in eventually to get all errors reported
260
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
252
261
gomega .Eventually (func () error {
253
262
_ , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
254
- "-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , s .testInstallation .ClusterContext .KubeContext )
263
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , s .testInstallation .ClusterContext .KubeContext , "-x" , "xds-metrics" )
255
264
return err
256
265
}, time .Minute * 2 , time .Second * 10 ).Should (gomega .SatisfyAll (
257
266
gomega .MatchError (gomega .ContainSubstring (fmt .Sprintf ("* Found rejected virtual service by '%s': default reject-me-too (Reason: 2 errors occurred:" , s .testInstallation .Metadata .InstallNamespace ))),
0 commit comments