@@ -28,6 +28,7 @@ import (
2828 "github.com/go-logr/logr"
2929 infrastructurev1beta2 "github.com/oracle/cluster-api-provider-oci/api/v1beta2"
3030 "github.com/oracle/cluster-api-provider-oci/cloud/ociutil"
31+ "github.com/oracle/cluster-api-provider-oci/cloud/ociutil/ptr"
3132 "github.com/oracle/cluster-api-provider-oci/cloud/services/computemanagement"
3233 "github.com/oracle/cluster-api-provider-oci/cloud/services/containerengine"
3334 expinfra1 "github.com/oracle/cluster-api-provider-oci/exp/api/v1beta2"
@@ -555,8 +556,8 @@ func (m *ManagedMachinePoolScope) buildPlacementConfig(configs []expinfra1.Place
555556 for _ , config := range configs {
556557 subnetId := m .getWorkerMachineSubnet (config .SubnetName )
557558 if subnetId == nil {
558- return nil , errors .New (fmt .Sprintf ("worker subnet with name %s is not present in spec" ,
559- * config .SubnetName ))
559+ return nil , errors .New (fmt .Sprintf ("worker subnet %s is not present in placementConfigs spec" ,
560+ ptr . ToString ( config .SubnetName ) ))
560561 }
561562 placementConfigs = append (placementConfigs , oke.NodePoolPlacementConfigDetails {
562563 AvailabilityDomain : config .AvailabilityDomain ,
@@ -581,7 +582,7 @@ func (m *ManagedMachinePoolScope) getInitialNodeKeyValuePairs() []oke.KeyValue {
581582
582583func (m * ManagedMachinePoolScope ) getWorkerMachineSubnet (name * string ) * string {
583584 for _ , subnet := range m .OCIManagedCluster .Spec .NetworkSpec .Vcn .Subnets {
584- if subnet != nil && subnet .ID != nil && subnet .Name == * name {
585+ if subnet != nil && subnet .ID != nil && subnet .Name == ptr . ToString ( name ) {
585586 return subnet .ID
586587 }
587588 }
0 commit comments