[OHSS-33278]- Update Total Account Watcher to only count Active accounts
What is being added?
This resolves the current issue where 1,000 accounts were recently cleaned up in the rhcontrol account, and we reduced the ACCOUNT_LIMIT for all prod hive shards by 1,000. However, since AWS requires an account to be suspended for 90 days before deletion, the total account count includes suspended accounts. This prevents the creation of new accounts unless we raise the ACCOUNT_LIMIT back to 3,000, which we aim to avoid as it would result in 1,000 additional accounts being created.
Checklist before requesting review
- [ ] I have tested this locally
- [x] I have included unit tests
- [ ] I have updated any corresponding documentation
Steps To Manually Test
Please provide us steps to reproduce the scenarios needed to test this. If an integration test is provided, let us know how to run it. If not, enumerate the steps to validate this does what it's supposed to.
- Start the operator
- Run the thing
- Observe X in the spec for the thing
- Clean up the thing
Ref OHSS-33278
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 47.00%. Comparing base (
43258bd) to head (80f2334).
Additional details and impacted files
@@ Coverage Diff @@
## master #829 +/- ##
==========================================
+ Coverage 46.99% 47.00% +0.01%
==========================================
Files 45 45
Lines 6703 6705 +2
==========================================
+ Hits 3150 3152 +2
Misses 3223 3223
Partials 330 330
| Files | Coverage Δ | |
|---|---|---|
| pkg/totalaccountwatcher/totalaccountwatcher.go | 62.76% <100.00%> (+0.80%) |
:arrow_up: |
@reedcort: all tests passed!
Full PR test history. Your PR dashboard.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: AlexVulaj, reedcort
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [AlexVulaj]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment