@@ -54,7 +54,7 @@ func buildOCMConnection(secret string) (*ocmsdk.Connection, error) {
5454}
5555
5656func MachinePools (t Test , connection * ocmsdk.Connection ) func (g gomega.Gomega ) []* cmv1.MachinePool {
57- osdClusterId , found := GetOsdClusterId ()
57+ osdClusterId , found := GetClusterId ()
5858 t .Expect (found ).To (gomega .BeTrue (), "OSD cluster id not found, please configure environment properly" )
5959
6060 return func (g gomega.Gomega ) []* cmv1.MachinePool {
@@ -76,3 +76,23 @@ func MachinePoolId(machinePool *cmv1.MachinePool) string {
7676func MachinePoolLabels (machinePool * cmv1.MachinePool ) map [string ]string {
7777 return machinePool .Labels ()
7878}
79+
80+ func NodePools (t Test , connection * ocmsdk.Connection ) func (g gomega.Gomega ) []* cmv1.NodePool {
81+ clusterId , found := GetClusterId ()
82+ t .Expect (found ).To (gomega .BeTrue (), "Cluster id not found, please configure environment properly" )
83+
84+ return func (g gomega.Gomega ) []* cmv1.NodePool {
85+ nodePoolsListResponse , err := connection .ClustersMgmt ().V1 ().Clusters ().Cluster (clusterId ).NodePools ().List ().Send ()
86+ g .Expect (err ).NotTo (gomega .HaveOccurred ())
87+ return nodePoolsListResponse .Items ().Slice ()
88+ }
89+ }
90+
91+ func GetNodePools (t Test , connection * ocmsdk.Connection ) []* cmv1.NodePool {
92+ t .T ().Helper ()
93+ return NodePools (t , connection )(t )
94+ }
95+
96+ func NodePoolLabels (nodePool * cmv1.NodePool ) map [string ]string {
97+ return nodePool .Labels ()
98+ }
0 commit comments