Skip to content
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

Only try create secret if not present #1222

Merged
merged 1 commit into from
Oct 10, 2022
Merged

Only try create secret if not present #1222

merged 1 commit into from
Oct 10, 2022

Conversation

0sewa0
Copy link
Contributor

@0sewa0 0sewa0 commented Oct 7, 2022

Users can limit how many secrets can be created in their namespaces.

However, if that limit is reached and our namespace secret is already in the namespace, our update mechanism fails.
Because we try to create a new secret and would expect a Already Exists error, but in such case, we get an alreadyLimit reached error back, which crashes our logic.

How can this be tested?

Example resource quota:

apiVersion: v1
kind: ResourceQuota
metadata:
  name: secret-quota
  namespace: test
spec:
  hard:
    count/secrets: "2"

Use a dyankube that would inject into the namespace that has the quota. Wait for an update. Should not fail. (the secret number may change depending what you deploy 😬 )

Checklist

  • [ ] Unit tests have been updated/added
  • PR is labeled accordingly
  • I have read and understood the contribution guidelines

@0sewa0 0sewa0 added the bug Something isn't working label Oct 7, 2022
@0sewa0 0sewa0 requested a review from a team as a code owner October 7, 2022 09:34
@0sewa0 0sewa0 changed the title Update version for 0.9 release branch Only try create secret if not present Oct 7, 2022
@0sewa0 0sewa0 merged commit 1584ecf into release-0.9 Oct 10, 2022
@0sewa0 0sewa0 deleted the fix/safe-secret branch October 10, 2022 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants