mirror of
https://github.com/alibaba/higress.git
synced 2026-04-21 12:07:26 +08:00
support multi destination (#119)
This commit is contained in:
@@ -32,6 +32,7 @@ var _ Parser = destination{}
|
||||
|
||||
type DestinationConfig struct {
|
||||
McpDestination []*networking.HTTPRouteDestination
|
||||
WeightSum int64
|
||||
}
|
||||
|
||||
type destination struct{}
|
||||
@@ -99,11 +100,11 @@ func (a destination) Parse(annotations Annotations, config *Ingress, globalConte
|
||||
destinations = append(destinations, dest)
|
||||
}
|
||||
if weightSum != 100 {
|
||||
IngressLog.Errorf("destination has invalid weight sum %d within ingress %s/%s", weightSum, config.Namespace, config.Name)
|
||||
return nil
|
||||
IngressLog.Warnf("destination has invalid weight sum %d within ingress %s/%s", weightSum, config.Namespace, config.Name)
|
||||
}
|
||||
config.Destination = &DestinationConfig{
|
||||
McpDestination: destinations,
|
||||
WeightSum: weightSum,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user