From 47827ad2718c0e653362f44fe346b54572512591 Mon Sep 17 00:00:00 2001 From: Xijun Dai Date: Sun, 21 Sep 2025 14:29:07 +0800 Subject: [PATCH] refactor(v2): upgrade module to github.com/alibaba/higress/v2 (#2922) Signed-off-by: Xijun Dai --- Makefile.core.mk | 2 +- api/cue.yaml | 2 +- api/extensions/v1alpha1/wasmplugin.proto | 2 +- api/gen.sh | 2 +- api/networking/v1/http_2_rpc.proto | 8 +- api/networking/v1/mcp_bridge.proto | 10 +- client/Makefile | 8 +- .../pkg/apis/extensions/v1alpha1/types.gen.go | 2 +- client/pkg/apis/networking/v1/types.gen.go | 2 +- .../extensions/v1alpha1/wasmplugin.go | 4 +- .../networking/v1/http2rpc.go | 4 +- .../networking/v1/mcpbridge.go | 4 +- client/pkg/applyconfiguration/utils.go | 10 +- .../pkg/clientset/versioned/clientset.gen.go | 4 +- .../versioned/fake/clientset_generated.gen.go | 10 +- .../clientset/versioned/fake/register.gen.go | 10 +- .../versioned/scheme/register.gen.go | 20 +- .../v1alpha1/extensions_client.gen.go | 4 +- .../fake/fake_extensions_client.gen.go | 2 +- .../v1alpha1/fake/fake_wasmplugin.gen.go | 5 +- .../extensions/v1alpha1/wasmplugin.gen.go | 6 +- .../networking/v1/fake/fake_http2rpc.gen.go | 5 +- .../networking/v1/fake/fake_mcpbridge.gen.go | 5 +- .../v1/fake/fake_networking_client.gen.go | 2 +- .../typed/networking/v1/http2rpc.gen.go | 6 +- .../typed/networking/v1/mcpbridge.gen.go | 6 +- .../networking/v1/networking_client.gen.go | 4 +- .../extensions/interface.gen.go | 4 +- .../extensions/v1alpha1/interface.gen.go | 2 +- .../extensions/v1alpha1/wasmplugin.gen.go | 8 +- .../informers/externalversions/factory.gen.go | 8 +- .../informers/externalversions/generic.gen.go | 4 +- .../factory_interfaces.gen.go | 2 +- .../networking/interface.gen.go | 4 +- .../networking/v1/http2rpc.gen.go | 8 +- .../networking/v1/interface.gen.go | 2 +- .../networking/v1/mcpbridge.gen.go | 8 +- .../extensions/v1alpha1/wasmplugin.gen.go | 2 +- .../pkg/listers/networking/v1/http2rpc.gen.go | 2 +- .../listers/networking/v1/mcpbridge.gen.go | 2 +- cmd/higress/main.go | 2 +- go.mod | 2 +- hgctl/cmd/hgctl/config/gateway_config.go | 2 +- hgctl/cmd/hgctl/config/gateway_config_test.go | 9 +- hgctl/cmd/hgctl/main.go | 2 +- hgctl/go.mod | 4 +- hgctl/pkg/config_cmd.go | 2 +- hgctl/pkg/dashboard.go | 3 +- hgctl/pkg/helm/common.go | 1 - hgctl/pkg/helm/object/objects_test.go | 10 +- hgctl/pkg/helm/render.go | 3 - hgctl/pkg/helm/tpath/tree.go | 1 - hgctl/pkg/helm/tpath/tree_test.go | 6 +- hgctl/pkg/install.go | 7 +- hgctl/pkg/installer/helm_agent.go | 2 +- hgctl/pkg/installer/installer.go | 2 +- hgctl/pkg/installer/installer_docker.go | 1 - hgctl/pkg/installer/profile_store.go | 4 +- hgctl/pkg/manifest.go | 2 +- hgctl/pkg/plugin/build/build.go | 16 +- hgctl/pkg/plugin/build/templates.go | 10 +- hgctl/pkg/plugin/config/create.go | 2 +- hgctl/pkg/plugin/config/edit.go | 2 +- hgctl/pkg/plugin/config/templates.go | 1 - hgctl/pkg/plugin/init/init.go | 2 +- hgctl/pkg/plugin/install/install.go | 2 +- hgctl/pkg/plugin/ls/ls.go | 2 +- hgctl/pkg/plugin/test/create.go | 5 +- .../plugin/types/testdata/types/ext/ext.go | 10 +- hgctl/pkg/plugin/types/testdata/types/main.go | 15 +- hgctl/pkg/plugin/uninstall/uninstall.go | 2 +- hgctl/pkg/profile_dump.go | 2 +- hgctl/pkg/profile_list.go | 1 - hgctl/pkg/root.go | 3 +- hgctl/pkg/uninstall.go | 6 +- hgctl/pkg/upgrade.go | 2 +- hgctl/pkg/version.go | 4 +- pkg/bootstrap/server.go | 12 +- pkg/bootstrap/server_test.go | 2 +- pkg/cmd/server.go | 4 +- pkg/cmd/server_test.go | 2 +- pkg/cmd/version.go | 2 +- pkg/ingress/config/ingress_config.go | 72 ++-- pkg/ingress/config/ingress_config_test.go | 10 +- pkg/ingress/config/ingress_template.go | 2 +- pkg/ingress/config/kingress_config.go | 24 +- pkg/ingress/config/kingress_config_test.go | 18 +- pkg/ingress/config/secret_config_mgr.go | 4 +- pkg/ingress/config/secret_config_mgr_test.go | 15 +- pkg/ingress/kube/annotations/annotations.go | 2 +- pkg/ingress/kube/annotations/auth.go | 4 +- .../kube/annotations/default_backend.go | 4 +- pkg/ingress/kube/annotations/destination.go | 2 +- pkg/ingress/kube/annotations/downstreamtls.go | 4 +- .../kube/annotations/header_control.go | 2 +- pkg/ingress/kube/annotations/http2rpc.go | 2 +- pkg/ingress/kube/annotations/match.go | 3 +- pkg/ingress/kube/annotations/mcpserver.go | 4 +- .../kube/annotations/mcpserver_test.go | 2 +- pkg/ingress/kube/annotations/mirror.go | 4 +- pkg/ingress/kube/annotations/mirror_test.go | 2 +- pkg/ingress/kube/annotations/upstreamtls.go | 2 +- pkg/ingress/kube/common/controller.go | 6 +- pkg/ingress/kube/common/model.go | 2 +- pkg/ingress/kube/common/tool.go | 4 +- pkg/ingress/kube/common/tool_test.go | 3 +- pkg/ingress/kube/configmap/controller.go | 9 +- pkg/ingress/kube/configmap/global.go | 6 +- pkg/ingress/kube/configmap/global_test.go | 2 +- pkg/ingress/kube/configmap/gzip.go | 4 +- pkg/ingress/kube/configmap/gzip_test.go | 5 +- pkg/ingress/kube/configmap/mcp_server.go | 8 +- pkg/ingress/kube/configmap/mcp_server_test.go | 2 +- pkg/ingress/kube/configmap/tracing.go | 4 +- pkg/ingress/kube/controller/model.go | 7 +- pkg/ingress/kube/gateway/controller.go | 10 +- pkg/ingress/kube/gateway/istio/conditions.go | 2 +- .../kube/gateway/istio/conditions_test.go | 2 +- .../kube/gateway/istio/controller_test.go | 2 +- pkg/ingress/kube/gateway/istio/conversion.go | 8 +- .../gateway/istio/deploymentcontroller.go | 4 +- .../kube/gateway/istio/gatewayclass_test.go | 2 +- pkg/ingress/kube/gateway/istio/model.go | 2 +- pkg/ingress/kube/http2rpc/controller.go | 14 +- pkg/ingress/kube/ingress/controller.go | 27 +- pkg/ingress/kube/ingress/controller_test.go | 175 +++++---- pkg/ingress/kube/ingress/status.go | 7 +- pkg/ingress/kube/ingressv1/controller.go | 24 +- pkg/ingress/kube/ingressv1/controller_test.go | 2 +- pkg/ingress/kube/ingressv1/status.go | 7 +- pkg/ingress/kube/kingress/controller.go | 42 +-- pkg/ingress/kube/kingress/controller_test.go | 342 +++++++++--------- pkg/ingress/kube/kingress/status.go | 9 +- pkg/ingress/kube/mcpbridge/controller.go | 14 +- pkg/ingress/kube/secret/controller.go | 4 +- pkg/ingress/kube/secret/controller_test.go | 5 +- pkg/ingress/kube/util/util.go | 5 +- pkg/ingress/kube/wasmplugin/controller.go | 14 +- pkg/ingress/translation/translation.go | 9 +- pkg/kube/client.go | 11 +- plugins/golang-filter/mcp-server/config.go | 9 +- .../mcp-server/registry/nacos/nacos.go | 19 +- .../mcp-server/registry/nacos/server.go | 5 +- .../mcp-server/registry/remote.go | 16 +- .../mcp-server/servers/gorm/tools.go | 6 +- plugins/golang-filter/mcp-session/config.go | 13 +- plugins/wasm-go/extensions/ai-agent/main.go | 48 +-- plugins/wasm-go/extensions/ai-cache/core.go | 1 - plugins/wasm-go/extensions/ai-cache/main.go | 1 - registry/consul/watcher.go | 14 +- registry/direct/watcher.go | 14 +- registry/eureka/watcher.go | 12 +- registry/memory/cache.go | 10 +- registry/nacos/mcpserver/watcher.go | 12 +- registry/nacos/mcpserver/watcher_test.go | 26 +- registry/nacos/v2/watcher.go | 20 +- registry/nacos/watcher.go | 14 +- registry/proxy/factory.go | 10 +- registry/reconcile/reconcile.go | 28 +- registry/watcher.go | 16 +- registry/zookeeper/watcher.go | 17 +- .../e2e/conformance/tests/configmap-global.go | 8 +- test/e2e/conformance/tests/configmap-gzip.go | 10 +- test/e2e/conformance/tests/configmap-https.go | 5 +- .../conformance/tests/cpp-wasm-basic-auth.go | 4 +- .../conformance/tests/cpp-wasm-key-auth.go | 4 +- .../tests/cpp-wasm-request-block.go | 4 +- .../e2e/conformance/tests/go-wasm-ai-cache.go | 4 +- .../e2e/conformance/tests/go-wasm-ai-proxy.go | 4 +- .../tests/go-wasm-basic-auth-template.go | 6 +- .../conformance/tests/go-wasm-basic-auth.go | 4 +- .../conformance/tests/go-wasm-bot-detect.go | 4 +- .../tests/go-wasm-cache-control.go | 5 +- .../tests/go-wasm-custom-response.go | 4 +- test/e2e/conformance/tests/go-wasm-geo-ip.go | 4 +- .../tests/go-wasm-ip-restriction.go | 4 +- .../e2e/conformance/tests/go-wasm-jwt-auth.go | 4 +- .../e2e/conformance/tests/go-wasm-key-auth.go | 4 +- test/e2e/conformance/tests/go-wasm-opa.go | 4 +- .../tests/go-wasm-replay-protection.go | 4 +- .../tests/go-wasm-request-block.go | 4 +- .../tests/go-wasm-request-validation.go | 4 +- .../tests/go-wasm-simple-jwt-auth.go | 4 +- .../tests/go-wasm-sni-misdirect.go | 32 +- .../conformance/tests/go-wasm-transformer.go | 5 +- .../conformance/tests/httproute-app-root.go | 6 +- ...te-canary-header-with-customized-header.go | 7 +- .../tests/httproute-canary-header.go | 4 +- .../tests/httproute-canary-weight.go | 4 +- .../tests/httproute-consul-httpbin.go | 4 +- .../tests/httproute-default-backend.go | 4 +- .../tests/httproute-dns-registry.go | 4 +- .../tests/httproute-downstream-encryption.go | 40 +- .../tests/httproute-enable-cors.go | 5 +- .../tests/httproute-enable-ignore-case.go | 5 +- .../tests/httproute-eureka-registry.go | 4 +- .../tests/httproute-force-redirect-https.go | 7 +- .../tests/httproute-full-path-regex.go | 5 +- .../httproute-hostname-same-namespace.go | 19 +- .../conformance/tests/httproute-http2rpc.go | 4 +- .../tests/httproute-https-without-sni.go | 8 +- test/e2e/conformance/tests/httproute-limit.go | 13 +- .../tests/httproute-match-headers.go | 7 +- .../tests/httproute-match-methods.go | 7 +- .../conformance/tests/httproute-match-path.go | 5 +- .../tests/httproute-match-pseudo-headers.go | 4 +- .../tests/httproute-match-query-params.go | 4 +- .../tests/httproute-mirror-target-service.go | 6 +- .../httproute-permanent-redirect-code.go | 6 +- .../tests/httproute-permanent-redirect.go | 6 +- .../tests/httproute-redirect-as-https.go | 7 +- .../tests/httproute-request-header-control.go | 4 +- .../httproute-response-header-control.go | 4 +- .../tests/httproute-rewrite-host.go | 4 +- .../tests/httproute-rewrite-path.go | 5 +- .../tests/httproute-same-host-and-path.go | 4 +- .../tests/httproute-simple-same-namespace.go | 4 +- .../tests/httproute-static-registry.go | 4 +- .../tests/httproute-temporal-redirect.go | 6 +- .../conformance/tests/httproute-timeout.go | 6 +- .../tests/httproute-whitelist-source-range.go | 4 +- .../tests/ingress-loadbalance-mcp-sse.go | 4 +- .../tests/rust-wasm-ai-data-masking.go | 10 +- .../tests/rust-wasm-request-block.go | 4 +- test/e2e/conformance/tests/tests.go | 2 +- test/e2e/conformance/utils/envoy/envoy.go | 2 +- test/e2e/conformance/utils/http/http.go | 12 +- test/e2e/conformance/utils/http/http_test.go | 4 +- .../e2e/conformance/utils/kubernetes/apply.go | 4 +- .../utils/kubernetes/apply_test.go | 2 +- test/e2e/conformance/utils/kubernetes/cert.go | 2 +- .../conformance/utils/kubernetes/helpers.go | 2 +- .../utils/roundtripper/roundtripper.go | 2 +- test/e2e/conformance/utils/suite/suite.go | 8 +- test/e2e/e2e_test.go | 8 +- 235 files changed, 1077 insertions(+), 1045 deletions(-) diff --git a/Makefile.core.mk b/Makefile.core.mk index 7794bf67a..eff40a43f 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -10,7 +10,7 @@ export BASE_VERSION ?= $(HIGRESS_BASE_VERSION) export CHARTS ?= higress-registry.cn-hangzhou.cr.aliyuncs.com/charts -VERSION_PACKAGE := github.com/alibaba/higress/pkg/cmd/lversion +VERSION_PACKAGE := github.com/alibaba/higress/v2/pkg/cmd/lversion GIT_COMMIT:=$(shell git rev-parse HEAD) diff --git a/api/cue.yaml b/api/cue.yaml index e08baaf64..af0915e18 100644 --- a/api/cue.yaml +++ b/api/cue.yaml @@ -1,6 +1,6 @@ # Cuelang configuration to generate OpenAPI schema for Higress configs. -module: github.com/alibaba/higress/api +module: github.com/alibaba/higress/v2/api openapi: selfContained: true diff --git a/api/extensions/v1alpha1/wasmplugin.proto b/api/extensions/v1alpha1/wasmplugin.proto index c0bdc3def..259914d8c 100644 --- a/api/extensions/v1alpha1/wasmplugin.proto +++ b/api/extensions/v1alpha1/wasmplugin.proto @@ -24,7 +24,7 @@ import "google/protobuf/struct.proto"; package higress.extensions.v1alpha1; -option go_package="github.com/alibaba/higress/api/extensions/v1alpha1"; +option go_package="github.com/alibaba/higress/v2/api/extensions/v1alpha1"; //