@@ -158,6 +158,12 @@ func deployChartsAndApps(t *testing.T) {
158
158
}
159
159
160
160
require .NoError (t , err )
161
+
162
+ hostEp := hostEndpoint (t )
163
+ if len (hostEp ) == 0 {
164
+ require .Fail (t , "Host endpoint not found" )
165
+ }
166
+
161
167
replacements := struct {
162
168
K8sClusterEndpoint string
163
169
AgentEndpoint string
@@ -168,13 +174,13 @@ func deployChartsAndApps(t *testing.T) {
168
174
LogObjectsHecEndpoint string
169
175
KubeTestEnv string
170
176
}{
171
- fmt .Sprintf ("http://%s:%d" , hostEndpoint ( t ) , signalFxReceiverK8sClusterReceiverPort ),
172
- fmt .Sprintf ("http://%s:%d" , hostEndpoint ( t ) , signalFxReceiverPort ),
173
- fmt .Sprintf ("http://%s:%d" , hostEndpoint ( t ) , hecReceiverPort ),
174
- fmt .Sprintf ("http://%s:%d/services/collector" , hostEndpoint ( t ) , hecMetricsReceiverPort ),
175
- fmt .Sprintf ("%s:%d" , hostEndpoint ( t ) , otlpReceiverPort ),
176
- fmt .Sprintf ("http://%s:%d" , hostEndpoint ( t ) , apiPort ),
177
- fmt .Sprintf ("http://%s:%d/services/collector" , hostEndpoint ( t ) , hecLogsObjectsReceiverPort ),
177
+ fmt .Sprintf ("http://%s:%d" , hostEp , signalFxReceiverK8sClusterReceiverPort ),
178
+ fmt .Sprintf ("http://%s:%d" , hostEp , signalFxReceiverPort ),
179
+ fmt .Sprintf ("http://%s:%d" , hostEp , hecReceiverPort ),
180
+ fmt .Sprintf ("http://%s:%d/services/collector" , hostEp , hecMetricsReceiverPort ),
181
+ fmt .Sprintf ("%s:%d" , hostEp , otlpReceiverPort ),
182
+ fmt .Sprintf ("http://%s:%d" , hostEp , apiPort ),
183
+ fmt .Sprintf ("http://%s:%d/services/collector" , hostEp , hecLogsObjectsReceiverPort ),
178
184
kubeTestEnv ,
179
185
}
180
186
tmpl , err := template .New ("" ).Parse (string (valuesBytes ))
@@ -1312,7 +1318,9 @@ func hostEndpoint(t *testing.T) string {
1312
1318
network , err := client .NetworkInspect (ctx , "kind" , types.NetworkInspectOptions {})
1313
1319
require .NoError (t , err )
1314
1320
for _ , ipam := range network .IPAM .Config {
1315
- return ipam .Gateway
1321
+ if ipam .Gateway != "" {
1322
+ return ipam .Gateway
1323
+ }
1316
1324
}
1317
1325
require .Fail (t , "failed to find host endpoint" )
1318
1326
return ""
0 commit comments