Skip to content

Commit

Permalink
Fix route attachments to gateways
Browse files Browse the repository at this point in the history
Co-authored-by: Romain <[email protected]>
  • Loading branch information
kevinpollet and rtribotte authored May 28, 2024
1 parent 6e61fe0 commit e9bd2b4
Show file tree
Hide file tree
Showing 12 changed files with 2,254 additions and 2,509 deletions.
9 changes: 0 additions & 9 deletions integration/k8s_conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,10 @@ func (s *K8sConformanceSuite) TestK8sGatewayAPIConformance() {
RunTest: *k8sConformanceRunTest,
// Until the feature are all supported, following tests are skipped.
SkipTests: []string{
tests.GatewayClassObservedGenerationBump.ShortName,
tests.GatewayWithAttachedRoutes.ShortName,
tests.GatewayModifyListeners.ShortName,
tests.GatewayInvalidTLSConfiguration.ShortName,
tests.HTTPRouteHostnameIntersection.ShortName,
tests.HTTPRouteListenerHostnameMatching.ShortName,
tests.HTTPRouteInvalidReferenceGrant.ShortName,
tests.HTTPRouteInvalidCrossNamespaceParentRef.ShortName,
tests.HTTPRouteInvalidParentRefNotMatchingSectionName.ShortName,
tests.HTTPRouteInvalidCrossNamespaceBackendRef.ShortName,
tests.HTTPRouteMatchingAcrossRoutes.ShortName,
tests.HTTPRoutePartiallyInvalidViaInvalidReferenceGrant.ShortName,
tests.HTTPRouteRedirectHostAndStatus.ShortName,
tests.HTTPRoutePathMatchOrder.ShortName,
tests.HTTPRouteHeaderMatching.ShortName,
tests.HTTPRouteReferenceGrant.ShortName,
Expand Down
268 changes: 154 additions & 114 deletions pkg/provider/kubernetes/gateway/client.go

Large diffs are not rendered by default.

36 changes: 34 additions & 2 deletions pkg/provider/kubernetes/gateway/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
gatev1 "sigs.k8s.io/gateway-api/apis/v1"
)

func TestStatusEquals(t *testing.T) {
func Test_gatewayStatusEquals(t *testing.T) {
testCases := []struct {
desc string
statusA gatev1.GatewayStatus
Expand Down Expand Up @@ -230,13 +230,45 @@ func TestStatusEquals(t *testing.T) {
},
expected: false,
},
{
desc: "Gateway listeners with same conditions but different number of attached routes",
statusA: gatev1.GatewayStatus{
Listeners: []gatev1.ListenerStatus{
{
Name: "foo",
AttachedRoutes: 1,
Conditions: []metav1.Condition{
{
Type: "foobar",
Reason: "foobar",
},
},
},
},
},
statusB: gatev1.GatewayStatus{
Listeners: []gatev1.ListenerStatus{
{
Name: "foo",
AttachedRoutes: 2,
Conditions: []metav1.Condition{
{
Type: "foobar",
Reason: "foobar",
},
},
},
},
},
expected: false,
},
}

for _, test := range testCases {
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

result := statusEquals(test.statusA, test.statusB)
result := gatewayStatusEquals(test.statusA, test.statusB)

assert.Equal(t, test.expected, result)
})
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit e9bd2b4

Please sign in to comment.