Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkg/cli/admin/upgrade/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ func (o *options) Run(ctx context.Context) error {
return fmt.Errorf("no cluster operator information available - you must be connected to an OpenShift version 4 server")
}

if o.mockData.cvPath == "" {
infra, err := o.ConfigClient.ConfigV1().Infrastructures().Get(ctx, "cluster", metav1.GetOptions{})
if err != nil {
return fmt.Errorf("failed to get cluster infrastructure: %w", err)
}
if infra.Status.ControlPlaneTopology == configv1.ExternalTopologyMode {
return fmt.Errorf("upgrade status is not supported on Hosted Control Plane (HyperShift) clusters")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is already

func isHostedCluster(i *configv1.Infrastructure) bool {
	return i != nil && i.Status.ControlPlaneTopology == configv1.ExternalTopologyMode
}

in alerts.go, can we put that helper into a shared package and use that wherever necessary?

}

progressing := findClusterOperatorStatusCondition(cv.Status.Conditions, configv1.OperatorProgressing)
if progressing == nil {
return fmt.Errorf("no current %s info, see `oc describe clusterversion` for more details.\n", configv1.OperatorProgressing)
Expand Down