Skip to content

Cache secret for a configurable time period and reset on auth/authz failure #2326

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

Merged
merged 2 commits into from
Apr 23, 2021

Conversation

rjeberhard
Copy link
Member

This resolves an observed increase in the operator's network utilization by not reading the webLogicCredentialsSecret every time that it is necessary and, instead, caching the value for a configurable time period. Additionally, the secret is cleared (and then reread on the next iteration) following an auth or authz failure.

Copy link
Member

@ankedia ankedia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@russgold
Copy link
Member

Where are the tests for this new functionality?

I would have expected something which tried the read the secret, and tried again both within and after the timeout, seeing a cached value returned in the first case and a new read from k8s in the latter case.

@rjeberhard
Copy link
Member Author

@russgold, I found that whenAuthorizedToReadHealthAndThenWait_verifySecretCleared was sufficient. This tests that the clearing behavior worked. The earlier tests then validate that the read will happen when the cache is empty.

@rjeberhard rjeberhard merged commit 99dcc4b into main Apr 23, 2021
@rjeberhard rjeberhard deleted the owls-88938 branch January 31, 2022 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants