Skip to content

Commit f8fae68

Browse files
test: removed duplicate tests
Signed-off-by: Kostis Kapelonis <kostis.kapelonis@octopus.com>
1 parent 4f01595 commit f8fae68

30 files changed

Lines changed: 26 additions & 735 deletions

pkg/plugin/grpcroute.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,19 @@ func (r *RpcPlugin) setGRPCHeaderRoute(rollout *v1alpha1.Rollout, headerRouting
102102

103103
canaryServiceKind := gatewayv1.Kind("Service")
104104
canaryServiceGroup := gatewayv1.Group("")
105-
grpcRouteRuleList := GRPCRouteRuleList(grpcRoute.Spec.Rules)
105+
106+
// Filter to only unmanaged rules (rules without a Name, or with a Name not in managedRoutes)
107+
// This ensures getRouteRule only searches through weight-splitting rules, not header routes
108+
managedNames := managedRouteNamesSet(rollout)
109+
unmanagedRules := []gatewayv1.GRPCRouteRule{}
110+
for _, rule := range grpcRoute.Spec.Rules {
111+
// Keep rules that have no name OR have a name that's not managed
112+
if rule.Name == nil || !managedNames[string(*rule.Name)] {
113+
unmanagedRules = append(unmanagedRules, rule)
114+
}
115+
}
116+
117+
grpcRouteRuleList := GRPCRouteRuleList(unmanagedRules)
106118
backendRefNameList := []string{string(canaryServiceName), stableServiceName}
107119
grpcRouteRule, err := getRouteRule(grpcRouteRuleList, backendRefNameList...)
108120
if err != nil {

pkg/plugin/httproute.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,19 @@ func (r *RpcPlugin) setHTTPHeaderRoute(rollout *v1alpha1.Rollout, headerRouting
107107

108108
canaryServiceKind := gatewayv1.Kind("Service")
109109
canaryServiceGroup := gatewayv1.Group("")
110-
httpRouteRuleList := HTTPRouteRuleList(httpRoute.Spec.Rules)
110+
111+
// Filter to only unmanaged rules (rules without a Name, or with a Name not in managedRoutes)
112+
// This ensures getRouteRule only searches through weight-splitting rules, not header routes
113+
managedNames := managedRouteNamesSet(rollout)
114+
unmanagedRules := []gatewayv1.HTTPRouteRule{}
115+
for _, rule := range httpRoute.Spec.Rules {
116+
// Keep rules that have no name OR have a name that's not managed
117+
if rule.Name == nil || !managedNames[string(*rule.Name)] {
118+
unmanagedRules = append(unmanagedRules, rule)
119+
}
120+
}
121+
122+
httpRouteRuleList := HTTPRouteRuleList(unmanagedRules)
111123
backendRefNameList := []string{string(canaryServiceName), stableServiceName}
112124
httpRouteRule, err := getRouteRule(httpRouteRuleList, backendRefNameList...)
113125
if err != nil {

test/e2e/chainsaw/grpcroute-header-before-weight/assertions/grpcroute-after-cleanup.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/e2e/chainsaw/grpcroute-header-before-weight/assertions/grpcroute-initial.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/e2e/chainsaw/grpcroute-header-before-weight/assertions/grpcroute-with-header-route.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

test/e2e/chainsaw/grpcroute-header-before-weight/assertions/rollout-healthy.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/e2e/chainsaw/grpcroute-header-before-weight/chainsaw-test.yaml

Lines changed: 0 additions & 74 deletions
This file was deleted.

test/e2e/chainsaw/grpcroute-header-before-weight/resources/grpcroute.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

test/e2e/chainsaw/grpcroute-header-before-weight/resources/rollout.yaml

Lines changed: 0 additions & 45 deletions
This file was deleted.

test/e2e/chainsaw/grpcroute-weight-before-header/assertions/grpcroute-after-cleanup.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)