Skip to content

Commit c994e3c

Browse files
dlipovetskyjimmidyson
authored andcommitted
test: Fix false negative in httpproxy test (#17)
Other patches can change the slice length, causing the previous check to fail, although all correct patches are present.
1 parent d1f091f commit c994e3c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pkg/handlers/generic/mutation/httpproxy/tests/generate_patches.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,16 @@ func TestGeneratePatches(
5353
},
5454
RequestItem: request.NewKubeadmConfigTemplateRequestItem(""),
5555
ExpectedPatchMatchers: []capitest.JSONPatchMatcher{{
56-
Operation: "add",
57-
Path: "/spec/template/spec/files",
58-
ValueMatcher: gomega.HaveLen(2),
56+
Operation: "add",
57+
Path: "/spec/template/spec/files",
58+
ValueMatcher: gomega.ContainElements(
59+
gomega.HaveKeyWithValue(
60+
"path", "/etc/systemd/system/containerd.service.d/http-proxy.conf",
61+
),
62+
gomega.HaveKeyWithValue(
63+
"path", "/etc/systemd/system/kubelet.service.d/http-proxy.conf",
64+
),
65+
),
5966
}},
6067
},
6168
capitest.PatchTestDef{

0 commit comments

Comments
 (0)