diff --git a/cmd/ocm/list/addon/cmd.go b/cmd/ocm/list/addon/cmd.go index 8c731f26..87b56409 100644 --- a/cmd/ocm/list/addon/cmd.go +++ b/cmd/ocm/list/addon/cmd.go @@ -23,7 +23,6 @@ import ( "github.com/openshift-online/ocm-cli/pkg/ocm" "github.com/openshift-online/ocm-cli/pkg/output" cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1" - "github.com/spf13/cobra" ) diff --git a/go.mod b/go.mod index 9acc7e0c..acb43b7b 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/nwidger/jsoncolor v0.3.2 github.com/onsi/ginkgo/v2 v2.11.0 github.com/onsi/gomega v1.27.8 - github.com/openshift-online/ocm-sdk-go v0.1.445 + github.com/openshift-online/ocm-sdk-go v0.1.447 github.com/openshift/rosa v1.2.24 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index fce7fce2..5248c93e 100644 --- a/go.sum +++ b/go.sum @@ -361,8 +361,8 @@ github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= -github.com/openshift-online/ocm-sdk-go v0.1.445 h1:NfaY+biXaREPnGYxa8G2zS2OZpN06yNnDR95sZoqKUQ= -github.com/openshift-online/ocm-sdk-go v0.1.445/go.mod h1:CiAu2jwl3ITKOxkeV0Qnhzv4gs35AmpIzVABQLtcI2Y= +github.com/openshift-online/ocm-sdk-go v0.1.447 h1:PLau6NVgTpwL+L5OcKrBZm+HbET34tjHbENd2GsFhRw= +github.com/openshift-online/ocm-sdk-go v0.1.447/go.mod h1:CiAu2jwl3ITKOxkeV0Qnhzv4gs35AmpIzVABQLtcI2Y= github.com/openshift/rosa v1.2.24 h1:vv0yYnWHx6CCPEAau/0rS54P2ksaf+uWXb1TQPWxiYE= github.com/openshift/rosa v1.2.24/go.mod h1:MVXB27O3PF8WoOic23I03mmq6/9kVxpFx6FKyLMCyrQ= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 85111b9a..e60a3bd5 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -28,6 +28,7 @@ import ( sdk "github.com/openshift-online/ocm-sdk-go" amv1 "github.com/openshift-online/ocm-sdk-go/accountsmgmt/v1" + asv1 "github.com/openshift-online/ocm-sdk-go/addonsmgmt/v1" cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1" ) @@ -755,7 +756,7 @@ func GetClusterAddOns(connection *sdk.Connection, clusterID string) ([]*AddOnIte quotaCosts := quotaCostResponse.Items() // Get complete list of enabled add-ons - addOnsResponse, err := connection.ClustersMgmt().V1().Addons(). + addOnsResponse, err := connection.AddonsMgmt().V1().Addons(). List(). Search("enabled='t'"). Page(1). @@ -767,7 +768,7 @@ func GetClusterAddOns(connection *sdk.Connection, clusterID string) ([]*AddOnIte addOns := addOnsResponse.Items() // Get add-ons already installed on cluster - addOnInstallationsResponse, err := connection.ClustersMgmt().V1().Clusters(). + addOnInstallationsResponse, err := connection.AddonsMgmt().V1().Clusters(). Cluster(clusterID). Addons(). List(). @@ -782,7 +783,7 @@ func GetClusterAddOns(connection *sdk.Connection, clusterID string) ([]*AddOnIte var clusterAddOns []*AddOnItem // Populate add-on installations with all add-on metadata - addOns.Each(func(addOn *cmv1.AddOn) bool { + addOns.Each(func(addOn *asv1.Addon) bool { if addOn.ID() != "rhmi" { clusterAddOn := AddOnItem{ ID: addOn.ID(), @@ -805,11 +806,11 @@ func GetClusterAddOns(connection *sdk.Connection, clusterID string) ([]*AddOnIte }) // Get the state of add-on installations on the cluster - addOnInstallations.Each(func(addOnInstallation *cmv1.AddOnInstallation) bool { + addOnInstallations.Each(func(addOnInstallation *asv1.AddonInstallation) bool { if addOn.ID() == addOnInstallation.Addon().ID() { clusterAddOn.State = string(addOnInstallation.State()) if clusterAddOn.State == "" { - clusterAddOn.State = string(cmv1.AddOnInstallationStateInstalling) + clusterAddOn.State = string(asv1.AddonInstallationStateInstalling) } } return true diff --git a/pkg/urls/url_expander.go b/pkg/urls/url_expander.go index 6d5d03e6..a6eb3d43 100644 --- a/pkg/urls/url_expander.go +++ b/pkg/urls/url_expander.go @@ -33,7 +33,7 @@ var listResourceURLs = map[string]string{ "roles": "/api/accounts_mgmt/v1/roles", "skus": "/api/accounts_mgmt/v1/skus", "sku_rules": "/api/accounts_mgmt/v1/sku_rules", - "addons": "/api/clusters_mgmt/v1/addons", + "addons": "/api/addons_mgmt/v1/addons", "clusters": "/api/clusters_mgmt/v1/clusters", "versions": "/api/clusters_mgmt/v1/versions", } @@ -52,7 +52,7 @@ var individualResourceURLs = map[string]string{ "sku": "/api/accounts_mgmt/v1/skus/%s", "sku_rule": "/api/accounts_mgmt/v1/sku_rules/%s", "cluster": "/api/clusters_mgmt/v1/clusters/%s", - "addon": "/api/clusters_mgmt/v1/addons/%s", + "addon": "/api/addons_mgmt/v1/addons/%s", "version": "/api/clusters_mgmt/v1/versions/%s", "idp": "idp/%s", "limitedsupportreasons": "/api/clusters_mgmt/v1/clusters/%s/limited_support_reasons",