diff --git a/api/v1beta1/rollout_types.go b/api/v1beta1/rollout_types.go index a90e99aa..fcf61682 100644 --- a/api/v1beta1/rollout_types.go +++ b/api/v1beta1/rollout_types.go @@ -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"` } diff --git a/lua_configuration/trafficrouting_ingress/mse.lua b/lua_configuration/trafficrouting_ingress/mse.lua index d78d94dd..d39ba7dc 100644 --- a/lua_configuration/trafficrouting_ingress/mse.lua +++ b/lua_configuration/trafficrouting_ingress/mse.lua @@ -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" ) @@ -62,4 +63,4 @@ for _,match in ipairs(obj.matches) do end end end -return annotations +return annotations \ No newline at end of file diff --git a/pkg/trafficrouting/network/ingress/ingress_test.go b/pkg/trafficrouting/network/ingress/ingress_test.go index 63ef9bb9..23aada3d 100644 --- a/pkg/trafficrouting/network/ingress/ingress_test.go +++ b/pkg/trafficrouting/network/ingress/ingress_test.go @@ -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" )