@@ -7,9 +7,13 @@ import (
7
7
8
8
"github.com/solo-io/gloo/pkg/utils/kubeutils"
9
9
"github.com/solo-io/gloo/pkg/utils/requestutils/curl"
10
+ gloo_defaults "github.com/solo-io/gloo/projects/gloo/pkg/defaults"
10
11
"github.com/solo-io/gloo/test/gomega/matchers"
11
12
"github.com/solo-io/gloo/test/kubernetes/e2e"
12
13
testdefaults "github.com/solo-io/gloo/test/kubernetes/e2e/defaults"
14
+ "github.com/solo-io/solo-kit/pkg/api/v1/clients"
15
+ "github.com/solo-io/solo-kit/pkg/api/v1/resources"
16
+ "github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
13
17
"github.com/stretchr/testify/assert"
14
18
"github.com/stretchr/testify/suite"
15
19
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -94,15 +98,38 @@ func (s *testingSuite) BeforeTest(string, string) {
94
98
otelcolSelector ,
95
99
)
96
100
97
- // Attempt to apply tracingConfigManifest multiple times. The first time
98
- // fails regularly with this message: "failed to validate Proxy [namespace:
99
- // gloo-gateway-edge-test, name: gateway-proxy] with gloo validation:
100
- // HttpListener Error: ProcessingError. Reason: *v1.Upstream {
101
- // default.opentelemetry-collector } not found"
102
- s .Assert ().Eventually (func () bool {
103
- err := s .testInstallation .Actions .Kubectl ().ApplyFile (s .ctx , tracingConfigManifest )
104
- return err == nil
105
- }, time .Second * 30 , time .Second * 5 , "can apply gloo tracing config" )
101
+ err = s .testInstallation .Actions .Kubectl ().ApplyFile (s .ctx , tracingConfigManifest )
102
+ s .NoError (err , "can apply gloo tracing resources" )
103
+ // accept the upstream
104
+ s .testInstallation .Assertions .EventuallyResourceStatusMatchesState (
105
+ func () (resources.InputResource , error ) {
106
+ return s .testInstallation .ResourceClients .UpstreamClient ().Read (
107
+ otelcolUpstream .Namespace , otelcolUpstream .Name , clients.ReadOpts {Ctx : s .ctx })
108
+ },
109
+ core .Status_Accepted ,
110
+ gloo_defaults .GlooReporter ,
111
+ )
112
+ // accept the virtual service
113
+ s .testInstallation .Assertions .EventuallyResourceStatusMatchesState (
114
+ func () (resources.InputResource , error ) {
115
+ return s .testInstallation .ResourceClients .VirtualServiceClient ().Read (
116
+ tracingVs .Namespace , tracingVs .Name , clients.ReadOpts {Ctx : s .ctx })
117
+ },
118
+ core .Status_Accepted ,
119
+ gloo_defaults .GlooReporter ,
120
+ )
121
+
122
+ err = s .testInstallation .Actions .Kubectl ().ApplyFile (s .ctx , gatewayConfigManifest ,
123
+ "-n" , s .testInstallation .Metadata .InstallNamespace )
124
+ s .NoError (err , "can create gateway and service" )
125
+ s .testInstallation .Assertions .EventuallyResourceStatusMatchesState (
126
+ func () (resources.InputResource , error ) {
127
+ return s .testInstallation .ResourceClients .GatewayClient ().Read (
128
+ s .testInstallation .Metadata .InstallNamespace , "gateway-proxy-tracing" , clients.ReadOpts {Ctx : s .ctx })
129
+ },
130
+ core .Status_Accepted ,
131
+ gloo_defaults .GlooReporter ,
132
+ )
106
133
}
107
134
108
135
func (s * testingSuite ) AfterTest (string , string ) {
@@ -112,6 +139,10 @@ func (s *testingSuite) AfterTest(string, string) {
112
139
113
140
err = s .testInstallation .Actions .Kubectl ().DeleteFile (s .ctx , tracingConfigManifest )
114
141
s .Assertions .NoError (err , "can delete gloo tracing config" )
142
+
143
+ err = s .testInstallation .Actions .Kubectl ().DeleteFile (s .ctx , gatewayConfigManifest ,
144
+ "-n" , s .testInstallation .Metadata .InstallNamespace )
145
+ s .Assertions .NoError (err , "can delete gloo tracing config" )
115
146
}
116
147
117
148
func (s * testingSuite ) TestSpanNameTransformationsWithoutRouteDecorator () {
@@ -125,10 +156,12 @@ func (s *testingSuite) TestSpanNameTransformationsWithoutRouteDecorator() {
125
156
curl .WithHostHeader (testHostname ),
126
157
curl .WithPort (gatewayProxyPort ),
127
158
curl .WithPath (pathWithoutRouteDescriptor ),
159
+ curl .Silent (),
128
160
},
129
161
& matchers.HttpResponse {
130
162
StatusCode : http .StatusOK ,
131
163
},
164
+ 5 * time .Second , 30 * time .Second ,
132
165
)
133
166
134
167
s .EventuallyWithT (func (c * assert.CollectT ) {
@@ -150,10 +183,12 @@ func (s *testingSuite) TestSpanNameTransformationsWithRouteDecorator() {
150
183
curl .WithHostHeader ("example.com" ),
151
184
curl .WithPort (gatewayProxyPort ),
152
185
curl .WithPath (pathWithRouteDescriptor ),
186
+ curl .Silent (),
153
187
},
154
188
& matchers.HttpResponse {
155
189
StatusCode : http .StatusOK ,
156
190
},
191
+ 5 * time .Second , 30 * time .Second ,
157
192
)
158
193
159
194
s .EventuallyWithT (func (c * assert.CollectT ) {
0 commit comments