@@ -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 {
@@ -69,10 +69,26 @@ func GetMachinePools(t Test, connection *ocmsdk.Connection) []*cmv1.MachinePool
6969 return MachinePools (t , connection )(t )
7070}
7171
72- func MachinePoolId (machinePool * cmv1.MachinePool ) string {
73- return machinePool .ID ()
74- }
75-
7672func MachinePoolLabels (machinePool * cmv1.MachinePool ) map [string ]string {
7773 return machinePool .Labels ()
7874}
75+
76+ func NodePools (t Test , connection * ocmsdk.Connection ) func (g gomega.Gomega ) []* cmv1.NodePool {
77+ clusterId , found := GetClusterId ()
78+ t .Expect (found ).To (gomega .BeTrue (), "Cluster id not found, please configure environment properly" )
79+
80+ return func (g gomega.Gomega ) []* cmv1.NodePool {
81+ nodePoolsListResponse , err := connection .ClustersMgmt ().V1 ().Clusters ().Cluster (clusterId ).NodePools ().List ().Send ()
82+ g .Expect (err ).NotTo (gomega .HaveOccurred ())
83+ return nodePoolsListResponse .Items ().Slice ()
84+ }
85+ }
86+
87+ func GetNodePools (t Test , connection * ocmsdk.Connection ) []* cmv1.NodePool {
88+ t .T ().Helper ()
89+ return NodePools (t , connection )(t )
90+ }
91+
92+ func NodePoolLabels (nodePool * cmv1.NodePool ) map [string ]string {
93+ return nodePool .Labels ()
94+ }
0 commit comments