@@ -207,7 +207,7 @@ func (w *availability) StartCollection(ctx context.Context, adminRESTConfig *res
207
207
// the host from the cluster's context
208
208
if infra .Spec .PlatformSpec .Type == configv1 .PowerVSPlatformType || infra .Spec .PlatformSpec .Type == configv1 .IBMCloudPlatformType {
209
209
nodeTgt := "node/" + nodeList .Items [0 ].ObjectMeta .Name
210
- if err := checkHostnameReady (ctx , tcpService , nodeTgt ); err != nil {
210
+ if err := checkHostnameReady (ctx , tcpService , nodeTgt , w . namespaceName ); err != nil {
211
211
return err
212
212
}
213
213
}
@@ -328,7 +328,7 @@ func httpGetNoConnectionPoolTimeout(url string, timeout time.Duration) (*http.Re
328
328
}
329
329
330
330
// Uses the first node in the cluster to verify the LoadBalancer host is active before returning
331
- func checkHostnameReady (ctx context.Context , tcpService * corev1.Service , nodeTgt string ) error {
331
+ func checkHostnameReady (ctx context.Context , tcpService * corev1.Service , nodeTgt string , namespace string ) error {
332
332
oc := exutil .NewCLIForMonitorTest (tcpService .GetObjectMeta ().GetNamespace ())
333
333
334
334
var (
@@ -338,7 +338,7 @@ func checkHostnameReady(ctx context.Context, tcpService *corev1.Service, nodeTgt
338
338
339
339
wait .PollUntilContextTimeout (ctx , 15 * time .Second , 60 * time .Minute , true , func (ctx context.Context ) (bool , error ) {
340
340
logrus .Debug ("Checking load balancer host is active \n " )
341
- stdOut , _ , err = oc .AsAdmin ().WithoutNamespace ().RunInMonitorTest ("debug" ).Args (nodeTgt , "--" , "dig" , "+short" , "+notcp" , tcpService .Status .LoadBalancer .Ingress [0 ].Hostname ).Outputs ()
341
+ stdOut , _ , err = oc .AsAdmin ().WithoutNamespace ().RunInMonitorTest ("debug" ).Args (nodeTgt , "--to-namespace" + namespace , "-- " , "dig" , "+short" , "+notcp" , tcpService .Status .LoadBalancer .Ingress [0 ].Hostname ).Outputs ()
342
342
if err != nil {
343
343
return false , nil
344
344
}
0 commit comments