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

Introduce an error for trying to fetch a secret of the wrong type. #642

Merged
merged 5 commits into from
Feb 5, 2024

Conversation

folone
Copy link
Contributor

@folone folone commented Feb 5, 2024

💸 TL;DR

This PR introduces a new error for attempting to fetch a secret of the wrong type:

secrets: requested secret at path 'secret/myservice/external-account-key' of type 'simple' does not exist, but a secret of type 'versioned' does. Consider using the correct API to retrieve the secret

I've seen this issue recently, and had a few infra folks trying to debug why secrets are not being fetched. Turned out they were, but I was using the wrong API (GetSimpleSecret instead of GetVersionedSecret). This change would've avoided this whole situation.

🧪 Testing Steps / Validation

Added a unit test.

✅ Checks

  • CI tests (if present) are passing
  • Adheres to code style for repo
  • Contributor License Agreement (CLA) completed if not a Reddit employee

@folone folone requested a review from a team as a code owner February 5, 2024 16:48
@folone folone requested review from fishy, kylelemons and konradreiche and removed request for a team February 5, 2024 16:48
Copy link
Member

@fishy fishy left a comment

Choose a reason for hiding this comment

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

thanks for the PR!

@folone folone requested a review from fishy February 5, 2024 17:19
@folone folone force-pushed the gl/secret-wrong-type-error branch from d3e6efc to 1d65457 Compare February 5, 2024 17:45
@folone folone requested a review from fishy February 5, 2024 17:47
@folone folone merged commit 49c0448 into reddit:master Feb 5, 2024
2 checks passed
@folone folone deleted the gl/secret-wrong-type-error branch February 5, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants