Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e8083f7

Browse files
Add mirroring fraction edge case test (#3708)
Add additional mirroring fraction edge case.
1 parent 385d5be commit e8083f7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

‎internal/controller/state/dataplane/convert_test.go‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,25 @@ func TestConvertHTTPMirrorFilter(t *testing.T) {
380380
},
381381
name: "fraction result over 100",
382382
},
383+
{
384+
filter: &v1.HTTPRequestMirrorFilter{
385+
BackendRef: v1.BackendObjectReference{
386+
Name: "backend",
387+
Namespace: helpers.GetPointer[v1.Namespace]("namespace"),
388+
},
389+
Fraction: &v1.Fraction{
390+
Numerator: 2,
391+
Denominator: helpers.GetPointer(int32(2)),
392+
},
393+
},
394+
expected: &HTTPRequestMirrorFilter{
395+
Name: helpers.GetPointer("backend"),
396+
Namespace: helpers.GetPointer("namespace"),
397+
Target: helpers.GetPointer("/_ngf-internal-mirror-namespace/backend-test/route1-0"),
398+
Percent: helpers.GetPointer(float64(100)),
399+
},
400+
name: "numerator equals denominator",
401+
},
383402
{
384403
filter: &v1.HTTPRequestMirrorFilter{
385404
BackendRef: v1.BackendObjectReference{

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /