Skip to content

Commit ec310a4

Browse files
committed
fix e2e
1 parent cb69e36 commit ec310a4

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ KIND_NAME ?= api7-ingress-cluster
1313
GATEAY_API_VERSION ?= v1.2.0
1414

1515
DASHBOARD_VERSION ?= dev
16-
TEST_TIMEOUT ?= 30m
16+
TEST_TIMEOUT ?= 45m
1717

1818
export KUBECONFIG = /tmp/$(KIND_NAME).kubeconfig
1919

internal/controller/httproutepolicy.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"time"
66

77
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
8+
"k8s.io/utils/ptr"
89
"sigs.k8s.io/controller-runtime/pkg/client"
910
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
1011
"sigs.k8s.io/gateway-api/apis/v1alpha2"
@@ -22,7 +23,7 @@ func (r *HTTPRouteReconciler) processHTTPRoutePolicies(tctx *provider.TranslateC
2223
policies: make(map[targetRefKey][]v1alpha1.HTTPRoutePolicy),
2324
}
2425
listForAllRules v1alpha1.HTTPRoutePolicyList
25-
key = indexer.GenHTTPRoutePolicyIndexKey(v1alpha1.GroupVersion.Group, "HTTPRoute", httpRoute.GetNamespace(), httpRoute.GetName(), "")
26+
key = indexer.GenHTTPRoutePolicyIndexKey(gatewayv1.GroupName, "HTTPRoute", httpRoute.GetNamespace(), httpRoute.GetName(), "")
2627
)
2728
if err := r.List(context.Background(), &listForAllRules, client.MatchingFields{indexer.PolicyTargetRefs: key}); err != nil {
2829
return err
@@ -41,7 +42,7 @@ func (r *HTTPRouteReconciler) processHTTPRoutePolicies(tctx *provider.TranslateC
4142
var (
4243
ruleName = string(*rule.Name)
4344
listForSectionRules v1alpha1.HTTPRoutePolicyList
44-
key = indexer.GenHTTPRoutePolicyIndexKey(v1alpha1.GroupVersion.Group, "HTTPRoute", httpRoute.GetNamespace(), httpRoute.GetName(), ruleName)
45+
key = indexer.GenHTTPRoutePolicyIndexKey(gatewayv1.GroupName, "HTTPRoute", httpRoute.GetNamespace(), httpRoute.GetName(), ruleName)
4546
)
4647
if err := r.List(context.Background(), &listForSectionRules, client.MatchingFields{indexer.PolicyTargetRefs: key}); err != nil {
4748
continue
@@ -136,7 +137,7 @@ func (c *conflictChecker) append(sectionName string, policy v1alpha1.HTTPRoutePo
136137
Loop:
137138
for _, items := range c.policies {
138139
for _, item := range items {
139-
if item.Spec.Priority != policy.Spec.Priority || *item.Spec.Priority != *policy.Spec.Priority {
140+
if !ptr.Equal(item.Spec.Priority, policy.Spec.Priority) {
140141
c.conflict = true
141142
break Loop
142143
}

internal/controller/indexer/indexer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ func HTTPRoutePolicyIndexFunc(rawObj client.Object) []string {
334334
if ref.SectionName != nil {
335335
sectionName = string(*ref.SectionName)
336336
}
337-
keys = append(keys, GenHTTPRoutePolicyIndexKey(v1alpha1.GroupVersion.Group, string(ref.Kind), hrp.GetNamespace(), string(ref.Name), sectionName))
337+
keys = append(keys, GenHTTPRoutePolicyIndexKey(string(ref.Group), string(ref.Kind), hrp.GetNamespace(), string(ref.Name), sectionName))
338338
}
339339
return keys
340340
}

0 commit comments

Comments
 (0)