Skip to content

Commit

Permalink
Check more than state on reconciling cluster installations (#305)
Browse files Browse the repository at this point in the history
The new check also verifies the replica count and version values
before proceeding. This shouldn't be necessary, but is being added
to avoid a temporary problem with cluster installation states being
reported as stable briefly before being corrected by the operator.
  • Loading branch information
gabrieljackson authored Sep 10, 2020
1 parent 6071b29 commit fbd69de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/supervisor/cluster_installation.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,19 +230,19 @@ func (s *ClusterInstallationSupervisor) deleteClusterInstallation(clusterInstall
}

func (s *ClusterInstallationSupervisor) checkReconcilingClusterInstallation(clusterInstallation *model.ClusterInstallation, logger log.FieldLogger, installation *model.Installation, cluster *model.Cluster) string {

cr, err := s.provisioner.GetClusterInstallationResource(cluster, installation, clusterInstallation)
if err != nil {
logger.WithError(err).Error("Failed to get cluster installation resource")
return model.ClusterInstallationStateReconciling
}

if cr.Status.State != mmv1alpha1.Stable {
if cr.Status.State != mmv1alpha1.Stable ||
cr.Spec.Replicas != cr.Status.Replicas ||
cr.Spec.Version != cr.Status.Version {
logger.Info("Cluster installation is still reconciling")
return model.ClusterInstallationStateReconciling
}

logger.Info("Cluster installation finished reconciling")
return model.ClusterInstallationStateStable

}

0 comments on commit fbd69de

Please sign in to comment.