diff --git a/go.mod b/go.mod index 5130c2cd..8e96cf12 100644 --- a/go.mod +++ b/go.mod @@ -12,8 +12,8 @@ require ( github.com/nwidger/jsoncolor v0.3.1 github.com/onsi/ginkgo/v2 v2.2.0 github.com/onsi/gomega v1.20.2 - github.com/openshift-online/ocm-sdk-go v0.1.287 - github.com/openshift/rosa v1.2.7 + github.com/openshift-online/ocm-sdk-go v0.1.301 + github.com/openshift/rosa v1.2.10 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 github.com/spf13/cobra v1.5.0 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 6f1208c2..749c23cf 100644 --- a/go.sum +++ b/go.sum @@ -443,8 +443,14 @@ github.com/onsi/gomega v1.20.2 h1:8uQq0zMgLEfa0vRrrBgaJF2gyW9Da9BmfGV+OyUzfkY= github.com/onsi/gomega v1.20.2/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= github.com/openshift-online/ocm-sdk-go v0.1.287 h1:b8WqqXXZPl5GeUXhbxzQlf5IVjbZFdQbnr9q6b1MKXQ= github.com/openshift-online/ocm-sdk-go v0.1.287/go.mod h1:KYOw8kAKAHyPrJcQoVR82CneQ4ofC02Na4cXXaTq4Nw= +github.com/openshift-online/ocm-sdk-go v0.1.299 h1:R39Uebs+p32YlBnf+3gVgkbfAs1FC7zz0b84cO9uxmc= +github.com/openshift-online/ocm-sdk-go v0.1.299/go.mod h1:KYOw8kAKAHyPrJcQoVR82CneQ4ofC02Na4cXXaTq4Nw= +github.com/openshift-online/ocm-sdk-go v0.1.301 h1:lfj7d9AIRoCPNSYZ0hTqd74IeuQwFzYRkC0pBdJkjw8= +github.com/openshift-online/ocm-sdk-go v0.1.301/go.mod h1:KYOw8kAKAHyPrJcQoVR82CneQ4ofC02Na4cXXaTq4Nw= github.com/openshift/rosa v1.2.7 h1:Fgi3RTjlbPPV1HBum92Eag5zYj/vW6qOJaFVtrSQ3bQ= github.com/openshift/rosa v1.2.7/go.mod h1:ysof8Saj5l6Jv/4Hm4XOukIUQhK4GyOc8gYw0rlCKko= +github.com/openshift/rosa v1.2.10 h1:GJdy55Ypjk6rBOs6Cps8IbAreTmQE0pGLAT74roeoM8= +github.com/openshift/rosa v1.2.10/go.mod h1:oAduttUs4MTqPKXVxHS11T+m514rfY5f7JSBV4U2kqg= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= diff --git a/pkg/cluster/describe.go b/pkg/cluster/describe.go index 80b95cd7..719fd8ad 100644 --- a/pkg/cluster/describe.go +++ b/pkg/cluster/describe.go @@ -157,6 +157,18 @@ func PrintClusterDescription(connection *sdk.Connection, cluster *cmv1.Cluster) isExistingVPC = "true" } + // Check Hypershift-related values + mgmtCluster := "" + if cluster.Hypershift().Enabled() { + // Ignorning the error here as this endpoint is behind a specific permissioon + hypershiftResp, _ := connection.ClustersMgmt().V1().Clusters(). + Cluster(cluster.ID()). + Hypershift(). + Get(). + Send() + mgmtCluster = hypershiftResp.Body().ManagementCluster() + } + // Print short cluster description: fmt.Printf("\n"+ "ID: %s\n"+ @@ -226,6 +238,10 @@ func PrintClusterDescription(connection *sdk.Connection, cluster *cmv1.Cluster) if shard != "" { fmt.Printf("Shard: %v\n", shard) } + // This should be mutually exclusive with shard as it's hypershift specific + if mgmtCluster != "" { + fmt.Printf("Management Cluster: %s\n", mgmtCluster) + } if cluster.Proxy().HTTPProxy() != "" { fmt.Printf("HTTPProxy: %s\n", cluster.Proxy().HTTPProxy()) }