Skip to content

Commit

Permalink
E2E: Show journal logs on rotate-keys failure
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola committed Sep 6, 2024
1 parent f7dd98b commit f593150
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/e2e/secretsencryption/secretsencryption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ var _ = Describe("Verify Secrets Encryption Rotation", Ordered, func() {
It("Rotates the Secrets-Encryption Keys", func() {
cmd := "k3s secrets-encrypt rotate-keys"
res, err := e2e.RunCmdOnNode(cmd, serverNodeNames[0])
Expect(err).NotTo(HaveOccurred(), res)
// Before we fail on error, get the server logs which actually contain the error
var slogs string
if err != nil {
slogs, _ = e2e.RunCmdOnNode("journalctl -u k3s -n 10", serverNodeNames[0])
}
Expect(err).NotTo(HaveOccurred(), res+slogs)
for i, nodeName := range serverNodeNames {
Eventually(func(g Gomega) {
cmd := "k3s secrets-encrypt status"
Expand Down

0 comments on commit f593150

Please sign in to comment.