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

fix(vault): parse pre-v0.23 vault secrets #1086

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

ecrupper
Copy link
Contributor

If a vault secret has not been updated since before v0.23, it will not have allow_events or allow_substitution. We can infer these values by converting event slice into the allow events mask and by setting substitution setting to the same setting as the command setting.

I didn't include any update process on the Vela side. Fortunately the UI submits the entire secret form on update, so users will slowly update their vault secrets on their own accord.

We could also consider creating a migration script of sorts to prevent this code, but we're also supporting v1 and v2 of Vault in code as well. Not saying that's an excuse, but perhaps revisiting our backwards compatibility in general could be a good future issue 🤷

@ecrupper ecrupper requested a review from a team as a code owner March 15, 2024 17:06
Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 62.64%. Comparing base (0c3e620) to head (1aed673).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1086      +/-   ##
==========================================
+ Coverage   62.60%   62.64%   +0.03%     
==========================================
  Files         345      345              
  Lines       10277    10304      +27     
==========================================
+ Hits         6434     6455      +21     
- Misses       3367     3373       +6     
  Partials      476      476              
Files Coverage Δ
secret/vault/vault.go 94.05% <77.77%> (-2.79%) ⬇️

Copy link
Contributor

@jbrockopp jbrockopp left a comment

Choose a reason for hiding this comment

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

LGTM

@ecrupper ecrupper merged commit 219ab91 into main Mar 15, 2024
11 of 13 checks passed
@ecrupper ecrupper deleted the fix/secret/vault/parse-legacy-vault branch March 15, 2024 18:41
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