Skip to content

Commit

Permalink
Merge pull request #28794 from jcho02/OCPBUGS-18534-patch
Browse files Browse the repository at this point in the history
OCPBUGS-18534: Pass namespace in function checkHostnameReady for monitortest
  • Loading branch information
openshift-merge-bot[bot] committed May 14, 2024
2 parents fa6c7e6 + 37a0c1b commit 5f629ff
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (w *availability) StartCollection(ctx context.Context, adminRESTConfig *res
// the host from the cluster's context
if infra.Spec.PlatformSpec.Type == configv1.PowerVSPlatformType || infra.Spec.PlatformSpec.Type == configv1.IBMCloudPlatformType {
nodeTgt := "node/" + nodeList.Items[0].ObjectMeta.Name
if err := checkHostnameReady(ctx, tcpService, nodeTgt); err != nil {
if err := checkHostnameReady(ctx, tcpService, nodeTgt, w.namespaceName); err != nil {
return err
}
}
Expand Down Expand Up @@ -360,7 +360,7 @@ func httpGetNoConnectionPoolTimeout(url string, timeout time.Duration) (*http.Re
}

// Uses the first node in the cluster to verify the LoadBalancer host is active before returning
func checkHostnameReady(ctx context.Context, tcpService *corev1.Service, nodeTgt string) error {
func checkHostnameReady(ctx context.Context, tcpService *corev1.Service, nodeTgt string, namespace string) error {
oc := exutil.NewCLIForMonitorTest(tcpService.GetObjectMeta().GetNamespace())

var (
Expand All @@ -370,7 +370,7 @@ func checkHostnameReady(ctx context.Context, tcpService *corev1.Service, nodeTgt

wait.PollUntilContextTimeout(ctx, 15*time.Second, 60*time.Minute, true, func(ctx context.Context) (bool, error) {
logrus.Debug("Checking load balancer host is active \n")
stdOut, _, err = oc.AsAdmin().WithoutNamespace().RunInMonitorTest("debug").Args(nodeTgt, "--", "dig", "+short", "+notcp", tcpService.Status.LoadBalancer.Ingress[0].Hostname).Outputs()
stdOut, _, err = oc.AsAdmin().WithoutNamespace().RunInMonitorTest("debug").Args(nodeTgt, "--to-namespace="+namespace, "--", "dig", "+short", "+notcp", tcpService.Status.LoadBalancer.Ingress[0].Hostname).Outputs()
if err != nil {
return false, nil
}
Expand Down

0 comments on commit 5f629ff

Please sign in to comment.