Skip to content

Commit

Permalink
fix MSE cases
Browse files Browse the repository at this point in the history
Signed-off-by: Megrez Lu <[email protected]>
  • Loading branch information
lujiajing1126 committed May 14, 2024
1 parent bd7d65f commit 5d812d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions api/v1beta1/rollout_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ type TrafficRoutingStrategy struct {
// Matches define conditions used for matching incoming HTTP requests to the canary service.
// Each match is independent, i.e. this rule will be matched as long as **any** one of the matches is satisfied.
//
// For Gateway API, only a single match rule will be applied since Gateway API use ANDed rules if multiple
// ones are defined, i.e. the match will evaluate to true only if all conditions are satisfied.
// And cannot support both weight and matches, if both are configured, then matches takes precedence.
// It cannot support Traffic (weight-based routing) and Matches simultaneously, if both are configured.
// In such cases, Matches takes precedence.
Matches []HttpRouteMatch `json:"matches,omitempty"`
}

Expand Down
5 changes: 3 additions & 2 deletions lua_configuration/trafficrouting_ingress/mse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ for _,match in ipairs(obj.matches) do
annotations["nginx.ingress.kubernetes.io/canary-by-header-value"] = header.value
end
end
else
end
if match.queryParams and next(match.queryParams) ~= nil then
queryParam = match.queryParams[1]
annotations["nginx.ingress.kubernetes.io/canary-by-query"] = queryParam.name
if ( queryParam.type == "RegularExpression" )
Expand All @@ -62,4 +63,4 @@ for _,match in ipairs(obj.matches) do
end
end
end
return annotations
return annotations
3 changes: 2 additions & 1 deletion pkg/trafficrouting/network/ingress/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ var (
annotations["nginx.ingress.kubernetes.io/canary-by-header-value"] = header.value
end
end
else
end
if match.queryParams and next(match.queryParams) ~= nil then
queryParam = match.queryParams[1]
annotations["nginx.ingress.kubernetes.io/canary-by-query"] = queryParam.name
if ( queryParam.type == "RegularExpression" )
Expand Down

0 comments on commit 5d812d9

Please sign in to comment.