From a6ee0b83bcf5076d9c04e6e0aae4473145d8a2cc Mon Sep 17 00:00:00 2001 From: Michael Burman Date: Fri, 26 Apr 2024 13:12:10 +0300 Subject: [PATCH] Remove InvalidState check, but keep the information in the Conditions --- CHANGELOG.md | 1 + pkg/reconciliation/reconcile_racks.go | 14 -------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e361ce20..cbcdfe7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Changelog for Cass Operator, new PRs should update the `main / unreleased` secti * [CHANGE] [#618](https://github.com/k8ssandra/cass-operator/issues/618) Update dependencies to support controller-runtime 0.17.2, modify required parts. * [ENHANCEMENT] [#628](https://github.com/k8ssandra/cass-operator/issues/628) Replace pod task can replace any node, including those that have crashed * [ENHANCEMENT] [#532](https://github.com/k8ssandra/cass-operator/issues/532) Instead of rejecting updates/creates with deprecated fields, return kubectl warnings. +* [BUGFIX] [#639](https://github.com/k8ssandra/cass-operator/issues/639) Remove InvalidState check, there's no need to block reconcile here. Keep the InvalidState as information for the user only. ## v1.19.1 diff --git a/pkg/reconciliation/reconcile_racks.go b/pkg/reconciliation/reconcile_racks.go index 56804e76..2e574eba 100644 --- a/pkg/reconciliation/reconcile_racks.go +++ b/pkg/reconciliation/reconcile_racks.go @@ -2286,16 +2286,6 @@ func (rc *ReconciliationContext) CheckClearActionConditions() result.ReconcileRe return result.Continue() } -func (rc *ReconciliationContext) CheckForInvalidState() result.ReconcileResult { - cond, isSet := rc.Datacenter.GetCondition(api.DatacenterValid) - if isSet && cond.Status == corev1.ConditionFalse { - err := fmt.Errorf("datacenter %s is not in a valid state: %s", rc.Datacenter.Name, cond.Message) - return result.Error(err) - } - - return result.Continue() -} - func (rc *ReconciliationContext) CheckStatefulSetControllerCaughtUp() result.ReconcileResult { if hasStatefulSetControllerCaughtUp(rc.statefulSets, rc.dcPods) { // We do this here instead of in CheckPodsReady where we fix stuck pods @@ -2348,10 +2338,6 @@ func (rc *ReconciliationContext) fixMissingPVC() (bool, error) { func (rc *ReconciliationContext) ReconcileAllRacks() (reconcile.Result, error) { rc.ReqLogger.Info("reconciliationContext::reconcileAllRacks") - if recResult := rc.CheckForInvalidState(); recResult.Completed() { - return recResult.Output() - } - logger := rc.ReqLogger podList, err := rc.listPods(rc.Datacenter.GetClusterLabels())