@@ -177,7 +177,7 @@ func (m *ManagedMachinePoolScope) FindNodePool(ctx context.Context) (*oke.NodePo
177177 reqList := oke.ListNodePoolsRequest {
178178 CompartmentId : common .String (m .OCIManagedCluster .Spec .CompartmentId ),
179179 ClusterId : m .OCIManagedControlPlane .Spec .ID ,
180- Name : common .String (m .OCIManagedMachinePool . GetName ()),
180+ Name : common .String (m .getNodePoolName ()),
181181 Page : page ,
182182 }
183183
@@ -199,6 +199,10 @@ func (m *ManagedMachinePoolScope) FindNodePool(ctx context.Context) (*oke.NodePo
199199 return nil , nil
200200}
201201
202+ func (m * ManagedMachinePoolScope ) getNodePoolName () string {
203+ return m .OCIManagedMachinePool .GetName ()
204+ }
205+
202206// CreateNodePool attempts to create a node pool
203207func (m * ManagedMachinePoolScope ) CreateNodePool (ctx context.Context ) (* oke.NodePool , error ) {
204208 m .Info ("Creating Node Pool" )
@@ -285,7 +289,7 @@ func (m *ManagedMachinePoolScope) CreateNodePool(ctx context.Context) (*oke.Node
285289 nodePoolDetails := oke.CreateNodePoolDetails {
286290 CompartmentId : common .String (m .OCIManagedCluster .Spec .CompartmentId ),
287291 ClusterId : m .OCIManagedControlPlane .Spec .ID ,
288- Name : common .String (m .OCIManagedMachinePool . Name ),
292+ Name : common .String (m .getNodePoolName () ),
289293 KubernetesVersion : m .OCIManagedMachinePool .Spec .Version ,
290294 NodeShape : common .String (m .OCIManagedMachinePool .Spec .NodeShape ),
291295 NodeShapeConfig : & nodeShapeConfig ,
@@ -506,7 +510,7 @@ func (m *ManagedMachinePoolScope) UpdateNodePool(ctx context.Context, pool *oke.
506510 }
507511 actual := m .getSpecFromAPIObject (pool )
508512 if ! reflect .DeepEqual (spec , actual ) ||
509- m .OCIManagedMachinePool . Name != * pool .Name || nodePoolSizeUpdateRequired {
513+ m .getNodePoolName () != * pool .Name || nodePoolSizeUpdateRequired {
510514 m .Logger .Info ("Updating node pool" )
511515 // printing json specs will help debug problems when there are spurious/unwanted updates
512516 jsonSpec , err := json .Marshal (* spec )
@@ -574,7 +578,7 @@ func (m *ManagedMachinePoolScope) UpdateNodePool(ctx context.Context, pool *oke.
574578 }
575579 }
576580 nodePoolDetails := oke.UpdateNodePoolDetails {
577- Name : common .String (m .OCIManagedMachinePool . Name ),
581+ Name : common .String (m .getNodePoolName () ),
578582 KubernetesVersion : m .OCIManagedMachinePool .Spec .Version ,
579583 NodeShape : common .String (m .OCIManagedMachinePool .Spec .NodeShape ),
580584 NodeShapeConfig : & nodeShapeConfig ,
0 commit comments