mirror of
https://github.com/alibaba/higress.git
synced 2026-05-08 04:17:27 +08:00
upgrade to istio 1.19 (#1211)
Co-authored-by: CH3CHO <ch3cho@qq.com> Co-authored-by: rinfx <893383980@qq.com>
This commit is contained in:
@@ -18,25 +18,34 @@ import (
|
||||
"reflect"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/alibaba/higress/pkg/ingress/kube/controller"
|
||||
"github.com/alibaba/higress/pkg/ingress/kube/util"
|
||||
. "github.com/alibaba/higress/pkg/ingress/log"
|
||||
"istio.io/istio/pilot/pkg/model"
|
||||
"istio.io/istio/pkg/cluster"
|
||||
"istio.io/istio/pkg/config"
|
||||
"istio.io/istio/pkg/config/schema/gvk"
|
||||
"istio.io/istio/pkg/config/schema/gvr"
|
||||
"istio.io/istio/pkg/config/schema/kind"
|
||||
schemakubeclient "istio.io/istio/pkg/config/schema/kubeclient"
|
||||
kubeclient "istio.io/istio/pkg/kube"
|
||||
"istio.io/istio/pkg/kube/controllers"
|
||||
ktypes "istio.io/istio/pkg/kube/kubetypes"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
listersv1 "k8s.io/client-go/listers/core/v1"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"github.com/alibaba/higress/pkg/ingress/kube/controller"
|
||||
"github.com/alibaba/higress/pkg/ingress/kube/util"
|
||||
. "github.com/alibaba/higress/pkg/ingress/log"
|
||||
)
|
||||
|
||||
type HigressConfigController controller.Controller[listersv1.ConfigMapNamespaceLister]
|
||||
|
||||
func NewController(client kubeclient.Client, clusterId string, namespace string) HigressConfigController {
|
||||
informer := client.KubeInformer().Core().V1().ConfigMaps().Informer()
|
||||
return controller.NewCommonController("higressConfig", client.KubeInformer().Core().V1().ConfigMaps().Lister().ConfigMaps(namespace),
|
||||
informer, GetConfigmap, clusterId)
|
||||
func NewController(client kubeclient.Client, clusterId cluster.ID, namespace string) HigressConfigController {
|
||||
opts := ktypes.InformerOptions{
|
||||
Namespace: namespace,
|
||||
Cluster: clusterId,
|
||||
}
|
||||
informer := schemakubeclient.GetInformerFilteredFromGVR(client, opts, gvr.ConfigMap)
|
||||
lister := listersv1.NewConfigMapLister(informer.Informer.GetIndexer()).ConfigMaps(namespace)
|
||||
return controller.NewCommonController("higressConfig", lister, informer.Informer, GetConfigmap, clusterId)
|
||||
}
|
||||
|
||||
func GetConfigmap(lister listersv1.ConfigMapNamespaceLister, namespacedName types.NamespacedName) (controllers.Object, error) {
|
||||
@@ -61,7 +70,6 @@ type ConfigmapMgr struct {
|
||||
}
|
||||
|
||||
func NewConfigmapMgr(XDSUpdater model.XDSUpdater, namespace string, higressConfigController HigressConfigController, higressConfigLister listersv1.ConfigMapNamespaceLister) *ConfigmapMgr {
|
||||
|
||||
configmapMgr := &ConfigmapMgr{
|
||||
XDSUpdater: XDSUpdater,
|
||||
Namespace: namespace,
|
||||
@@ -193,11 +201,11 @@ func (c *ConfigmapMgr) initEventHandlers() error {
|
||||
c.XDSUpdater.ConfigUpdate(&model.PushRequest{
|
||||
Full: true,
|
||||
ConfigsUpdated: map[model.ConfigKey]struct{}{{
|
||||
Kind: gvk.EnvoyFilter,
|
||||
Kind: kind.EnvoyFilter,
|
||||
Name: name,
|
||||
Namespace: c.Namespace,
|
||||
}: {}},
|
||||
Reason: []model.TriggerReason{ModelUpdatedReason},
|
||||
Reason: model.NewReasonStats(ModelUpdatedReason),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user