-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove bastion security group when disabling the bastion
We reconcile the security groups before the bastion, because the bastion needs its security group to be created first when managed security groups are enabled. When the bastion is disabled, we will try to delete the security group if it exists. In the first attempt, the security group will still be in-use by the bastion instance but then the bastion instance will be deleted in the next reconcile loop. We do that here because we don't want to manage the bastion security group from elsewhere, that could cause infinite loops between ReconCileSecurityGroups and ReconcileBastion. Therefore we try to delete the bastion security group as a best effort here and also when the cluster is deleted so we're sure it will be deleted at some point. Also, we're trying to remove it when the cluster is deleted in case it wasn't done before. This doesn't trigger an error if the security group didn't exist. Adding e2e tests to cover the scenarios: * Disabling the bastion should reduce the total number of managed SGs to 2. * Re-enabling it should make it to 3 SGs.
- Loading branch information
Showing
3 changed files
with
27 additions
and
5 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
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