aws-account-operator icon indicating copy to clipboard operation
aws-account-operator copied to clipboard

[OHSS-33278]- Update Total Account Watcher to only count Active accounts

Open reedcort opened this issue 1 year ago • 3 comments

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.

  1. Start the operator
  2. Run the thing
  3. Observe X in the spec for the thing
  4. Clean up the thing

Ref OHSS-33278

reedcort avatar Jul 10 '24 17:07 reedcort

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

Impacted file tree graph

@@            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:

codecov-commenter avatar Jul 10 '24 19:07 codecov-commenter

@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.

openshift-ci[bot] avatar Aug 07 '24 19:08 openshift-ci[bot]

/lgtm

AlexVulaj avatar Aug 14 '24 20:08 AlexVulaj

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Aug 14 '24 20:08 openshift-ci[bot]