@@ -54,7 +54,7 @@ func buildOCMConnection(secret string) (*ocmsdk.Connection, error) {
54
54
}
55
55
56
56
func MachinePools (t Test , connection * ocmsdk.Connection ) func (g gomega.Gomega ) []* cmv1.MachinePool {
57
- osdClusterId , found := GetOsdClusterId ()
57
+ osdClusterId , found := GetClusterId ()
58
58
t .Expect (found ).To (gomega .BeTrue (), "OSD cluster id not found, please configure environment properly" )
59
59
60
60
return func (g gomega.Gomega ) []* cmv1.MachinePool {
@@ -76,3 +76,23 @@ func MachinePoolId(machinePool *cmv1.MachinePool) string {
76
76
func MachinePoolLabels (machinePool * cmv1.MachinePool ) map [string ]string {
77
77
return machinePool .Labels ()
78
78
}
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