| 
5 | 5 | 	_ "embed"  | 
6 | 6 | 	"fmt"  | 
7 | 7 | 	"net/url"  | 
 | 8 | +	"os"  | 
8 | 9 | 	"time"  | 
9 | 10 | 
 
  | 
10 | 11 | 	"github.com/google/uuid"  | 
@@ -378,11 +379,35 @@ func (i *InvariantInClusterDisruption) StartCollection(ctx context.Context, admi  | 
378 | 379 | 		return fmt.Errorf("error getting openshift infrastructure: %v", err)  | 
379 | 380 | 	}  | 
380 | 381 | 
 
  | 
381 |  | -	internalAPI, err := url.Parse(infra.Status.APIServerInternalURL)  | 
382 |  | -	if err != nil {  | 
383 |  | -		return fmt.Errorf("error parsing api int url: %v", err)  | 
 | 382 | +	var apiIntHost string  | 
 | 383 | +	if isHypershift {  | 
 | 384 | +		_, hcpNamespace, err := exutil.GetHypershiftManagementClusterConfigAndNamespace()  | 
 | 385 | +		if err != nil {  | 
 | 386 | +			return fmt.Errorf("failed to get hypershift management cluster config and namespace: %w", err)  | 
 | 387 | +		}  | 
 | 388 | + | 
 | 389 | +		managementOC := exutil.NewHypershiftManagementCLI(hcpNamespace)  | 
 | 390 | +		// For Hypershift, only skip if it's specifically ARO HCP  | 
 | 391 | +		// Use management cluster client to check the control-plane-operator deployment  | 
 | 392 | +		if isAROHCPcluster, err := exutil.IsAroHCP(ctx, hcpNamespace, managementOC.AdminKubeClient()); err != nil {  | 
 | 393 | +			logrus.WithError(err).Warning("Failed to check if ARO HCP, assuming it's not")  | 
 | 394 | +		} else if isAROHCPcluster {  | 
 | 395 | +			i.notSupportedReason = "platform Hypershift - ARO HCP not supported"  | 
 | 396 | +			return nil  | 
 | 397 | +		}  | 
 | 398 | + | 
 | 399 | +		parsedURL, err := url.Parse(i.adminRESTConfig.Host)  | 
 | 400 | +		if err != nil {  | 
 | 401 | +			return fmt.Errorf("failed to parse adminRESTConfig.Host %q: %v", i.adminRESTConfig.Host, err)  | 
 | 402 | +		}  | 
 | 403 | +		apiIntHost = parsedURL.Host  | 
 | 404 | +	} else {  | 
 | 405 | +		internalAPI, err := url.Parse(infra.Status.APIServerInternalURL)  | 
 | 406 | +		if err != nil {  | 
 | 407 | +			return fmt.Errorf("error parsing api int url: %v", err)  | 
 | 408 | +		}  | 
 | 409 | +		apiIntHost = internalAPI.Hostname()  | 
384 | 410 | 	}  | 
385 |  | -	apiIntHost := internalAPI.Hostname()  | 
386 | 411 | 
 
  | 
387 | 412 | 	allNodes, err := i.kubeClient.CoreV1().Nodes().List(ctx, metav1.ListOptions{})  | 
388 | 413 | 	if err != nil {  | 
 | 
0 commit comments