mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 20:57:32 +08:00
fix ai fallback (#1541)
This commit is contained in:
@@ -144,7 +144,7 @@ docker-buildx-push: clean-env docker.higress-buildx
|
|||||||
export PARENT_GIT_TAG:=$(shell cat VERSION)
|
export PARENT_GIT_TAG:=$(shell cat VERSION)
|
||||||
export PARENT_GIT_REVISION:=$(TAG)
|
export PARENT_GIT_REVISION:=$(TAG)
|
||||||
|
|
||||||
export ENVOY_PACKAGE_URL_PATTERN?=https://github.com/higress-group/proxy/releases/download/v2.0.0/envoy-symbol-ARCH.tar.gz
|
export ENVOY_PACKAGE_URL_PATTERN?=https://github.com/higress-group/proxy/releases/download/v2.1.0/envoy-symbol-ARCH.tar.gz
|
||||||
|
|
||||||
build-envoy: prebuild
|
build-envoy: prebuild
|
||||||
./tools/hack/build-envoy.sh
|
./tools/hack/build-envoy.sh
|
||||||
|
|||||||
Submodule envoy/envoy updated: e9302f5574...440fb1b0f3
Submodule istio/istio updated: 1dbd773596...d5fb26c534
Submodule istio/proxy updated: 2a5416fcfa...4e8eba8fc8
@@ -906,6 +906,7 @@ func (m *IngressConfig) convertIstioWasmPlugin(obj *higressext.WasmPlugin) (*ext
|
|||||||
StructValue: rule.Config,
|
StructValue: rule.Config,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
validRule := false
|
||||||
var matchItems []*_struct.Value
|
var matchItems []*_struct.Value
|
||||||
// match ingress
|
// match ingress
|
||||||
for _, ing := range rule.Ingress {
|
for _, ing := range rule.Ingress {
|
||||||
@@ -916,6 +917,7 @@ func (m *IngressConfig) convertIstioWasmPlugin(obj *higressext.WasmPlugin) (*ext
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
if len(matchItems) > 0 {
|
if len(matchItems) > 0 {
|
||||||
|
validRule = true
|
||||||
v.StructValue.Fields["_match_route_"] = &_struct.Value{
|
v.StructValue.Fields["_match_route_"] = &_struct.Value{
|
||||||
Kind: &_struct.Value_ListValue{
|
Kind: &_struct.Value_ListValue{
|
||||||
ListValue: &_struct.ListValue{
|
ListValue: &_struct.ListValue{
|
||||||
@@ -923,12 +925,9 @@ func (m *IngressConfig) convertIstioWasmPlugin(obj *higressext.WasmPlugin) (*ext
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
ruleValues = append(ruleValues, &_struct.Value{
|
|
||||||
Kind: v,
|
|
||||||
})
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
// match service
|
// match service
|
||||||
|
matchItems = nil
|
||||||
for _, service := range rule.Service {
|
for _, service := range rule.Service {
|
||||||
matchItems = append(matchItems, &_struct.Value{
|
matchItems = append(matchItems, &_struct.Value{
|
||||||
Kind: &_struct.Value_StringValue{
|
Kind: &_struct.Value_StringValue{
|
||||||
@@ -937,6 +936,7 @@ func (m *IngressConfig) convertIstioWasmPlugin(obj *higressext.WasmPlugin) (*ext
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
if len(matchItems) > 0 {
|
if len(matchItems) > 0 {
|
||||||
|
validRule = true
|
||||||
v.StructValue.Fields["_match_service_"] = &_struct.Value{
|
v.StructValue.Fields["_match_service_"] = &_struct.Value{
|
||||||
Kind: &_struct.Value_ListValue{
|
Kind: &_struct.Value_ListValue{
|
||||||
ListValue: &_struct.ListValue{
|
ListValue: &_struct.ListValue{
|
||||||
@@ -944,12 +944,9 @@ func (m *IngressConfig) convertIstioWasmPlugin(obj *higressext.WasmPlugin) (*ext
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
ruleValues = append(ruleValues, &_struct.Value{
|
|
||||||
Kind: v,
|
|
||||||
})
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
// match domain
|
// match domain
|
||||||
|
matchItems = nil
|
||||||
for _, domain := range rule.Domain {
|
for _, domain := range rule.Domain {
|
||||||
matchItems = append(matchItems, &_struct.Value{
|
matchItems = append(matchItems, &_struct.Value{
|
||||||
Kind: &_struct.Value_StringValue{
|
Kind: &_struct.Value_StringValue{
|
||||||
@@ -957,19 +954,23 @@ func (m *IngressConfig) convertIstioWasmPlugin(obj *higressext.WasmPlugin) (*ext
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if len(matchItems) == 0 {
|
if len(matchItems) > 0 {
|
||||||
|
validRule = true
|
||||||
|
v.StructValue.Fields["_match_domain_"] = &_struct.Value{
|
||||||
|
Kind: &_struct.Value_ListValue{
|
||||||
|
ListValue: &_struct.ListValue{
|
||||||
|
Values: matchItems,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if validRule {
|
||||||
|
ruleValues = append(ruleValues, &_struct.Value{
|
||||||
|
Kind: v,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
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_domain_"] = &_struct.Value{
|
|
||||||
Kind: &_struct.Value_ListValue{
|
|
||||||
ListValue: &_struct.ListValue{
|
|
||||||
Values: matchItems,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
ruleValues = append(ruleValues, &_struct.Value{
|
|
||||||
Kind: v,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
if len(ruleValues) > 0 {
|
if len(ruleValues) > 0 {
|
||||||
hasValidRule = true
|
hasValidRule = true
|
||||||
|
|||||||
Reference in New Issue
Block a user