diff --git a/api/v1/cluster_types.go b/api/v1/cluster_types.go index 7fa48345ea..0e91a433fc 100644 --- a/api/v1/cluster_types.go +++ b/api/v1/cluster_types.go @@ -550,6 +550,9 @@ type ClusterStatus struct { // List of instance names in the cluster InstanceNames []string `json:"instanceNames,omitempty"` + + // LastObservedSchedulerName the last schedulerName reconciled from the spec + LastObservedSchedulerName string `json:"lastObservedSchedulerName,omitempty"` } // InstanceReportedState describes the last reported state of an instance during a reconciliation loop diff --git a/controllers/cluster_upgrade.go b/controllers/cluster_upgrade.go index 6e82acfdba..41cf696f12 100644 --- a/controllers/cluster_upgrade.go +++ b/controllers/cluster_upgrade.go @@ -312,7 +312,7 @@ func IsPodNeedingRollout(status postgres.PostgresqlStatus, cluster *apiv1.Cluste // isPodNeedingUpdatedScheduler returns a boolean indicating if a restart is required and the relative message func isPodNeedingUpdatedScheduler(cluster *apiv1.Cluster, pod corev1.Pod) (bool, string) { - if pod.Spec.SchedulerName == cluster.Spec.SchedulerName { + if cluster.Spec.SchedulerName == "" || cluster.Spec.SchedulerName == pod.Spec.SchedulerName { return false, "" }