-
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
database: Emit event notifications #24718
database: Emit event notifications #24718
Conversation
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.
LGTM!
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, just a couple of nits
if err == nil { | ||
b.dbEvent(ctx, "rotate-root", req.Path, name, true) | ||
} else { | ||
b.dbEvent(ctx, "rotate-root-fail", req.Path, name, false) |
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.
The failure modes are unlikely, but I think it should be possible for modified to be true in this case, if for example the write to storage fails after the password successfully got updated. I think the same is true for a couple of other APIs as well.
@@ -585,6 +600,34 @@ func TestBackend_basic(t *testing.T) { | |||
t.Fatalf("Creds should not exist") | |||
} | |||
} | |||
assert.Equal(t, 9, len(eventSender.Events)) | |||
assert.Equal(t, "database/config-write", string(eventSender.Events[0].Type)) |
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.
nit: Would be nice to use a for loop to reduce the copy-paste/visual noise here :)
Including for failures to write credentials and failure to rotate.
a8298b0
to
14979e8
Compare
Thanks! |
Including for failures to write credentials and failure to rotate.
Including for failures to write credentials and failure to rotate.
Including for failures to write credentials and failure to rotate.