mirror of
https://github.com/alibaba/higress.git
synced 2026-05-27 14:17:27 +08:00
adjust the priority for wasmplugin to take effect on matching services (#1270)
This commit is contained in:
@@ -894,16 +894,16 @@ func (m *IngressConfig) convertIstioWasmPlugin(obj *higressext.WasmPlugin) (*ext
|
|||||||
})
|
})
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// match domain
|
// match service
|
||||||
for _, domain := range rule.Domain {
|
for _, service := range rule.Service {
|
||||||
matchItems = append(matchItems, &_struct.Value{
|
matchItems = append(matchItems, &_struct.Value{
|
||||||
Kind: &_struct.Value_StringValue{
|
Kind: &_struct.Value_StringValue{
|
||||||
StringValue: domain,
|
StringValue: service,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if len(matchItems) > 0 {
|
if len(matchItems) > 0 {
|
||||||
v.StructValue.Fields["_match_domain_"] = &_struct.Value{
|
v.StructValue.Fields["_match_service_"] = &_struct.Value{
|
||||||
Kind: &_struct.Value_ListValue{
|
Kind: &_struct.Value_ListValue{
|
||||||
ListValue: &_struct.ListValue{
|
ListValue: &_struct.ListValue{
|
||||||
Values: matchItems,
|
Values: matchItems,
|
||||||
@@ -915,18 +915,18 @@ func (m *IngressConfig) convertIstioWasmPlugin(obj *higressext.WasmPlugin) (*ext
|
|||||||
})
|
})
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// match service
|
// match domain
|
||||||
for _, service := range rule.Service {
|
for _, domain := range rule.Domain {
|
||||||
matchItems = append(matchItems, &_struct.Value{
|
matchItems = append(matchItems, &_struct.Value{
|
||||||
Kind: &_struct.Value_StringValue{
|
Kind: &_struct.Value_StringValue{
|
||||||
StringValue: service,
|
StringValue: domain,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if len(matchItems) == 0 {
|
if len(matchItems) == 0 {
|
||||||
return nil, fmt.Errorf("invalid match rule has no match condition, rule:%v", rule)
|
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{
|
Kind: &_struct.Value_ListValue{
|
||||||
ListValue: &_struct.ListValue{
|
ListValue: &_struct.ListValue{
|
||||||
Values: matchItems,
|
Values: matchItems,
|
||||||
|
|||||||
Reference in New Issue
Block a user