Skip to content

Commit 97deb53

Browse files
Merge pull request tigera#3862 from caseydavenport/casey-skip-degraded-terminating
Skip Typha scaling checks when we're terminating
2 parents e562418 + 4db53ce commit 97deb53

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

pkg/controller/installation/core_controller.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -952,19 +952,21 @@ func (r *ReconcileInstallation) Reconcile(ctx context.Context, request reconcile
952952
return reconcile.Result{}, nil
953953
}
954954

955-
// If the autoscalar is degraded then trigger a run and recheck the degraded status. If it is still degraded after the
956-
// the run the reset the degraded status and requeue the request.
957-
if r.typhaAutoscaler.isDegraded() {
958-
if err := r.typhaAutoscaler.triggerRun(); err != nil {
959-
r.status.SetDegraded(operator.ResourceScalingError, "Failed to scale typha", err, reqLogger)
960-
return reconcile.Result{RequeueAfter: utils.StandardRetry}, nil
955+
if !installationMarkedForDeletion {
956+
// If the autoscalar is degraded then trigger a run and recheck the degraded status. If it is still degraded after the
957+
// the run the reset the degraded status and requeue the request.
958+
if r.typhaAutoscaler.isDegraded() {
959+
if err := r.typhaAutoscaler.triggerRun(); err != nil {
960+
r.status.SetDegraded(operator.ResourceScalingError, "Failed to scale typha", err, reqLogger)
961+
return reconcile.Result{RequeueAfter: utils.StandardRetry}, nil
962+
}
961963
}
962-
}
963964

964-
if r.typhaAutoscalerNonClusterHost != nil && r.typhaAutoscalerNonClusterHost.isDegraded() {
965-
if err := r.typhaAutoscalerNonClusterHost.triggerRun(); err != nil {
966-
r.status.SetDegraded(operator.ResourceScalingError, "Failed to scale typha for noncluster hosts", err, reqLogger)
967-
return reconcile.Result{RequeueAfter: utils.StandardRetry}, nil
965+
if r.typhaAutoscalerNonClusterHost != nil && r.typhaAutoscalerNonClusterHost.isDegraded() {
966+
if err := r.typhaAutoscalerNonClusterHost.triggerRun(); err != nil {
967+
r.status.SetDegraded(operator.ResourceScalingError, "Failed to scale typha for noncluster hosts", err, reqLogger)
968+
return reconcile.Result{RequeueAfter: utils.StandardRetry}, nil
969+
}
968970
}
969971
}
970972

0 commit comments

Comments
 (0)