-
Notifications
You must be signed in to change notification settings - Fork 4.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
VLT-32875 Export API panics when mount is deleted #7288 #29376
Conversation
This reverts commit 0445977.
CI Results: |
Build Results: |
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 looks mostly good! A few nits, deletedMountFmt
needs to be updated in a few more places, and I think this might need to move to Ent, but otherwise looks good.
var err error | ||
var exportedClients map[string]vault.ActivityLogExportRecord |
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.
I feel like these are unnecessary, and we can just define them inline when we first initialize them
require.NoError(t, err) | ||
client.SetToken(cluster.RootToken) | ||
|
||
err = cluster.Cores[0].Core.SaveCurrentFragmentEarly() |
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.
SaveCurrentFragmentEarly
is an ent-only function, so this test should be in an ent only file (and this should probably be an Ent + CE PR as opposed to just CE). Though this might be an avoidable call? I'm not so sure.
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.
Good point. I added an ENT pr... because this is an unavoidable call indeed.
@@ -392,7 +392,7 @@ func (a *ActivityLog) sortActivityLogMonthsResponse(months []*ResponseMonth) { | |||
|
|||
const ( | |||
noMountAccessor = "no mount accessor (pre-1.10 upgrade?)" | |||
deletedMountFmt = "deleted mount; accessor %q" | |||
DeletedMountFmt = "deleted mount; accessor %q" |
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.
There are some references to deletedMountFmt
in vault/activity_log_util_common_test.go
that will need to be updated also (and maybe elsewhere).
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.
Thanks for catching this!! I don't know how my Goland didn't get this :(
Co-authored-by: Violet Hynes <[email protected]>
This reverts commit 9cdd28c.
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.
LGTM!
Description
When the Export API is called and the time frame contains a client usage on a deleted mount, the API panics and fails. This PR fixes this bug.
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.