-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify bastion resource initialisation
Firstly, we remove the resource reconcile calls from the cluster flow before calling reconcileNormal/reconcileDelete because the guards around them and various other guards throughout the code are heavily inter-depdendent and hard to reason about. Instead, we push them to the the places we: * know they are required * know we are sufficiently initialised that they can work Firstly we resolve references at the top of reconcileBastion. We know the cluster has been initialised at this point, so we don't need to guard against it. This also means that it is always called when entering that function, so we don't need to guard against it not having been called during first cluster initialisation. We also force that function to re-reconcile if it calls deleteBastion(), because deleteBastion() removes the bastion status. We reconcile again, so we always know that it is set. We also add an explicit call to resource reconcile in the reconcileDelete flow. This is the only place we now need a 'weird' guard against the cluster network not having been set. We add a comment about that appropriate to its weirdness.
- Loading branch information
Showing
2 changed files
with
100 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters