Skip to content

Commit

Permalink
PCP-2585: MAAS cluster is stuck in provisioning if customEndpoint is …
Browse files Browse the repository at this point in the history
…present and customEndpointPort is not present (#140)
  • Loading branch information
AmitSahastra authored Mar 6, 2024
1 parent 75814d1 commit 1838d1f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/maas/scope/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,14 @@ func (s *ClusterScope) Close() error {

// APIServerPort returns the APIServerPort to use when creating the load balancer.
func (s *ClusterScope) APIServerPort() int {
if s.Cluster.Spec.ClusterNetwork != nil && s.Cluster.Spec.ClusterNetwork.APIServerPort != nil {
return int(*s.Cluster.Spec.ClusterNetwork.APIServerPort)
}

if infrautil.IsCustomEndpointPresent(s.MaasCluster.GetAnnotations()) {
if infrautil.IsCustomEndpointPresent(s.MaasCluster.GetAnnotations()) && s.MaasCluster.Spec.ControlPlaneEndpoint.Port != 0 {
return s.MaasCluster.Spec.ControlPlaneEndpoint.Port
}

if s.Cluster.Spec.ClusterNetwork != nil && s.Cluster.Spec.ClusterNetwork.APIServerPort != nil {
return int(*s.Cluster.Spec.ClusterNetwork.APIServerPort)
}
return 6443
}

Expand Down

0 comments on commit 1838d1f

Please sign in to comment.