Skip to content

Commit

Permalink
Update check command
Browse files Browse the repository at this point in the history
Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
  • Loading branch information
lubronzhan committed Mar 1, 2024
1 parent 7fd7e25 commit 492f55f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/e2e/gateway/http_route_conflict_match_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
)

func testHTTPRouteConflictMatch(namespace string, gateway types.NamespacedName) {
Specify("Creates two http routes, second one has conflict match condition as the first one", func() {
Specify("Creates two http routes, second one has conflict match against the first one, report Accepted: false", func() {
By("create httproute-1 first")
route1 := &gatewayapi_v1.HTTPRoute{
ObjectMeta: meta_v1.ObjectMeta{
Expand Down
22 changes: 14 additions & 8 deletions test/e2e/gateway/http_route_partially_conflict_match_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@
package gateway

import (
"context"
"time"

. "github.com/onsi/ginkgo/v2"
"github.com/stretchr/testify/require"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
gatewayapi_v1 "sigs.k8s.io/gateway-api/apis/v1"

"github.com/projectcontour/contour/internal/gatewayapi"
"github.com/projectcontour/contour/test/e2e"
)

func testHTTPRoutePartiallyConflictMatch(namespace string, gateway types.NamespacedName) {
Specify("Creates two http routes, second one has conflict match condition as the first one", func() {
Specify("Creates two http routes, second one has partial conflict match against the first one, has partially match condition", func() {
By("create httproute-1 first")
route1 := &gatewayapi_v1.HTTPRoute{
ObjectMeta: meta_v1.ObjectMeta{
Expand Down Expand Up @@ -87,13 +92,14 @@ func testHTTPRoutePartiallyConflictMatch(namespace string, gateway types.Namespa
},
},
}
// Partially accepted
f.CreateHTTPRouteAndWaitFor(route2, e2e.HTTPRoutePartiallyAccepted)
// 1) Drop Rule(s): With this approach, implementations will drop the
// invalid Route Rule(s) until they are fully valid again. The message
// for this condition MUST start with the prefix "Dropped Rule" and
// include information about which Rules have been dropped. In this
// state, the "Accepted" condition MUST be set to "True" with the latest
// generation of the resource.
f.CreateHTTPRouteAndWaitFor(route2, e2e.HTTPRouteAccepted)
// Still has Accepted: true
require.Eventually(f.T(), func() bool {
if err := f.Client.Get(context.TODO(), client.ObjectKeyFromObject(route2), route2); err != nil {
return false
}
return e2e.HTTPRouteAccepted(route2)
}, time.Minute*2, f.RetryInterval)
})
}

0 comments on commit 492f55f

Please sign in to comment.