Skip to content

Commit b464f05

Browse files
committed
update backport after openshift#29794 for release-4.15
Signed-off-by: Jason Cho <[email protected]>
1 parent d94da81 commit b464f05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/monitortests/network/disruptionserviceloadbalancer/monitortest.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func (w *availability) StartCollection(ctx context.Context, adminRESTConfig *res
207207
// the host from the cluster's context
208208
if infra.Spec.PlatformSpec.Type == configv1.PowerVSPlatformType || infra.Spec.PlatformSpec.Type == configv1.IBMCloudPlatformType {
209209
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 {
211211
return err
212212
}
213213
}
@@ -328,7 +328,7 @@ func httpGetNoConnectionPoolTimeout(url string, timeout time.Duration) (*http.Re
328328
}
329329

330330
// 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 {
332332
oc := exutil.NewCLIForMonitorTest(tcpService.GetObjectMeta().GetNamespace())
333333

334334
var (
@@ -338,7 +338,7 @@ func checkHostnameReady(ctx context.Context, tcpService *corev1.Service, nodeTgt
338338

339339
wait.PollUntilContextTimeout(ctx, 15*time.Second, 60*time.Minute, true, func(ctx context.Context) (bool, error) {
340340
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()
342342
if err != nil {
343343
return false, nil
344344
}

0 commit comments

Comments
 (0)