@@ -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,9 +26,7 @@ type checkSuite struct {
23
26
testInstallation * e2e.TestInstallation
24
27
}
25
28
26
- // NewChecksuite for glooctl check validation
27
- // TODO(nfuden): Fix clusterloadassignment issues that forced xds-metrics to be excluded.
28
- // Consider https://github.com/envoyproxy/envoy/issues/7529#issuecomment-1227724217
29
+ // NewCheckSuite for glooctl check validation
29
30
func NewCheckSuite (ctx context.Context , testInst * e2e.TestInstallation ) suite.TestingSuite {
30
31
return & checkSuite {
31
32
ctx : ctx ,
@@ -34,6 +35,7 @@ func NewCheckSuite(ctx context.Context, testInst *e2e.TestInstallation) suite.Te
34
35
}
35
36
36
37
func (s * checkSuite ) TestCheck () {
38
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
37
39
output , err := s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
38
40
"-n" , s .testInstallation .Metadata .InstallNamespace , "-x" , "xds-metrics" )
39
41
s .NoError (err )
@@ -50,6 +52,7 @@ func (s *checkSuite) TestCheck() {
50
52
}
51
53
52
54
func (s * checkSuite ) TestCheckExclude () {
55
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
53
56
for excludeKey , expectedOutput := range checkCommonGlooGatewayOutputByKey {
54
57
output , err := s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
55
58
"-n" , s .testInstallation .Metadata .InstallNamespace , "-x" , fmt .Sprintf ("xds-metrics,%s" , excludeKey ))
@@ -68,6 +71,7 @@ func (s *checkSuite) TestCheckExclude() {
68
71
}
69
72
70
73
func (s * checkSuite ) TestCheckReadOnly () {
74
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
71
75
output , err := s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
72
76
"-n" , s .testInstallation .Metadata .InstallNamespace , "--read-only" , "-x" , "xds-metrics" )
73
77
s .NoError (err )
@@ -92,11 +96,12 @@ func (s *checkSuite) TestCheckReadOnly() {
92
96
func (s * checkSuite ) TestCheckKubeContext () {
93
97
// When passing an invalid kube-context, `glooctl check` should succeed
94
98
_ , err := s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
95
- "-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , "invalid-context" )
99
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , "invalid-context" , "-x" , "xds-metrics" )
96
100
s .Error (err )
97
101
s .Contains (err .Error (), "Could not get kubernetes client: Error retrieving Kubernetes configuration: context \" invalid-context\" does not exist" )
98
102
99
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
100
105
_ , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
101
106
"-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , s .testInstallation .ClusterContext .KubeContext , "-x" , "xds-metrics" )
102
107
s .NoError (err )
@@ -110,7 +115,7 @@ func (s *checkSuite) TestCheckTimeout() {
110
115
s .NoError (err )
111
116
112
117
_ , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
113
- "-n" , s .testInstallation .Metadata .InstallNamespace ,
118
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "-x" , "xds-metrics" ,
114
119
"-c" , shortTimeoutValues .Name ())
115
120
s .Error (err )
116
121
s .Contains (err .Error (), "context deadline exceeded" )
@@ -121,38 +126,36 @@ func (s *checkSuite) TestCheckTimeout() {
121
126
_ , err = normalTimeoutValues .Write ([]byte (`checkTimeoutSeconds: 300s` ))
122
127
s .NoError (err )
123
128
124
- // Note: This test does not use `"-x", "xds-metrics"`, so it will require the xds-metrics check to pass with no errors
125
- // 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
126
130
_ , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
127
- "-n" , s .testInstallation .Metadata .InstallNamespace ,
131
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "-x" , "xds-metrics" ,
128
132
"-c" , normalTimeoutValues .Name ())
129
133
s .NoError (err )
130
134
}
131
135
132
136
func (s * checkSuite ) TestCheckNamespace () {
133
137
// namespace does not exist
134
- 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" )
135
139
s .Error (err )
136
140
s .Contains (output , "Could not communicate with kubernetes cluster: namespaces \" not-gloo-system\" not found" )
137
141
138
142
// gloo not in namespace
139
- 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" )
140
144
s .Error (err )
141
145
s .Contains (output , "Warning: The provided label selector (gloo) applies to no pods" )
142
146
143
147
// pod does not exist
144
- // Note: This test does not use `"-x", "xds-metrics"`, so it will require the xds-metrics check to pass with no errors
145
- // 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
146
149
output , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
147
- "-n" , s .testInstallation .Metadata .InstallNamespace ,
150
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "-x" , "xds-metrics" ,
148
151
"-p" , "not-gloo" )
149
152
s .NoError (err )
150
153
s .Contains (output , "Warning: The provided label selector (not-gloo) applies to no pods" )
151
154
s .Contains (output , "No problems detected." )
152
155
153
156
// resource namespace does not exist
154
157
output , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
155
- "-n" , s .testInstallation .Metadata .InstallNamespace ,
158
+ "-n" , s .testInstallation .Metadata .InstallNamespace , "-x" , "xds-metrics" ,
156
159
"-r" , "not-gloo-system" )
157
160
s .Error (err )
158
161
s .Contains (output , fmt .Sprintf ("No namespaces specified are currently being watched (defaulting to '%s' namespace)" , s .testInstallation .Metadata .InstallNamespace ))
@@ -192,6 +195,7 @@ func (s *checkSuite) TestNoGateways() {
192
195
Namespace : s .testInstallation .Metadata .InstallNamespace ,
193
196
}, gomega .Equal (0 ))
194
197
198
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
195
199
_ , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
196
200
"-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , s .testInstallation .ClusterContext .KubeContext , "-x" , "xds-metrics" )
197
201
s .Error (err )
@@ -219,6 +223,7 @@ func (s *checkSuite) TestEdgeGatewayScaled() {
219
223
Namespace : s .testInstallation .Metadata .InstallNamespace ,
220
224
}, gomega .Equal (0 ))
221
225
226
+ // exclude xds-metrics check due to Envoy bug: see TODO at top of file
222
227
output , err := s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
223
228
"-n" , s .testInstallation .Metadata .InstallNamespace , "--kube-context" , s .testInstallation .ClusterContext .KubeContext , "-x" , "xds-metrics" )
224
229
s .NoError (err )
@@ -252,9 +257,10 @@ func (s *checkSuite) TestEdgeResourceError() {
252
257
s .NoError (err )
253
258
254
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
255
261
gomega .Eventually (func () error {
256
262
_ , err = s .testInstallation .Actions .Glooctl ().Check (s .ctx ,
257
- "-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" )
258
264
return err
259
265
}, time .Minute * 2 , time .Second * 10 ).Should (gomega .SatisfyAll (
260
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