Skip to content

Commit

Permalink
Fix integration test for admission plugin
Browse files Browse the repository at this point in the history
Signed-off-by: galal-hussein <[email protected]>
  • Loading branch information
galal-hussein committed Oct 7, 2024
1 parent 81261af commit f4b84b4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/integration/startup/startup_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,20 @@ var _ = Describe("startup tests", Ordered, func() {
startupServerArgs = []string{
"--deny-psa-label",
"--kube-apiserver-arg",
"enable-admission-plugins=DenyPSALabel",
"enable-admission-plugins=\"DenyPSALabel\"",
}
startupServer, err = testutil.K3sStartServer(startupServerArgs...)
Expect(err).ToNot(HaveOccurred())
})
It("has the default pods deployed", func() {
Eventually(func() error {
return testutil.K3sDefaultDeployments()
}, "120s", "5s").Should(Succeed())
})
It("change label of namespace", func() {
_, err := testutil.K3sCmd("kubectl label --dry-run=server --overwrite ns --all pod-security.kubernetes.io/enforce=baseline")
res, err := testutil.K3sCmd("kubectl label --dry-run=server --overwrite ns --all pod-security.kubernetes.io/enforce=baseline")
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("denying use of PSA label on namespace"))
Expect(res).To(ContainSubstring("denying use of PSA label on namespace"))

})
It("dies cleanly", func() {
Expand Down

0 comments on commit f4b84b4

Please sign in to comment.