Skip to content

Commit 3e9654f

Browse files
authored
add namespace mismatch case (#5775)
Signed-off-by: r0hansaxena <rohansxn8772@gmail.com>
1 parent 1f40c04 commit 3e9654f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

pkg/utils/kubeclient/daemonset_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ var _ = Describe("Test Daemonset", func() {
6969
Expect(err).To(HaveOccurred())
7070
Expect(apierrs.IsNotFound(err)).To(BeTrue())
7171
})
72+
73+
It("Should fail to get the daemonset when namespace does not match", func() {
74+
fakeClient := fake.NewFakeClientWithScheme(testScheme, objs...)
75+
_, err := GetDaemonset(fakeClient, name, "another-namespace")
76+
Expect(err).To(HaveOccurred())
77+
Expect(apierrs.IsNotFound(err)).To(BeTrue())
78+
})
7279
})
7380

7481
Context("Test UpdateDaemonSetUpdateStrategy", func() {

0 commit comments

Comments
 (0)