Skip to content

Commit

Permalink
Don't use zgrep in check-config if apparmor porfile is enforced (k3…
Browse files Browse the repository at this point in the history
…s-io#7956)

* Don't use zgrep if apparmor is enforced for it

* Bump e2e se timeouts for reencryption time

Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola authored Jul 13, 2023
1 parent 6c6745b commit a7373f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contrib/util/check-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if [ $# -gt 0 ]; then
CONFIG="$1"
fi

if ! command -v zgrep >/dev/null 2>&1; then
if ! command -v zgrep >/dev/null 2>&1 || eval "cat /sys/kernel/security/apparmor/profiles | grep -q 'zgrep (enforce)'"; then
zgrep() {
zcat "$2" | grep "$1"
}
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/secretsencryption/secretsencryption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ var _ = Describe("Verify Secrets Encryption Rotation", Ordered, func() {
cmd = "k3s secrets-encrypt status"
Eventually(func() (string, error) {
return e2e.RunCmdOnNode(cmd, serverNodeNames[0])
}, "180s", "5s").Should(ContainSubstring("Current Rotation Stage: reencrypt_finished"))
}, "240s", "10s").Should(ContainSubstring("Current Rotation Stage: reencrypt_finished"))

for _, nodeName := range serverNodeNames[1:] {
res, err := e2e.RunCmdOnNode(cmd, nodeName)
Expand All @@ -219,7 +219,7 @@ var _ = Describe("Verify Secrets Encryption Rotation", Ordered, func() {
g.Expect(res).Should(ContainSubstring("Encryption Status: Enabled"))
g.Expect(res).Should(ContainSubstring("Current Rotation Stage: reencrypt_finished"))
g.Expect(res).Should(ContainSubstring("Server Encryption Hashes: All hashes match"))
}, "420s", "2s").Should(Succeed())
}, "420s", "5s").Should(Succeed())
}
})
})
Expand All @@ -237,7 +237,7 @@ var _ = Describe("Verify Secrets Encryption Rotation", Ordered, func() {
cmd = "k3s secrets-encrypt status"
Eventually(func() (string, error) {
return e2e.RunCmdOnNode(cmd, serverNodeNames[0])
}, "180s", "5s").Should(ContainSubstring("Current Rotation Stage: reencrypt_finished"))
}, "240s", "10s").Should(ContainSubstring("Current Rotation Stage: reencrypt_finished"))

for i, nodeName := range serverNodeNames {
Eventually(func(g Gomega) {
Expand Down

0 comments on commit a7373f9

Please sign in to comment.