Skip to content

Commit

Permalink
fix(controller): Finish loop early when a PDB is deleted to avoid Sto…
Browse files Browse the repository at this point in the history
…rageErrors

Signed-off-by: Michael Riesberg-Timmer <MichaelRT@pallid.dev>
  • Loading branch information
michohl committed Aug 7, 2024
1 parent f2818d0 commit 896034a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ func (n *PDBController) reconcilePDBs(ctx context.Context, desiredPDBs, managedP
"namespace": managedPDB.Namespace,
"selector": managedPDB.Spec.Selector.String(),
}).Info("")

// If we delete a PDB then we don't want to attempt to update it later since this will
// result in a `StorageError` since we can't find the PDB to make an update to it.
continue
}

// check if PDBs are equal an only update if not
Expand Down

0 comments on commit 896034a

Please sign in to comment.