From 7b2b5221604c48d047fa7b64b933977bbe6aa82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BE=84=E6=BD=AD?= Date: Tue, 3 Sep 2024 09:43:58 +0800 Subject: [PATCH] adjust the priority for wasmplugin to take effect on matching services (#1270) --- pkg/ingress/config/ingress_config.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/ingress/config/ingress_config.go b/pkg/ingress/config/ingress_config.go index 8e11bc5291..2d8b344212 100644 --- a/pkg/ingress/config/ingress_config.go +++ b/pkg/ingress/config/ingress_config.go @@ -894,16 +894,16 @@ func (m *IngressConfig) convertIstioWasmPlugin(obj *higressext.WasmPlugin) (*ext }) continue } - // match domain - for _, domain := range rule.Domain { + // match service + for _, service := range rule.Service { matchItems = append(matchItems, &_struct.Value{ Kind: &_struct.Value_StringValue{ - StringValue: domain, + StringValue: service, }, }) } if len(matchItems) > 0 { - v.StructValue.Fields["_match_domain_"] = &_struct.Value{ + v.StructValue.Fields["_match_service_"] = &_struct.Value{ Kind: &_struct.Value_ListValue{ ListValue: &_struct.ListValue{ Values: matchItems, @@ -915,18 +915,18 @@ func (m *IngressConfig) convertIstioWasmPlugin(obj *higressext.WasmPlugin) (*ext }) continue } - // match service - for _, service := range rule.Service { + // match domain + for _, domain := range rule.Domain { matchItems = append(matchItems, &_struct.Value{ Kind: &_struct.Value_StringValue{ - StringValue: service, + StringValue: domain, }, }) } if len(matchItems) == 0 { return nil, fmt.Errorf("invalid match rule has no match condition, rule:%v", rule) } - v.StructValue.Fields["_match_service_"] = &_struct.Value{ + v.StructValue.Fields["_match_domain_"] = &_struct.Value{ Kind: &_struct.Value_ListValue{ ListValue: &_struct.ListValue{ Values: matchItems,