-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] create scope with default credentials for all resources #507
Merged
Conversation
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #507 +/- ##
==========================================
- Coverage 65.55% 65.24% -0.31%
==========================================
Files 77 77
Lines 4003 4037 +34
==========================================
+ Hits 2624 2634 +10
- Misses 1143 1161 +18
- Partials 236 242 +6 ☔ View full report in Codecov by Sentry. |
unnatiagg
changed the title
Updating scope to create scope with default credentials for all resources
[fix] create scope with default credentials for all resources
Sep 10, 2024
amold1
reviewed
Sep 11, 2024
eljohnson92
approved these changes
Sep 20, 2024
amold1
approved these changes
Sep 20, 2024
rahulait
added a commit
that referenced
this pull request
Sep 26, 2024
rahulait
added a commit
that referenced
this pull request
Sep 26, 2024
* add global lock and token map for counting POST requests per token * set default limits in defaults.go and use them in controller * move rate-limits related functions to separate file and simplify logic * add unittests for ratelimits.go file * fix go.mod file * address review comments * fix updating token after rebasing from PR #507
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
For all reconciliation requests, the scope was previously created with the Resource.Spec.credentialsRef details (if present).
The scope creation failed if the secret disappears on deletion due to any race conditions.
With this change, the scope for all resources is set from the default credentials always. And later the token is updated using the SetToken method provided with LinodeGo API.
To further avoid any race conditions on the secret deletion, CredentialRefFinalizers are added onto secret using LinodeCluster, LinodeFirewall, LinodeVPC controllers.
With all these finalizers set on the secret from various resources, the deletion of the secret does not happen as quickly as it did before.
If in future we want to explicitly add a finalizer on the secret itself, I believe VPC controller would be best way to handle this.
Resources whose scope creation is changed:
LinodeCluster
LinodeMachine
LinodeVPC
LinodeFirewall
LinodePlacementGroup
LinodeOBJKey
TODOs: