-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
storage/disk: make symlinks work with relative paths #4870
storage/disk: make symlinks work with relative paths #4870
Conversation
cb50d20
to
bb0a5ba
Compare
bb0a5ba
to
d355455
Compare
|
||
txn := storage.NewTransactionOrDie(ctx, s, storage.WriteParams) | ||
func TestTruncateRelativeStoragePath(t *testing.T) { | ||
dir := "foobar" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit messy, but I think it's better to test it this way -- potentially polluting some work dir -- than not at all.
t.Fatalf("Expected get policy to return %v but got: %v (err: %v)", expectedBytes, bs, err) | ||
} | ||
|
||
// Close and re-open store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new thing -- it would catch the previous failure, which would yield to not being able to deref the symlink foobar/foobar/backupXXXX
.
So for now, we'll properly create the symlinks without the wrong indirection. Fixes open-policy-agent#4869. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
d355455
to
0dee8cf
Compare
…nt#4870) So for now, we'll properly create the symlinks without the wrong indirection. Fixes open-policy-agent#4869. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
So for now, we'll properly create the symlinks without the wrong indirection. Fixes #4869. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
So for now, we'll properly create the symlinks without the wrong indirection.
Fixes #4869.
I'm still looking into remediation logic: if the symlink is wrong, fix it automatically.Update: I think we should keep this as-is. The first is simple enough to guide the few people who could have run into it at this point to the proper steps.