8000 sorted the result of GetDosProtectedThatReferencedDosLogConf in unit … · nginx/kubernetes-ingress@99b7126 · GitHub
[go: up one dir, main page]

Skip to content

Commit 99b7126

Browse files
committed
sorted the result of GetDosProtectedThatReferencedDosLogConf in unit test to make it deterministic
1 parent 6dddcb2 commit 99b7126

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/k8s/appprotectdos/app_protect_dos_configuration_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,9 @@ func TestGetDosProtectedThatReferencedDosLogConf(t *testing.T) {
13201320
for _, test := range tests {
13211321
resources := dosConf.GetDosProtectedThatReferencedDosLogConf(test.policyNamespace + "/" + test.policyName)
13221322
if diff := cmp.Diff(test.expected, resources); diff != "" {
1323+
sort.SliceStable(resources, func(i, j int) bool {
1324+
return resources[i].Name < resources[j].Name
1325+
})
13231326
t.Errorf("GetDosProtectedThatReferencedDosLogConf() returned unexpected result for the case of: %v (-want +got):\n%s", test.msg, diff)
13241327
}
13251328
}

0 commit comments

Comments
 (0)
0