Skip to content

vault-23135 - fix modify storage keys ending with .temp causes overwr… - #25395

Merged
hghaf099 merged 3 commits into
mainfrom
vault-23135-fix-file-storage
Feb 15, 2024
Merged

hghaf099 merged 3 commits into
mainfrom
vault-23135-fix-file-storage

Conversation

@hghaf099

Copy link
Copy Markdown
Contributor

Addresses #23135

Instead of hardcoded .temp suffix, randomize the suffix to make sure it is not overwriting an existing file.

@github-actions github-actions Bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Feb 13, 2024
@github-actions

Copy link
Copy Markdown

CI Results:
All Go tests succeeded! ✅

@github-actions

Copy link
Copy Markdown

Build Results:
All builds succeeded! ✅

@raskchanky raskchanky left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I couldn't resist one tiny nitpick to plug my favorite testing function 😆. This looks great! Thanks for tackling this!

Comment thread sdk/physical/file/file_test.go Outdated
if err != nil {
t.Fatalf("err: %s", err)
}
defer os.RemoveAll(dir)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is super nitpicky, but if you use t.TempDir() here, you can avoid error handling and cleanup, as all of that is automatic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants