Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/utils/kubeclient/daemonset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ var _ = Describe("Test Daemonset", func() {
Expect(err).To(HaveOccurred())
Expect(apierrs.IsNotFound(err)).To(BeTrue())
})

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor naming suggestion: "another-namespace" works fine functionally, but something like "wrong-namespace" or "nonexistent-namespace" would make the intent immediately obvious to anyone scanning the test file.

It("Should fail to get the daemonset when namespace does not match", func() {
fakeClient := fake.NewFakeClientWithScheme(testScheme, objs...)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test asserts apierrs.IsNotFound(err), which relies on the fake client treating namespace-mismatch as not-found. That's the correct behavior for the current implementation, but it's an implicit dependency on fake client semantics. If the underlying client behavior ever changes (e.g., returning a different error type for cross-namespace lookups), this test would need updating. Just flagging for awareness — no action needed right now.

_, err := GetDaemonset(fakeClient, name, "another-namespace")
Expect(err).To(HaveOccurred())
Expect(apierrs.IsNotFound(err)).To(BeTrue())
})
})

Context("Test UpdateDaemonSetUpdateStrategy", func() {
Expand Down
Loading