Skip to content

Commit

Permalink
fix the hypershift detection
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeng committed Nov 22, 2024
1 parent eebf3e6 commit ea35feb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/cluster/transferowner.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ func (o *transferOwnerOptions) run() error {

o.hypershift, err = utils.IsHostedCluster(o.clusterID)
if err != nil {
return fmt.Errorf("failed to check if the given cluster is HCP")
return fmt.Errorf("failed to check if the given cluster is HCP: %w", err)
}

// Find and setup all resources that are needed
Expand Down
4 changes: 2 additions & 2 deletions pkg/utils/ocm.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,12 @@ func IsHostedCluster(clusterID string) (bool, error) {
defer conn.Close()

cluster := conn.ClustersMgmt().V1().Clusters().Cluster(clusterID)
res, err := cluster.Hypershift().Get().Send()
res, err := cluster.Get().Send()
if err != nil {
return false, err
}

return res.Body().Enabled(), nil
return res.Body().Hypershift().Enabled(), nil
}

func GetHCPNamespace(clusterId string) (namespace string, err error) {
Expand Down

0 comments on commit ea35feb

Please sign in to comment.