@@ -42,11 +42,14 @@ func scaleMachinePool(aw *arbv1.AppWrapper, userRequestedInstanceType string, re
42
42
machinePoolID := strings .ReplaceAll (aw .Name + "-" + userRequestedInstanceType , "." , "-" )
43
43
createMachinePool , err := cmv1 .NewMachinePool ().ID (machinePoolID ).InstanceType (userRequestedInstanceType ).Replicas (replicas ).Labels (m ).Build ()
44
44
if err != nil {
45
- klog .Infof ( " Error creating machinepool %v" , err )
45
+ klog .Errorf ( ` Error building MachinePool: %v` , err )
46
46
}
47
-
48
- klog .Infof ("Create machinepool with instance type %v and name %v" , userRequestedInstanceType , createMachinePool .ID ())
49
- clusterMachinePools .Add ().Body (createMachinePool ).SendContext (context .Background ())
47
+ klog .Infof ("Built MachinePool with instance type %v and name %v" , userRequestedInstanceType , createMachinePool .ID ())
48
+ response , err := clusterMachinePools .Add ().Body (createMachinePool ).SendContext (context .Background ())
49
+ if err != nil {
50
+ klog .Errorf (`Error creating MachinePool: %v` , err )
51
+ }
52
+ klog .Infof ("Created MachinePool: %v" , response )
50
53
}
51
54
52
55
func deleteMachinePool (aw * arbv1.AppWrapper ) {
@@ -118,7 +121,10 @@ func getOCMClusterID(r *AppWrapperReconciler) error {
118
121
// Get the client for the resource that manages the collection of clusters:
119
122
collection := connection .ClustersMgmt ().V1 ().Clusters ()
120
123
121
- response , _ := collection .List ().Search (fmt .Sprintf ("external_id = '%s'" , internalClusterID )).Size (1 ).Page (1 ).SendContext (ctx )
124
+ response , err := collection .List ().Search (fmt .Sprintf ("external_id = '%s'" , internalClusterID )).Size (1 ).Page (1 ).SendContext (ctx )
125
+ if err != nil {
126
+ klog .Errorf (`Error getting cluster id: %v` , err )
127
+ }
122
128
123
129
response .Items ().Each (func (cluster * cmv1.Cluster ) bool {
124
130
ocmClusterID = cluster .ID ()
0 commit comments