Feat: upgrade istio from 1.19.5 to 1.27.1 (#3066)

This commit is contained in:
EndlessSeeker
2025-11-20 14:43:30 +08:00
committed by GitHub
parent 7dfc42fd92
commit b2b4f72775
173 changed files with 25684 additions and 4741 deletions

View File

@@ -19,6 +19,7 @@ import (
"encoding/json"
"errors"
"fmt"
"path"
"sort"
"strings"
"sync"
@@ -42,7 +43,6 @@ import (
"istio.io/istio/pkg/config/constants"
"istio.io/istio/pkg/config/schema/collection"
"istio.io/istio/pkg/config/schema/gvk"
"istio.io/istio/pkg/config/schema/kind"
"istio.io/istio/pkg/log"
"istio.io/istio/pkg/util/sets"
v1 "k8s.io/api/core/v1"
@@ -279,7 +279,7 @@ func (m *IngressConfig) AddLocalCluster(options common.Options) {
}
m.remoteIngressControllers[options.ClusterId] = ingressController
if features.EnableGatewayAPI {
m.remoteGatewayControllers[options.ClusterId] = gateway.NewController(m.localKubeClient, options)
m.remoteGatewayControllers[options.ClusterId] = gateway.NewController(m.localKubeClient, options, m.XDSUpdater)
}
}
@@ -1054,7 +1054,17 @@ func (m *IngressConfig) convertIstioWasmPlugin(obj *higressext.WasmPlugin) (*ext
validRule := false
var matchItems []*_struct.Value
// match ingress
// if route type is not http, we should re-generate the route name for ingress matching
// this is because the route name
needAppendRuleType := false
if rule.GetRouteType() != higressext.RouteType_HTTP {
needAppendRuleType = true
}
for _, ing := range rule.Ingress {
if needAppendRuleType {
ing = path.Join(rule.GetRouteType().String())
}
matchItems = append(matchItems, &_struct.Value{
Kind: &_struct.Value_StringValue{
StringValue: ing,
@@ -1310,11 +1320,11 @@ func (m *IngressConfig) AddOrUpdateHttp2Rpc(clusterNamespacedName util.ClusterNa
m.http2rpcs[clusterNamespacedName.Name] = &http2rpc.Spec
m.mutex.Unlock()
IngressLog.Infof("AddOrUpdateHttp2Rpc http2rpc ingress name %s", clusterNamespacedName.Name)
push := func(gvk config.GroupVersionKind) {
push := func(GVK config.GroupVersionKind) {
m.XDSUpdater.ConfigUpdate(&istiomodel.PushRequest{
Full: true,
ConfigsUpdated: map[istiomodel.ConfigKey]struct{}{{
Kind: kind.MustFromGVK(gvk),
Kind: gvk.MustToKind(GVK),
Name: clusterNamespacedName.Name,
Namespace: clusterNamespacedName.Namespace,
}: {}},
@@ -1339,11 +1349,11 @@ func (m *IngressConfig) DeleteHttp2Rpc(clusterNamespacedName util.ClusterNamespa
m.mutex.Unlock()
if hit {
IngressLog.Infof("Http2Rpc triggered deleted event executed %s", clusterNamespacedName.Name)
push := func(gvk config.GroupVersionKind) {
push := func(GVK config.GroupVersionKind) {
m.XDSUpdater.ConfigUpdate(&istiomodel.PushRequest{
Full: true,
ConfigsUpdated: map[istiomodel.ConfigKey]struct{}{{
Kind: kind.MustFromGVK(gvk),
Kind: gvk.MustToKind(GVK),
Name: clusterNamespacedName.Name,
Namespace: clusterNamespacedName.Namespace,
}: {}},
@@ -1364,11 +1374,11 @@ func (m *IngressConfig) ReflectSecretChanges(clusterNamespacedName util.ClusterN
m.mutex.RUnlock()
if hit {
push := func(gvk config.GroupVersionKind) {
push := func(GVK config.GroupVersionKind) {
m.XDSUpdater.ConfigUpdate(&istiomodel.PushRequest{
Full: true,
ConfigsUpdated: map[istiomodel.ConfigKey]struct{}{{
Kind: kind.MustFromGVK(gvk),
Kind: gvk.MustToKind(GVK),
Name: clusterNamespacedName.Name,
Namespace: clusterNamespacedName.Namespace,
}: {}},
@@ -2058,11 +2068,11 @@ func (m *IngressConfig) constructMcpSseStatefulSessionEnvoyFilter(route *common.
}, nil
}
func (m *IngressConfig) notifyXDSFullUpdate(gvk config.GroupVersionKind, reason istiomodel.TriggerReason, updatedConfigName *util.ClusterNamespacedName) {
func (m *IngressConfig) notifyXDSFullUpdate(GVK config.GroupVersionKind, reason istiomodel.TriggerReason, updatedConfigName *util.ClusterNamespacedName) {
var configsUpdated map[istiomodel.ConfigKey]struct{}
if updatedConfigName != nil {
configsUpdated = map[istiomodel.ConfigKey]struct{}{{
Kind: kind.MustFromGVK(gvk),
Kind: gvk.MustToKind(GVK),
Name: updatedConfigName.Name,
Namespace: updatedConfigName.Namespace,
}: {}}

View File

@@ -24,7 +24,6 @@ import (
"istio.io/istio/pkg/config/constants"
"istio.io/istio/pkg/config/schema/collection"
"istio.io/istio/pkg/config/schema/gvk"
"istio.io/istio/pkg/config/schema/kind"
"istio.io/istio/pkg/util/sets"
v1 "k8s.io/api/core/v1"
listersv1 "k8s.io/client-go/listers/core/v1"
@@ -467,11 +466,11 @@ func (m *KIngressConfig) ReflectSecretChanges(clusterNamespacedName util.Cluster
m.mutex.RUnlock()
if hit {
push := func(gvk config.GroupVersionKind) {
push := func(GVK config.GroupVersionKind) {
m.XDSUpdater.ConfigUpdate(&istiomodel.PushRequest{
Full: true,
ConfigsUpdated: map[istiomodel.ConfigKey]struct{}{{
Kind: kind.MustFromGVK(gvk),
Kind: gvk.MustToKind(GVK),
Name: clusterNamespacedName.Name,
Namespace: clusterNamespacedName.Namespace,
}: {}},

View File

@@ -16,20 +16,20 @@ package config
import (
"fmt"
"istio.io/istio/pkg/config/schema/gvk"
"sync"
"github.com/alibaba/higress/v2/pkg/ingress/kube/util"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
istiomodel "istio.io/istio/pilot/pkg/model"
"istio.io/istio/pkg/config"
"istio.io/istio/pkg/config/schema/kind"
"istio.io/istio/pkg/util/sets"
)
// toConfigKey converts config.Config to istiomodel.ConfigKey
func toConfigKey(cfg *config.Config) (istiomodel.ConfigKey, error) {
return istiomodel.ConfigKey{
Kind: kind.MustFromGVK(cfg.GroupVersionKind),
Kind: gvk.MustToKind(cfg.GroupVersionKind),
Name: cfg.Name,
Namespace: cfg.Namespace,
}, nil