storage_controller: fix ReconcilerWaiter::get_status (#8341)

## Problem
SeqWait::would_wait_for returns Ok in the case when we would not wait
for the sequence number and Err otherwise.
ReconcilerWaiter::get_status uses it the wrong way around. This can
cause the storage controller to go into a busy loop
and make it look unavailable to the k8s controller.

## Summary of changes
Use `SeqWait::would_wait_for` correctly.
This commit is contained in:
Vlad Lazar
2024-07-11 15:43:28 +01:00
committed by GitHub
parent e26ef640c1
commit d9a82468e2

View File

@@ -383,9 +383,9 @@ impl ReconcilerWaiter {
}
pub(crate) fn get_status(&self) -> ReconcilerStatus {
if self.seq_wait.would_wait_for(self.seq).is_err() {
if self.seq_wait.would_wait_for(self.seq).is_ok() {
ReconcilerStatus::Done
} else if self.error_seq_wait.would_wait_for(self.seq).is_err() {
} else if self.error_seq_wait.would_wait_for(self.seq).is_ok() {
ReconcilerStatus::Failed
} else {
ReconcilerStatus::InProgress