Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cloud/scope/managedmachinepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func (s *ManagedMachinePoolScope) Region() string {

// NodePoolLocation returns the location of the node pool.
func (s *ManagedMachinePoolScope) NodePoolLocation() string {
return fmt.Sprintf("projects/%s/locations/%s/clusters/%s", s.GCPManagedControlPlane.Spec.Project, s.Region(), s.GCPManagedControlPlane.Spec.ClusterName)
return fmt.Sprintf("projects/%s/locations/%s/clusters/%s", s.GCPManagedControlPlane.Spec.Project, s.GCPManagedControlPlane.Spec.Location, s.GCPManagedControlPlane.Spec.ClusterName)
}

// NodePoolFullName returns the full name of the node pool.
Expand Down
2 changes: 1 addition & 1 deletion cloud/services/container/clusters/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (s *Service) createCluster(ctx context.Context, log *logr.Logger) error {
nodePools, machinePools, _ := s.scope.GetAllNodePools(ctx)

log.V(2).Info("Running pre-flight checks on machine pools before cluster creation")
if err := shared.ManagedMachinePoolsPreflightCheck(nodePools, machinePools, s.scope.Region()); err != nil {
if err := shared.ManagedMachinePoolsPreflightCheck(nodePools, machinePools, s.scope.GCPManagedControlPlane.Spec.Location); err != nil {
return fmt.Errorf("preflight checks on machine pools before cluster create: %w", err)
}

Expand Down
4 changes: 2 additions & 2 deletions cloud/services/container/nodepools/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ func (s *Service) getInstances(ctx context.Context, nodePool *containerpb.NodePo

func (s *Service) createNodePool(ctx context.Context, log *logr.Logger) error {
log.V(2).Info("Running pre-flight checks on machine pool before creation")
if err := shared.ManagedMachinePoolPreflightCheck(s.scope.GCPManagedMachinePool, s.scope.MachinePool, s.scope.Region()); err != nil {
if err := shared.ManagedMachinePoolPreflightCheck(s.scope.GCPManagedMachinePool, s.scope.MachinePool, s.scope.GCPManagedControlPlane.Spec.Location); err != nil {
return fmt.Errorf("preflight checks on machine pool before creating: %w", err)
}

isRegional := shared.IsRegional(s.scope.Region())
isRegional := shared.IsRegional(s.scope.GCPManagedControlPlane.Spec.Location)

createNodePoolRequest := &containerpb.CreateNodePoolRequest{
NodePool: scope.ConvertToSdkNodePool(*s.scope.GCPManagedMachinePool, *s.scope.MachinePool, isRegional, s.scope.GCPManagedControlPlane.Spec.ClusterName),
Expand Down