From f7a419770d0d108e1962554c9e40c9b5b39fedfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BE=84=E6=BD=AD?= Date: Mon, 26 Aug 2024 09:51:47 +0800 Subject: [PATCH] upgrade to istio 1.19 (#1211) Co-authored-by: CH3CHO Co-authored-by: rinfx <893383980@qq.com> --- .github/workflows/build-and-test-plugin.yaml | 4 +- .github/workflows/build-and-test.yaml | 30 +- .github/workflows/build-image-and-push.yaml | 28 +- .gitignore | 6 +- .gitmodules | 49 +- .licenserc.yaml | 7 +- Makefile.core.mk | 87 +- Makefile.overrides.mk | 2 +- VERSION | 2 +- api/buf.gen.yaml | 20 +- api/extensions/v1alpha1/wasm.pb.go | 1879 +++++------- api/extensions/v1alpha1/wasm.proto | 50 + api/extensions/v1alpha1/wasm_deepcopy.gen.go | 56 +- api/extensions/v1alpha1/wasm_json.gen.go | 41 +- .../customresourcedefinitions.gen.yaml | 28 + api/networking/v1/http_2_rpc.pb.go | 2233 ++++---------- api/networking/v1/http_2_rpc_deepcopy.gen.go | 14 +- api/networking/v1/http_2_rpc_json.gen.go | 19 +- api/networking/v1/mcp_bridge.pb.go | 1488 ++-------- api/networking/v1/mcp_bridge_deepcopy.gen.go | 14 +- api/networking/v1/mcp_bridge_json.gen.go | 19 +- client/Makefile | 13 +- .../pkg/apis/extensions/v1alpha1/types.gen.go | 2 +- .../v1alpha1/zz_generated.deepcopy.gen.go | 8 +- client/pkg/apis/networking/v1/types.gen.go | 8 +- .../v1/zz_generated.deepcopy.gen.go | 16 +- .../extensions/v1alpha1/wasmplugin.go | 219 ++ .../applyconfiguration/internal/internal.go | 60 + .../meta/v1/managedfieldsentry.go | 95 + .../applyconfiguration/meta/v1/objectmeta.go | 169 ++ .../meta/v1/ownerreference.go | 86 + .../applyconfiguration/meta/v1/typemeta.go | 46 + .../networking/v1/http2rpc.go | 219 ++ .../networking/v1/mcpbridge.go | 219 ++ client/pkg/applyconfiguration/utils.go | 55 + .../pkg/clientset/versioned/clientset.gen.go | 44 +- .../versioned/fake/clientset_generated.gen.go | 5 +- .../clientset/versioned/fake/register.gen.go | 16 +- .../versioned/scheme/register.gen.go | 14 +- .../v1alpha1/extensions_client.gen.go | 20 +- .../v1alpha1/fake/fake_wasmplugin.gen.go | 55 +- .../extensions/v1alpha1/wasmplugin.gen.go | 61 + .../networking/v1/fake/fake_http2rpc.gen.go | 105 +- .../networking/v1/fake/fake_mcpbridge.gen.go | 105 +- .../typed/networking/v1/http2rpc.gen.go | 61 + .../typed/networking/v1/mcpbridge.gen.go | 61 + .../networking/v1/networking_client.gen.go | 20 +- .../informers/externalversions/factory.gen.go | 81 +- .../extensions/v1alpha1/wasmplugin.gen.go | 5 + .../pkg/listers/networking/v1/http2rpc.gen.go | 5 + .../listers/networking/v1/mcpbridge.gen.go | 5 + docker/docker.mk | 4 +- envoy/1.20/envoy | 1 - envoy/1.20/go-control-plane | 1 - envoy/envoy | 1 + envoy/go-control-plane | 1 + go.mod | 428 +-- go.sum | 2469 +++++++++------- helm/core/Chart.yaml | 4 +- .../crds/customresourcedefinitions.gen.yaml | 33 +- helm/core/crds/istio-envoyfilter.yaml | 236 ++ .../templates/controller-clusterrole.yaml | 11 +- .../core/templates/controller-deployment.yaml | 6 + helm/core/templates/deployment.yaml | 70 +- helm/higress/Chart.lock | 6 +- helm/higress/Chart.yaml | 6 +- .../cmd}/hgctl/config/gateway_config.go | 12 +- .../cmd}/hgctl/config/gateway_config_test.go | 2 +- .../config/testdata/config/input/in.all.json | 0 .../testdata/config/output/out.all.json | 0 .../testdata/config/output/out.all.yaml | 0 .../testdata/config/output/out.bootstrap.json | 0 .../testdata/config/output/out.bootstrap.yaml | 0 .../testdata/config/output/out.cluster.json | 0 .../testdata/config/output/out.cluster.yaml | 0 .../testdata/config/output/out.endpoints.json | 0 .../testdata/config/output/out.endpoints.yaml | 0 .../testdata/config/output/out.listener.json | 0 .../testdata/config/output/out.listener.yaml | 0 .../testdata/config/output/out.route.json | 0 .../testdata/config/output/out.route.yaml | 0 {cmd => hgctl/cmd}/hgctl/main.go | 2 +- hgctl/go.mod | 297 ++ hgctl/go.sum | 2591 +++++++++++++++++ {pkg/cmd/hgctl => hgctl/pkg}/code_debug.go | 2 +- {pkg/cmd/hgctl => hgctl/pkg}/common.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/completion.go | 0 .../hgctl => hgctl/pkg}/config_bootstrap.go | 2 +- .../cmd/hgctl => hgctl/pkg}/config_cluster.go | 2 +- {pkg/cmd/hgctl => hgctl/pkg}/config_cmd.go | 2 +- .../hgctl => hgctl/pkg}/config_endpoint.go | 2 +- .../hgctl => hgctl/pkg}/config_listener.go | 2 +- {pkg/cmd/hgctl => hgctl/pkg}/config_route.go | 2 +- {pkg/cmd/hgctl => hgctl/pkg}/dashboard.go | 5 + .../cmd/hgctl => hgctl/pkg}/docker/compose.go | 5 +- {pkg/cmd/hgctl => hgctl/pkg}/helm/common.go | 4 +- .../cmd/hgctl => hgctl/pkg}/helm/name/name.go | 0 .../pkg}/helm/object/objects.go | 6 +- .../pkg}/helm/object/objects_test.go | 2 +- {pkg/cmd/hgctl => hgctl/pkg}/helm/profile.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/helm/render.go | 4 +- .../hgctl => hgctl/pkg}/helm/tpath/tree.go | 2 +- .../pkg}/helm/tpath/tree_test.go | 2 +- .../hgctl => hgctl/pkg}/helm/tpath/util.go | 2 +- .../pkg}/helm/tpath/util_test.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/install.go | 4 +- .../pkg}/installer/component.go | 4 +- .../pkg}/installer/gateway_api.go | 6 +- .../pkg}/installer/helm_agent.go | 2 +- .../hgctl => hgctl/pkg}/installer/higress.go | 4 +- .../pkg}/installer/installer.go | 4 +- .../pkg}/installer/installer_docker.go | 2 +- .../pkg}/installer/installer_k8s.go | 8 +- .../hgctl => hgctl/pkg}/installer/istio.go | 6 +- .../pkg}/installer/profile_store.go | 6 +- .../pkg}/installer/server_info.go | 2 +- .../pkg}/installer/standalone.go | 4 +- .../pkg}/installer/standalone_agent.go | 2 +- .../hgctl => hgctl/pkg}/kubernetes/client.go | 0 .../hgctl => hgctl/pkg}/kubernetes/common.go | 0 .../pkg}/kubernetes/port-forwarder.go | 0 .../pkg}/kubernetes/wasmplugin.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/manifest.go | 6 +- .../gatewayapi/experimental-install.yaml | 0 .../pkg}/manifests/istiobase/Chart.yaml | 0 .../pkg}/manifests/istiobase/README.md | 0 .../manifests/istiobase/crds/crd-all.gen.yaml | 0 .../istiobase/crds/crd-operator.yaml | 0 .../manifests/istiobase/templates/NOTES.txt | 0 .../istiobase/templates/clusterrole.yaml | 0 .../templates/clusterrolebinding.yaml | 0 .../manifests/istiobase/templates/crds.yaml | 0 .../istiobase/templates/default.yaml | 0 .../istiobase/templates/endpoints.yaml | 0 .../templates/reader-serviceaccount.yaml | 0 .../manifests/istiobase/templates/role.yaml | 0 .../istiobase/templates/rolebinding.yaml | 0 .../istiobase/templates/serviceaccount.yaml | 0 .../istiobase/templates/services.yaml | 0 .../pkg}/manifests/istiobase/values.yaml | 0 .../hgctl => hgctl/pkg}/manifests/manifest.go | 0 .../pkg}/manifests/profiles/_all.yaml | 0 .../pkg}/manifests/profiles/k8s.yaml | 0 .../pkg}/manifests/profiles/local-docker.yaml | 0 .../pkg}/manifests/profiles/local-k8s.yaml | 0 .../hgctl => hgctl/pkg}/plugin/build/build.go | 6 +- .../pkg}/plugin/build/signal.go | 0 .../pkg}/plugin/build/signal_windows.go | 0 .../pkg}/plugin/build/templates.go | 2 +- .../pkg}/plugin/config/config.go | 0 .../pkg}/plugin/config/create.go | 2 +- .../hgctl => hgctl/pkg}/plugin/config/edit.go | 2 +- .../pkg}/plugin/config/templates.go | 4 +- .../hgctl => hgctl/pkg}/plugin/init/init.go | 4 +- .../pkg}/plugin/init/templates.go | 2 +- .../pkg}/plugin/install/asker.go | 4 +- .../pkg}/plugin/install/install.go | 12 +- {pkg/cmd/hgctl => hgctl/pkg}/plugin/ls/ls.go | 2 +- .../pkg}/plugin/option/option.go | 0 .../pkg}/plugin/option/template.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/plugin/plugin.go | 14 +- .../hgctl => hgctl/pkg}/plugin/test/clean.go | 6 +- .../hgctl => hgctl/pkg}/plugin/test/create.go | 8 +- .../cmd/hgctl => hgctl/pkg}/plugin/test/ls.go | 2 +- .../hgctl => hgctl/pkg}/plugin/test/start.go | 4 +- .../hgctl => hgctl/pkg}/plugin/test/stop.go | 4 +- .../pkg}/plugin/test/templates.go | 0 .../hgctl => hgctl/pkg}/plugin/test/test.go | 0 .../pkg}/plugin/types/annotation.go | 0 .../pkg}/plugin/types/marshal.go | 0 .../hgctl => hgctl/pkg}/plugin/types/meta.go | 0 .../pkg}/plugin/types/model_parser.go | 0 .../pkg}/plugin/types/model_parser_test.go | 0 .../pkg}/plugin/types/schema.go | 2 +- .../plugin/types/testdata/doc_tag/main.go | 0 .../plugin/types/testdata/types/ext/ext.go | 2 +- .../types/testdata/types/ext/nested/nested.go | 0 .../pkg}/plugin/types/testdata/types/main.go | 2 +- .../pkg}/plugin/uninstall/uninstall.go | 2 +- .../pkg}/plugin/utils/common.go | 0 .../pkg}/plugin/utils/debugger.go | 0 .../pkg}/plugin/utils/printer.go | 0 .../pkg}/plugin/utils/survey_wrapper.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/profile.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/profile_dump.go | 2 +- {pkg/cmd/hgctl => hgctl/pkg}/profile_list.go | 2 +- {pkg/cmd/hgctl => hgctl/pkg}/root.go | 2 +- {pkg/cmd/hgctl => hgctl/pkg}/uninstall.go | 6 +- {pkg/cmd/hgctl => hgctl/pkg}/upgrade.go | 8 +- {pkg/cmd/hgctl => hgctl/pkg}/util/filter.go | 0 .../hgctl => hgctl/pkg}/util/filter_test.go | 0 .../hgctl => hgctl/pkg}/util/http_fetcher.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/util/path.go | 0 .../cmd/hgctl => hgctl/pkg}/util/path_test.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/util/reflect.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/util/util.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/util/yaml.go | 0 .../cmd/hgctl => hgctl/pkg}/util/yaml_test.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/utils.go | 0 {pkg/cmd/hgctl => hgctl/pkg}/version.go | 2 +- istio/1.12/api | 1 - istio/1.12/client-go | 1 - istio/1.12/istio | 1 - istio/1.12/pkg | 1 - istio/1.12/proxy | 1 - istio/api | 1 + istio/client-go | 1 + istio/istio | 1 + istio/pkg | 1 + istio/proxy | 1 + pkg/bootstrap/server.go | 93 +- pkg/bootstrap/server_test.go | 8 +- pkg/cert/certmgr.go | 10 +- pkg/cmd/server.go | 28 +- pkg/config/constants/constants.go | 4 + pkg/config/envs.go | 25 + pkg/ingress/config/ingress_config.go | 321 +- pkg/ingress/config/ingress_config_test.go | 3 +- pkg/ingress/config/kingress_config.go | 111 +- pkg/ingress/config/kingress_config_test.go | 20 +- pkg/ingress/kube/annotations/annotations.go | 11 +- pkg/ingress/kube/annotations/auth_test.go | 15 +- pkg/ingress/kube/annotations/canary_test.go | 263 +- pkg/ingress/kube/annotations/cors.go | 7 +- pkg/ingress/kube/annotations/cors_test.go | 14 +- .../kube/annotations/default_backend.go | 8 +- .../kube/annotations/default_backend_test.go | 15 +- .../kube/annotations/destination_test.go | 10 +- pkg/ingress/kube/annotations/downstreamtls.go | 12 +- .../kube/annotations/downstreamtls_test.go | 12 +- .../kube/annotations/ignore_case_test.go | 10 +- .../kube/annotations/ip_access_control.go | 5 +- pkg/ingress/kube/annotations/loadbalance.go | 10 +- .../kube/annotations/loadbalance_test.go | 20 +- .../kube/annotations/local_rate_limit.go | 14 +- .../kube/annotations/local_rate_limit_test.go | 4 +- pkg/ingress/kube/annotations/match_test.go | 9 +- pkg/ingress/kube/annotations/retry.go | 9 +- pkg/ingress/kube/annotations/retry_test.go | 21 +- pkg/ingress/kube/annotations/rewrite.go | 28 +- pkg/ingress/kube/annotations/rewrite_test.go | 34 +- pkg/ingress/kube/annotations/timeout.go | 5 +- pkg/ingress/kube/annotations/timeout_test.go | 3 +- pkg/ingress/kube/annotations/upstreamtls.go | 4 +- .../kube/annotations/upstreamtls_test.go | 10 +- pkg/ingress/kube/annotations/util.go | 14 +- pkg/ingress/kube/annotations/util_test.go | 10 +- pkg/ingress/kube/common/controller.go | 11 +- pkg/ingress/kube/common/metrics.go | 13 +- pkg/ingress/kube/common/model.go | 50 +- pkg/ingress/kube/common/schema.go | 12 +- pkg/ingress/kube/common/tool.go | 45 +- pkg/ingress/kube/configmap/controller.go | 30 +- pkg/ingress/kube/configmap/tracing.go | 5 +- pkg/ingress/kube/controller/model.go | 57 +- pkg/ingress/kube/gateway/controller.go | 197 ++ pkg/ingress/kube/gateway/istio/conditions.go | 362 +++ .../kube/gateway/istio/conditions_test.go | 110 + pkg/ingress/kube/gateway/istio/context.go | 133 + pkg/ingress/kube/gateway/istio/controller.go | 403 +++ .../kube/gateway/istio/controller_test.go | 205 ++ pkg/ingress/kube/gateway/istio/conversion.go | 2221 ++++++++++++++ .../kube/gateway/istio/conversion_test.go | 994 +++++++ .../gateway/istio/deploymentcontroller.go | 90 + pkg/ingress/kube/gateway/istio/fuzz_test.go | 28 + .../kube/gateway/istio/gatewayclass.go | 121 + .../kube/gateway/istio/gatewayclass_test.go | 93 + .../kube/gateway/istio/generation_adapter.go | 32 + .../ingress/kube/gateway/istio/leak_test.go | 18 +- pkg/ingress/kube/gateway/istio/model.go | 122 + .../istio/testdata/alias.status.yaml.golden | 98 + .../kube/gateway/istio/testdata/alias.yaml | 65 + .../gateway/istio/testdata/alias.yaml.golden | 68 + .../istio/testdata/benchmark-httproute.yaml | 131 + .../testdata/delegated.status.yaml.golden | 141 + .../gateway/istio/testdata/delegated.yaml | 67 + .../istio/testdata/delegated.yaml.golden | 80 + .../istio/testdata/http.status.yaml.golden | 240 ++ .../kube/gateway/istio/testdata/http.yaml | 212 ++ .../gateway/istio/testdata/http.yaml.golden | 213 ++ .../istio/testdata/invalid.status.yaml.golden | 480 +++ .../kube/gateway/istio/testdata/invalid.yaml | 262 ++ .../istio/testdata/invalid.yaml.golden | 167 ++ .../istio/testdata/mcs.status.yaml.golden | 75 + .../kube/gateway/istio/testdata/mcs.yaml | 30 + .../gateway/istio/testdata/mcs.yaml.golden | 39 + .../testdata/mismatch.status.yaml.golden | 23 + .../kube/gateway/istio/testdata/mismatch.yaml | 22 + .../istio/testdata/mismatch.yaml.golden | 0 .../testdata/multi-gateway.status.yaml.golden | 94 + .../gateway/istio/testdata/multi-gateway.yaml | 32 + .../istio/testdata/multi-gateway.yaml.golden | 36 + ...eference-policy-service.status.yaml.golden | 101 + .../testdata/reference-policy-service.yaml | 70 + .../reference-policy-service.yaml.golden | 65 + .../reference-policy-tls.status.yaml.golden | 88 + .../istio/testdata/reference-policy-tls.yaml | 62 + .../testdata/reference-policy-tls.yaml.golden | 43 + .../testdata/route-binding.status.yaml.golden | 418 +++ .../gateway/istio/testdata/route-binding.yaml | 200 ++ .../istio/testdata/route-binding.yaml.golden | 213 ++ .../route-precedence.status.yaml.golden | 189 ++ .../istio/testdata/route-precedence.yaml | 143 + .../testdata/route-precedence.yaml.golden | 289 ++ .../testdata/serviceentry.status.yaml.golden | 73 + .../gateway/istio/testdata/serviceentry.yaml | 32 + .../istio/testdata/serviceentry.yaml.golden | 41 + .../istio/testdata/tcp.status.yaml.golden | 90 + .../kube/gateway/istio/testdata/tcp.yaml | 38 + .../gateway/istio/testdata/tcp.yaml.golden | 39 + .../istio/testdata/tls.status.yaml.golden | 192 ++ .../kube/gateway/istio/testdata/tls.yaml | 95 + .../gateway/istio/testdata/tls.yaml.golden | 131 + .../testdata/weighted.status.yaml.golden | 142 + .../kube/gateway/istio/testdata/weighted.yaml | 94 + .../istio/testdata/weighted.yaml.golden | 110 + .../istio/testdata/zero.status.yaml.golden | 142 + .../kube/gateway/istio/testdata/zero.yaml | 80 + .../gateway/istio/testdata/zero.yaml.golden | 93 + pkg/ingress/kube/http2rpc/controller.go | 3 +- pkg/ingress/kube/ingress/controller.go | 160 +- pkg/ingress/kube/ingress/controller_test.go | 63 +- pkg/ingress/kube/ingress/status.go | 34 +- pkg/ingress/kube/ingressv1/controller.go | 131 +- pkg/ingress/kube/ingressv1/controller_test.go | 11 +- pkg/ingress/kube/ingressv1/status.go | 25 +- pkg/ingress/kube/kingress/controller.go | 93 +- pkg/ingress/kube/kingress/status.go | 5 +- pkg/ingress/kube/mcpbridge/controller.go | 3 +- pkg/ingress/kube/secret/controller.go | 36 +- pkg/ingress/kube/secret/controller_test.go | 10 +- pkg/ingress/kube/util/transformer.go | 84 + pkg/ingress/kube/util/util.go | 53 +- pkg/ingress/kube/util/util_test.go | 73 +- pkg/ingress/kube/wasmplugin/controller.go | 3 +- pkg/ingress/mcp/generator.go | 170 +- pkg/ingress/mcp/generator_test.go | 154 +- pkg/ingress/translation/translation.go | 78 +- pkg/kube/client.go | 11 +- plugins/wasm-cpp/Dockerfile | 2 +- plugins/wasm-go/extensions/ai-agent/VERSION | 1 + .../extensions/ai-prompt-template/VERSION | 1 + plugins/wasm-go/extensions/ai-quota/VERSION | 1 + plugins/wasm-go/extensions/ai-rag/VERSION | 1 + .../extensions/ai-security-guard/VERSION | 1 + .../wasm-go/extensions/ai-statistics/VERSION | 1 + .../extensions/ai-token-ratelimit/VERSION | 1 + .../wasm-go/extensions/ai-transformer/VERSION | 1 + plugins/wasm-go/extensions/basic-auth/VERSION | 2 +- plugins/wasm-go/extensions/bot-detect/VERSION | 2 +- .../extensions/cluster-key-rate-limit/VERSION | 1 + plugins/wasm-go/extensions/cors/VERSION | 2 +- .../extensions/custom-response/VERSION | 1 + plugins/wasm-go/extensions/de-graphql/VERSION | 2 +- plugins/wasm-go/extensions/ext-auth/VERSION | 1 + .../wasm-go/extensions/frontend-gray/VERSION | 1 + .../wasm-go/extensions/ip-restriction/VERSION | 2 +- plugins/wasm-go/extensions/jwt-auth/VERSION | 2 +- plugins/wasm-go/extensions/key-auth/VERSION | 2 +- plugins/wasm-go/extensions/opa/VERSION | 2 +- .../wasm-go/extensions/request-block/VERSION | 2 +- .../extensions/request-validation/VERSION | 2 +- .../wasm-go/extensions/transformer/VERSION | 2 +- plugins/wasm-go/extensions/waf/VERSION | 1 + registry/consul/watcher.go | 4 +- registry/direct/watcher.go | 4 +- registry/eureka/watcher.go | 4 +- registry/nacos/v2/watcher.go | 4 +- registry/nacos/watcher.go | 4 +- registry/reconcile/reconcile.go | 2 +- registry/zookeeper/watcher.go | 4 +- .../conformance/tests/go-wasm-ai-proxy.yaml | 2 +- .../conformance/tests/go-wasm-basic-auth.yaml | 2 +- .../conformance/tests/go-wasm-bot-detect.yaml | 2 +- .../tests/go-wasm-cache-control.yaml | 2 +- .../tests/go-wasm-custom-response.yaml | 4 +- .../tests/go-wasm-ip-restriction-allow.yaml | 2 +- .../tests/go-wasm-ip-restriction-deny.yaml | 2 +- .../tests/go-wasm-jwt-auth-allow.yaml | 2 +- .../tests/go-wasm-jwt-auth-deny.yaml | 2 +- .../go-wasm-jwt-auth-single-consumer.yaml | 2 +- .../conformance/tests/go-wasm-key-auth.yaml | 2 +- test/e2e/conformance/tests/go-wasm-opa.yaml | 2 +- .../tests/go-wasm-request-block.yaml | 2 +- .../tests/go-wasm-request-validation.yaml | 2 +- .../tests/go-wasm-simple-jwt-auth.yaml | 2 +- .../tests/go-wasm-sni-misdirect.yaml | 2 +- .../tests/go-wasm-transformer.yaml | 2 +- .../tests/httproute-http2rpc-1-update.yaml | 36 + .../conformance/tests/httproute-http2rpc.go | 66 +- test/e2e/conformance/utils/envoy/envoy.go | 2 +- test/e2e/conformance/utils/suite/features.go | 6 +- test/e2e/conformance/utils/suite/suite.go | 16 +- tools/hack/build-envoy.patch | 49 + tools/hack/build-envoy.sh | 38 + tools/hack/build-istio-image.sh | 38 + tools/hack/build-istio-pilot.sh | 32 + tools/hack/build-wasm-plugins.sh | 16 +- tools/hack/gobuild.sh | 6 + tools/hack/prebuild.sh | 22 +- .../hack/setup-istio-env.sh | 41 +- 401 files changed, 21171 insertions(+), 7255 deletions(-) create mode 100644 client/pkg/applyconfiguration/extensions/v1alpha1/wasmplugin.go create mode 100644 client/pkg/applyconfiguration/internal/internal.go create mode 100644 client/pkg/applyconfiguration/meta/v1/managedfieldsentry.go create mode 100644 client/pkg/applyconfiguration/meta/v1/objectmeta.go create mode 100644 client/pkg/applyconfiguration/meta/v1/ownerreference.go create mode 100644 client/pkg/applyconfiguration/meta/v1/typemeta.go create mode 100644 client/pkg/applyconfiguration/networking/v1/http2rpc.go create mode 100644 client/pkg/applyconfiguration/networking/v1/mcpbridge.go create mode 100644 client/pkg/applyconfiguration/utils.go delete mode 160000 envoy/1.20/envoy delete mode 160000 envoy/1.20/go-control-plane create mode 160000 envoy/envoy create mode 160000 envoy/go-control-plane create mode 100644 helm/core/crds/istio-envoyfilter.yaml rename {cmd => hgctl/cmd}/hgctl/config/gateway_config.go (95%) rename {cmd => hgctl/cmd}/hgctl/config/gateway_config_test.go (98%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/input/in.all.json (100%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/output/out.all.json (100%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/output/out.all.yaml (100%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/output/out.bootstrap.json (100%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/output/out.bootstrap.yaml (100%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/output/out.cluster.json (100%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/output/out.cluster.yaml (100%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/output/out.endpoints.json (100%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/output/out.endpoints.yaml (100%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/output/out.listener.json (100%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/output/out.listener.yaml (100%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/output/out.route.json (100%) rename {cmd => hgctl/cmd}/hgctl/config/testdata/config/output/out.route.yaml (100%) rename {cmd => hgctl/cmd}/hgctl/main.go (94%) create mode 100644 hgctl/go.mod create mode 100644 hgctl/go.sum rename {pkg/cmd/hgctl => hgctl/pkg}/code_debug.go (99%) rename {pkg/cmd/hgctl => hgctl/pkg}/common.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/completion.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/config_bootstrap.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/config_cluster.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/config_cmd.go (98%) rename {pkg/cmd/hgctl => hgctl/pkg}/config_endpoint.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/config_listener.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/config_route.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/dashboard.go (98%) rename {pkg/cmd/hgctl => hgctl/pkg}/docker/compose.go (91%) rename {pkg/cmd/hgctl => hgctl/pkg}/helm/common.go (99%) rename {pkg/cmd/hgctl => hgctl/pkg}/helm/name/name.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/helm/object/objects.go (98%) rename {pkg/cmd/hgctl => hgctl/pkg}/helm/object/objects_test.go (99%) rename {pkg/cmd/hgctl => hgctl/pkg}/helm/profile.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/helm/render.go (99%) rename {pkg/cmd/hgctl => hgctl/pkg}/helm/tpath/tree.go (99%) rename {pkg/cmd/hgctl => hgctl/pkg}/helm/tpath/tree_test.go (99%) rename {pkg/cmd/hgctl => hgctl/pkg}/helm/tpath/util.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/helm/tpath/util_test.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/install.go (98%) rename {pkg/cmd/hgctl => hgctl/pkg}/installer/component.go (96%) rename {pkg/cmd/hgctl => hgctl/pkg}/installer/gateway_api.go (94%) rename {pkg/cmd/hgctl => hgctl/pkg}/installer/helm_agent.go (98%) rename {pkg/cmd/hgctl => hgctl/pkg}/installer/higress.go (96%) rename {pkg/cmd/hgctl => hgctl/pkg}/installer/installer.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/installer/installer_docker.go (98%) rename {pkg/cmd/hgctl => hgctl/pkg}/installer/installer_k8s.go (98%) rename {pkg/cmd/hgctl => hgctl/pkg}/installer/istio.go (95%) rename {pkg/cmd/hgctl => hgctl/pkg}/installer/profile_store.go (98%) rename {pkg/cmd/hgctl => hgctl/pkg}/installer/server_info.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/installer/standalone.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/installer/standalone_agent.go (99%) rename {pkg/cmd/hgctl => hgctl/pkg}/kubernetes/client.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/kubernetes/common.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/kubernetes/port-forwarder.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/kubernetes/wasmplugin.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifest.go (96%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/gatewayapi/experimental-install.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/Chart.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/README.md (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/crds/crd-all.gen.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/crds/crd-operator.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/templates/NOTES.txt (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/templates/clusterrole.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/templates/clusterrolebinding.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/templates/crds.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/templates/default.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/templates/endpoints.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/templates/reader-serviceaccount.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/templates/role.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/templates/rolebinding.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/templates/serviceaccount.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/templates/services.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/istiobase/values.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/manifest.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/profiles/_all.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/profiles/k8s.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/profiles/local-docker.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/manifests/profiles/local-k8s.yaml (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/build/build.go (99%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/build/signal.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/build/signal_windows.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/build/templates.go (98%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/config/config.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/config/create.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/config/edit.go (98%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/config/templates.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/init/init.go (95%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/init/templates.go (99%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/install/asker.go (99%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/install/install.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/ls/ls.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/option/option.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/option/template.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/plugin.go (74%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/test/clean.go (94%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/test/create.go (95%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/test/ls.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/test/start.go (96%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/test/stop.go (95%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/test/templates.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/test/test.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/types/annotation.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/types/marshal.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/types/meta.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/types/model_parser.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/types/model_parser_test.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/types/schema.go (99%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/types/testdata/doc_tag/main.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/types/testdata/types/ext/ext.go (91%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/types/testdata/types/ext/nested/nested.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/types/testdata/types/main.go (95%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/uninstall/uninstall.go (98%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/utils/common.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/utils/debugger.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/utils/printer.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/plugin/utils/survey_wrapper.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/profile.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/profile_dump.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/profile_list.go (97%) rename {pkg/cmd/hgctl => hgctl/pkg}/root.go (96%) rename {pkg/cmd/hgctl => hgctl/pkg}/uninstall.go (96%) rename {pkg/cmd/hgctl => hgctl/pkg}/upgrade.go (96%) rename {pkg/cmd/hgctl => hgctl/pkg}/util/filter.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/util/filter_test.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/util/http_fetcher.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/util/path.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/util/path_test.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/util/reflect.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/util/util.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/util/yaml.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/util/yaml_test.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/utils.go (100%) rename {pkg/cmd/hgctl => hgctl/pkg}/version.go (98%) delete mode 160000 istio/1.12/api delete mode 160000 istio/1.12/client-go delete mode 160000 istio/1.12/istio delete mode 160000 istio/1.12/pkg delete mode 160000 istio/1.12/proxy create mode 160000 istio/api create mode 160000 istio/client-go create mode 160000 istio/istio create mode 160000 istio/pkg create mode 160000 istio/proxy create mode 100644 pkg/config/envs.go create mode 100644 pkg/ingress/kube/gateway/controller.go create mode 100644 pkg/ingress/kube/gateway/istio/conditions.go create mode 100644 pkg/ingress/kube/gateway/istio/conditions_test.go create mode 100644 pkg/ingress/kube/gateway/istio/context.go create mode 100644 pkg/ingress/kube/gateway/istio/controller.go create mode 100644 pkg/ingress/kube/gateway/istio/controller_test.go create mode 100644 pkg/ingress/kube/gateway/istio/conversion.go create mode 100644 pkg/ingress/kube/gateway/istio/conversion_test.go create mode 100644 pkg/ingress/kube/gateway/istio/deploymentcontroller.go create mode 100644 pkg/ingress/kube/gateway/istio/fuzz_test.go create mode 100644 pkg/ingress/kube/gateway/istio/gatewayclass.go create mode 100644 pkg/ingress/kube/gateway/istio/gatewayclass_test.go create mode 100644 pkg/ingress/kube/gateway/istio/generation_adapter.go rename client/pkg/clientset/versioned/doc.go => pkg/ingress/kube/gateway/istio/leak_test.go (64%) create mode 100644 pkg/ingress/kube/gateway/istio/model.go create mode 100644 pkg/ingress/kube/gateway/istio/testdata/alias.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/alias.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/alias.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/benchmark-httproute.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/delegated.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/delegated.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/delegated.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/http.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/http.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/http.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/invalid.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/invalid.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/invalid.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/mcs.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/mcs.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/mcs.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/mismatch.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/mismatch.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/mismatch.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/multi-gateway.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/multi-gateway.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/multi-gateway.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/reference-policy-service.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/reference-policy-service.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/reference-policy-service.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/reference-policy-tls.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/reference-policy-tls.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/reference-policy-tls.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/route-binding.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/route-binding.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/route-binding.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/route-precedence.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/route-precedence.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/route-precedence.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/serviceentry.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/serviceentry.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/serviceentry.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/tcp.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/tcp.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/tcp.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/tls.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/tls.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/tls.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/weighted.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/weighted.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/weighted.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/zero.status.yaml.golden create mode 100644 pkg/ingress/kube/gateway/istio/testdata/zero.yaml create mode 100644 pkg/ingress/kube/gateway/istio/testdata/zero.yaml.golden create mode 100644 pkg/ingress/kube/util/transformer.go create mode 100644 plugins/wasm-go/extensions/ai-agent/VERSION create mode 100644 plugins/wasm-go/extensions/ai-prompt-template/VERSION create mode 100644 plugins/wasm-go/extensions/ai-quota/VERSION create mode 100644 plugins/wasm-go/extensions/ai-rag/VERSION create mode 100644 plugins/wasm-go/extensions/ai-security-guard/VERSION create mode 100644 plugins/wasm-go/extensions/ai-statistics/VERSION create mode 100644 plugins/wasm-go/extensions/ai-token-ratelimit/VERSION create mode 100644 plugins/wasm-go/extensions/ai-transformer/VERSION create mode 100644 plugins/wasm-go/extensions/cluster-key-rate-limit/VERSION create mode 100644 plugins/wasm-go/extensions/custom-response/VERSION create mode 100644 plugins/wasm-go/extensions/ext-auth/VERSION create mode 100644 plugins/wasm-go/extensions/frontend-gray/VERSION create mode 100644 plugins/wasm-go/extensions/waf/VERSION create mode 100644 tools/hack/build-envoy.patch create mode 100755 tools/hack/build-envoy.sh create mode 100755 tools/hack/build-istio-image.sh create mode 100755 tools/hack/build-istio-pilot.sh rename test/e2e/conformance/tests/httproute-http2rpc-2-delete.yaml => tools/hack/setup-istio-env.sh (51%) mode change 100644 => 100755 diff --git a/.github/workflows/build-and-test-plugin.yaml b/.github/workflows/build-and-test-plugin.yaml index c2a57774e..a73ead8fb 100644 --- a/.github/workflows/build-and-test-plugin.yaml +++ b/.github/workflows/build-and-test-plugin.yaml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version: 1.21.5 # There are too many lint errors in current code bases # uncomment when we decide what lint should be addressed or ignored. # - run: make lint @@ -47,7 +47,7 @@ jobs: - name: "Setup Go" uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version: 1.21.5 - name: Setup Rust uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 6e38c038b..06988612d 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version: 1.21.5 # There are too many lint errors in current code bases # uncomment when we decide what lint should be addressed or ignored. # - run: make lint @@ -23,6 +23,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: "Setup Go" + uses: actions/setup-go@v5 + with: + go-version: 1.21.5 + - name: Setup Golang Caches uses: actions/cache@v4 with: @@ -44,7 +49,9 @@ jobs: # test - name: Run Coverage Tests - run: GOPROXY="https://proxy.golang.org,direct" make go.test.coverage + run: |- + go version + GOPROXY="https://proxy.golang.org,direct" make go.test.coverage - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: @@ -65,7 +72,7 @@ jobs: - name: "Setup Go" uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version: 1.21.5 - name: Setup Golang Caches uses: actions/cache@v4 @@ -105,12 +112,22 @@ jobs: runs-on: ubuntu-latest needs: [build] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧 + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true - name: "Setup Go" uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version: 1.21.5 - name: Setup Golang Caches uses: actions/cache@v4 @@ -119,8 +136,7 @@ jobs: ~/.cache/go-build ~/go/pkg/mod key: ${{ runner.os }}-go-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-go + restore-keys: ${{ runner.os }}-go - name: Setup Submodule Caches uses: actions/cache@v4 diff --git a/.github/workflows/build-image-and-push.yaml b/.github/workflows/build-image-and-push.yaml index 70d023201..ef99100a8 100644 --- a/.github/workflows/build-image-and-push.yaml +++ b/.github/workflows/build-image-and-push.yaml @@ -33,7 +33,7 @@ jobs: - name: "Setup Go" uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version: 1.21.5 - name: Setup Golang Caches uses: actions/cache@v4 @@ -109,7 +109,7 @@ jobs: - name: "Setup Go" uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version: 1.21.5 - name: Setup Golang Caches uses: actions/cache@v4 @@ -130,6 +130,17 @@ jobs: key: ${{ runner.os }}-submodules-${{ github.run_id }} restore-keys: ${{ runner.os }}-submodules-new + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Calculate Docker metadata id: docker-meta uses: docker/metadata-action@v5 @@ -186,7 +197,7 @@ jobs: - name: "Setup Go" uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version: 1.21.5 - name: Setup Golang Caches uses: actions/cache@v4 @@ -207,6 +218,17 @@ jobs: key: ${{ runner.os }}-submodules-${{ github.run_id }} restore-keys: ${{ runner.os }}-submodules-new + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Calculate Docker metadata id: docker-meta uses: docker/metadata-action@v5 diff --git a/.gitignore b/.gitignore index 94c7c701c..877985365 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -external out *.out *.tgz @@ -11,7 +10,10 @@ bazel-bin bazel-out bazel-testlogs bazel-wasm-cpp +external/ tools/bin/ helm/**/charts/**.tgz target/ -tools/hack/cluster.conf \ No newline at end of file +tools/hack/cluster.conf +envoy/1.20 +istio/1.12 \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 22442742f..3c8a0872f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,21 +1,28 @@ -[submodule "istio/1.12/api"] - path = istio/1.12/api - url = https://github.com/istio/api -[submodule "istio/1.12/istio"] - path = istio/1.12/istio - url = https://github.com/istio/istio -[submodule "istio/1.12/client-go"] - path = istio/1.12/client-go - url = https://github.com/istio/client-go -[submodule "istio/1.12/pkg"] - path = istio/1.12/pkg - url = https://github.com/istio/pkg -[submodule "istio/1.12/proxy"] - path = istio/1.12/proxy - url = https://github.com/istio/proxy -[submodule "envoy/1.20/go-control-plane"] - path = envoy/1.20/go-control-plane - url = https://github.com/envoyproxy/go-control-plane -[submodule "envoy/1.20/envoy"] - path = envoy/1.20/envoy - url = https://github.com/envoyproxy/envoy +[submodule "istio/api"] + path = istio/api + url = https://github.com/higress-group/api + branch = istio-1.19 +[submodule "istio/istio"] + path = istio/istio + url = https://github.com/higress-group/istio + branch = istio-1.19 +[submodule "istio/client-go"] + path = istio/client-go + url = https://github.com/higress-group/client-go + branch = istio-1.19 +[submodule "istio/pkg"] + path = istio/pkg + url = https://github.com/higress-group/pkg + branch = istio-1.19 +[submodule "istio/proxy"] + path = istio/proxy + url = https://github.com/higress-group/proxy + branch = istio-1.19 +[submodule "envoy/go-control-plane"] + path = envoy/go-control-plane + url = https://github.com/higress-group/go-control-plane + branch = istio-1.19 +[submodule "envoy/envoy"] + path = envoy/envoy + url = https://github.com/higress-group/envoy + branch = envoy-1.27 \ No newline at end of file diff --git a/.licenserc.yaml b/.licenserc.yaml index e74a7721a..99cc87719 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -7,6 +7,8 @@ header: - '.gitignore' - '*.md' - '*.yml' + - '*.yaml' + - '*.golden' - 'LICENSE' - 'api/**' - 'samples/**' @@ -27,8 +29,9 @@ header: - 'tools/' - 'test/README.md' - 'test/README_CN.md' - - 'cmd/hgctl/config/testdata/config' - - 'pkg/cmd/hgctl/manifests' + - 'hgctl/cmd/hgctl/config/testdata/config' + - 'hgctl/pkg/manifests' + - 'pkg/ingress/kube/gateway/istio/testdata' comment: on-failure dependency: diff --git a/Makefile.core.mk b/Makefile.core.mk index 62075a006..913ee70a0 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -1,12 +1,16 @@ SHELL := /bin/bash -o pipefail -export BASE_VERSION ?= 2022-10-27T19-02-22 +export HIGRESS_BASE_VERSION ?= 2023-07-20T20-50-43 export HUB ?= higress-registry.cn-hangzhou.cr.aliyuncs.com/higress +export ISTIO_BASE_REGISTRY ?= $(HUB) + +export BASE_VERSION ?= $(HIGRESS_BASE_VERSION) + export CHARTS ?= higress-registry.cn-hangzhou.cr.aliyuncs.com/charts -VERSION_PACKAGE := github.com/alibaba/higress/pkg/cmd/version +VERSION_PACKAGE := github.com/alibaba/higress/pkg/cmd/lversion GIT_COMMIT:=$(shell git rev-parse HEAD) @@ -21,7 +25,7 @@ TARGET_ARCH ?= amd64 GOARCH_LOCAL := $(TARGET_ARCH) GOOS_LOCAL := $(TARGET_OS) -RELEASE_LDFLAGS='$(GO_LDFLAGS) -extldflags -static -s -w' +RELEASE_LDFLAGS='$(GO_LDFLAGS) -extldflags -static -s -w -X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn' export OUT:=$(TARGET_OUT) export OUT_LINUX:=$(TARGET_OUT_LINUX) @@ -45,6 +49,7 @@ HIGRESS_DOCKER_BUILD_TOP:=${OUT_LINUX}/docker_build HIGRESS_BINARIES:=./cmd/higress +HGCTL_PROJECT_DIR=./hgctl HGCTL_BINARIES:=./cmd/hgctl $(OUT): @@ -52,6 +57,7 @@ $(OUT): submodule: git submodule update --init +# git submodule update --remote .PHONY: prebuild prebuild: submodule @@ -62,7 +68,7 @@ default: build .PHONY: go.test.coverage go.test.coverage: prebuild - go test ./cmd/... ./pkg/... -race -coverprofile=coverage.xml -covermode=atomic + go test -ldflags "-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn" ./cmd/... ./pkg/... -race -coverprofile=coverage.xml -covermode=atomic .PHONY: build build: prebuild $(OUT) @@ -80,20 +86,20 @@ $(ARM64_OUT_LINUX)/higress: .PHONY: build-hgctl build-hgctl: prebuild $(OUT) - GOPROXY=$(GOPROXY) GOOS=$(GOOS_LOCAL) GOARCH=$(GOARCH_LOCAL) LDFLAGS=$(RELEASE_LDFLAGS) tools/hack/gobuild.sh $(OUT)/ $(HGCTL_BINARIES) + GOPROXY=$(GOPROXY) GOOS=$(GOOS_LOCAL) GOARCH=$(GOARCH_LOCAL) LDFLAGS=$(RELEASE_LDFLAGS) PROJECT_DIR="$(HGCTL_PROJECT_DIR)" tools/hack/gobuild.sh $(OUT)/ $(HGCTL_BINARIES) .PHONY: build-linux-hgctl build-linux-hgctl: prebuild $(OUT) - GOPROXY=$(GOPROXY) GOOS=linux GOARCH=$(GOARCH_LOCAL) LDFLAGS=$(RELEASE_LDFLAGS) tools/hack/gobuild.sh $(OUT_LINUX)/ $(HGCTL_BINARIES) + GOPROXY=$(GOPROXY) GOOS=linux GOARCH=$(GOARCH_LOCAL) LDFLAGS=$(RELEASE_LDFLAGS) PROJECT_DIR="$(HGCTL_PROJECT_DIR)" tools/hack/gobuild.sh $(OUT_LINUX)/ $(HGCTL_BINARIES) .PHONY: build-hgctl-multiarch build-hgctl-multiarch: prebuild $(OUT) - GOPROXY=$(GOPROXY) GOOS=linux GOARCH=amd64 LDFLAGS=$(RELEASE_LDFLAGS) tools/hack/gobuild.sh ./out/linux_amd64/ $(HGCTL_BINARIES) - GOPROXY=$(GOPROXY) GOOS=linux GOARCH=arm64 LDFLAGS=$(RELEASE_LDFLAGS) tools/hack/gobuild.sh ./out/linux_arm64/ $(HGCTL_BINARIES) - GOPROXY=$(GOPROXY) GOOS=darwin GOARCH=amd64 LDFLAGS=$(RELEASE_LDFLAGS) tools/hack/gobuild.sh ./out/darwin_amd64/ $(HGCTL_BINARIES) - GOPROXY=$(GOPROXY) GOOS=darwin GOARCH=arm64 LDFLAGS=$(RELEASE_LDFLAGS) tools/hack/gobuild.sh ./out/darwin_arm64/ $(HGCTL_BINARIES) - GOPROXY=$(GOPROXY) GOOS=windows GOARCH=amd64 LDFLAGS=$(RELEASE_LDFLAGS) tools/hack/gobuild.sh ./out/windows_amd64/ $(HGCTL_BINARIES) - GOPROXY=$(GOPROXY) GOOS=windows GOARCH=arm64 LDFLAGS=$(RELEASE_LDFLAGS) tools/hack/gobuild.sh ./out/windows_arm64/ $(HGCTL_BINARIES) + GOPROXY=$(GOPROXY) GOOS=linux GOARCH=amd64 LDFLAGS=$(RELEASE_LDFLAGS) PROJECT_DIR="$(HGCTL_PROJECT_DIR)" tools/hack/gobuild.sh ./out/linux_amd64/ $(HGCTL_BINARIES) + GOPROXY=$(GOPROXY) GOOS=linux GOARCH=arm64 LDFLAGS=$(RELEASE_LDFLAGS) PROJECT_DIR="$(HGCTL_PROJECT_DIR)" tools/hack/gobuild.sh ./out/linux_arm64/ $(HGCTL_BINARIES) + GOPROXY=$(GOPROXY) GOOS=darwin GOARCH=amd64 LDFLAGS=$(RELEASE_LDFLAGS) PROJECT_DIR="$(HGCTL_PROJECT_DIR)" tools/hack/gobuild.sh ./out/darwin_amd64/ $(HGCTL_BINARIES) + GOPROXY=$(GOPROXY) GOOS=darwin GOARCH=arm64 LDFLAGS=$(RELEASE_LDFLAGS) PROJECT_DIR="$(HGCTL_PROJECT_DIR)" tools/hack/gobuild.sh ./out/darwin_arm64/ $(HGCTL_BINARIES) + GOPROXY=$(GOPROXY) GOOS=windows GOARCH=amd64 LDFLAGS=$(RELEASE_LDFLAGS) PROJECT_DIR="$(HGCTL_PROJECT_DIR)" tools/hack/gobuild.sh ./out/windows_amd64/ $(HGCTL_BINARIES) + GOPROXY=$(GOPROXY) GOOS=windows GOARCH=arm64 LDFLAGS=$(RELEASE_LDFLAGS) PROJECT_DIR="$(HGCTL_PROJECT_DIR)" tools/hack/gobuild.sh ./out/windows_arm64/ $(HGCTL_BINARIES) # Create targets for OUT_LINUX/binary # There are two use cases here: # * Building all docker images (generally in CI). In this case we want to build everything at once, so they share work @@ -128,40 +134,37 @@ docker-build: docker.higress ## Build and push docker images to registry defined docker-buildx-push: clean-env docker.higress-buildx -docker-build-base: - docker buildx build --no-cache --platform linux/amd64,linux/arm64 -t ${HUB}/base:${BASE_VERSION} -f docker/Dockerfile.base . --push - export PARENT_GIT_TAG:=$(shell cat VERSION) export PARENT_GIT_REVISION:=$(TAG) -export ENVOY_TAR_PATH:=/home/package/envoy.tar.gz +export ENVOY_PACKAGE_URL_PATTERN?=https://github.com/higress-group/proxy/releases/download/v2.0.0-rc.1/envoy-symbol-ARCH.tar.gz -external/package/envoy-amd64.tar.gz: -# cd external/proxy; BUILD_WITH_CONTAINER=1 make test_release - cd external/package; wget -O envoy-amd64.tar.gz "https://github.com/alibaba/higress/releases/download/v1.4.1/envoy-symbol-amd64.tar.gz" +build-envoy: prebuild + ./tools/hack/build-envoy.sh -external/package/envoy-arm64.tar.gz: -# cd external/proxy; BUILD_WITH_CONTAINER=1 make test_release - cd external/package; wget -O envoy-arm64.tar.gz "https://github.com/alibaba/higress/releases/download/v1.4.1/envoy-symbol-arm64.tar.gz" +build-pilot: prebuild + TARGET_ARCH=amd64 ./tools/hack/build-istio-pilot.sh + TARGET_ARCH=arm64 ./tools/hack/build-istio-pilot.sh -build-pilot: - cd external/istio; rm -rf out/linux_amd64; GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=amd64 BUILD_WITH_CONTAINER=1 make build-linux - cd external/istio; rm -rf out/linux_arm64; GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=arm64 BUILD_WITH_CONTAINER=1 make build-linux +build-pilot-local: prebuild + TARGET_ARCH=${TARGET_ARCH} ./tools/hack/build-istio-pilot.sh -build-pilot-local: - cd external/istio; rm -rf out/linux_${GOARCH_LOCAL}; GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=${GOARCH_LOCAL} BUILD_WITH_CONTAINER=1 make build-linux +buildx-prepare: + docker buildx inspect multi-arch >/dev/null 2>&1 || docker buildx create --name multi-arch --platform linux/amd64,linux/arm64 --use -build-gateway: prebuild external/package/envoy-amd64.tar.gz external/package/envoy-arm64.tar.gz build-pilot - cd external/istio; BUILD_WITH_CONTAINER=1 BUILDX_PLATFORM=true DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="docker.proxyv2" make docker +build-gateway: prebuild buildx-prepare + USE_REAL_USER=1 TARGET_ARCH=amd64 DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh init + USE_REAL_USER=1 TARGET_ARCH=arm64 DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh init + DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh docker.buildx -build-gateway-local: prebuild external/package/envoy-amd64.tar.gz external/package/envoy-arm64.tar.gz - cd external/istio; rm -rf out/linux_${GOARCH_LOCAL}; GOOS_LOCAL=linux TARGET_OS=linux BUILD_WITH_CONTAINER=1 BUILDX_PLATFORM=false DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="docker.proxyv2" make docker +build-gateway-local: prebuild + TARGET_ARCH=${TARGET_ARCH} DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh docker -build-istio: prebuild build-pilot - cd external/istio; BUILD_WITH_CONTAINER=1 BUILDX_PLATFORM=true DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="docker.pilot" make docker +build-istio: prebuild buildx-prepare + DOCKER_TARGETS="docker.pilot" ./tools/hack/build-istio-image.sh docker.buildx build-istio-local: prebuild - cd external/istio; rm -rf out/linux_${GOARCH_LOCAL}; GOOS_LOCAL=linux TARGET_OS=linux BUILD_WITH_CONTAINER=1 BUILDX_PLATFORM=false DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="docker.pilot" make docker + TARGET_ARCH=${TARGET_ARCH} DOCKER_TARGETS="docker.pilot" ./tools/hack/build-istio-image.sh docker build-wasmplugins: ./tools/hack/build-wasm-plugins.sh @@ -177,8 +180,8 @@ install: pre-install cd helm/higress; helm dependency build helm install higress helm/higress -n higress-system --create-namespace --set 'global.local=true' -ENVOY_LATEST_IMAGE_TAG ?= sha-59acb61 -ISTIO_LATEST_IMAGE_TAG ?= sha-59acb61 +ENVOY_LATEST_IMAGE_TAG ?= 580eb0ffc45b1f62a79744f3ae0e6463bf539931 +ISTIO_LATEST_IMAGE_TAG ?= 580eb0ffc45b1f62a79744f3ae0e6463bf539931 install-dev: pre-install helm install higress helm/core -n higress-system --create-namespace --set 'controller.tag=$(TAG)' --set 'gateway.replicas=1' --set 'pilot.tag=$(ISTIO_LATEST_IMAGE_TAG)' --set 'gateway.tag=$(ENVOY_LATEST_IMAGE_TAG)' --set 'global.local=true' @@ -280,12 +283,24 @@ kube-load-image: $(tools/kind) ## Install the Higress image to a kind cluster us tools/hack/docker-pull-image.sh docker.io/charlie1380/eureka-registry-provider v0.3.0 tools/hack/docker-pull-image.sh docker.io/bitinit/eureka latest tools/hack/docker-pull-image.sh docker.io/alihigress/httpbin 1.0.2 + tools/hack/docker-pull-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/echo-server 1.3.0 + tools/hack/docker-pull-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/echo-server v1.0 + tools/hack/docker-pull-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/echo-body 1.0.0 + tools/hack/docker-pull-image.sh openpolicyagent/opa latest + tools/hack/docker-pull-image.sh registry.cn-hangzhou.aliyuncs.com/2456868764/httpbin 1.0.2 + tools/hack/docker-pull-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/nacos-standlone-rc3 1.0.0-RC3 tools/hack/kind-load-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/dubbo-provider-demo 0.0.3-x86 tools/hack/kind-load-image.sh docker.io/alihigress/nacos-standlone-rc3 1.0.0-RC3 tools/hack/kind-load-image.sh docker.io/hashicorp/consul 1.16.0 tools/hack/kind-load-image.sh docker.io/alihigress/httpbin 1.0.2 tools/hack/kind-load-image.sh docker.io/charlie1380/eureka-registry-provider v0.3.0 tools/hack/kind-load-image.sh docker.io/bitinit/eureka latest + tools/hack/kind-load-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/echo-server 1.3.0 + tools/hack/kind-load-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/echo-server v1.0 + tools/hack/kind-load-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/echo-body 1.0.0 + tools/hack/kind-load-image.sh openpolicyagent/opa latest + tools/hack/kind-load-image.sh registry.cn-hangzhou.aliyuncs.com/2456868764/httpbin 1.0.2 + tools/hack/kind-load-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/nacos-standlone-rc3 1.0.0-RC3 # run-higress-e2e-test-setup starts to setup ingress e2e tests. .PHONT: run-higress-e2e-test-setup diff --git a/Makefile.overrides.mk b/Makefile.overrides.mk index 4261244c6..8099a9ef7 100644 --- a/Makefile.overrides.mk +++ b/Makefile.overrides.mk @@ -25,7 +25,7 @@ GENERATE_API ?= 0 ifeq ($(GENERATE_API),1) BUILD_WITH_CONTAINER = 1 -IMAGE_VERSION=release-1.12-2021-11-12T20-52-48 +IMAGE_VERSION=release-1.19-ef344298e65eeb2d9e2d07b87eb4e715c2def613 endif ifeq ($(BUILD_WITH_CONTAINER),1) diff --git a/VERSION b/VERSION index c432e90f2..3448eb6eb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.4.2 +v2.0.0-rc.1 diff --git a/api/buf.gen.yaml b/api/buf.gen.yaml index 9c292f310..2ae6ade35 100644 --- a/api/buf.gen.yaml +++ b/api/buf.gen.yaml @@ -1,11 +1,17 @@ -version: v1beta1 +# buf.gen.yaml sets up the generation configuration for all of our plugins. +# Note: buf does not allow multi roots that are within each other; as a result, the common-protos folders are +# symlinked into the top level directory. +version: v1 plugins: -- name: gogofast +- name: go out: . - opt: plugins=grpc,paths=source_relative,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/rpc/status.proto=istio.io/gogo-genproto/googleapis/google/rpc,Mgoogle/rpc/code.proto=istio.io/gogo-genproto/googleapis/google/rpc,Mgoogle/rpc/error_details.proto=istio.io/gogo-genproto/googleapis/google/rpc,Mgoogle/api/field_behavior.proto=istio.io/gogo-genproto/googleapis/google/api -- name: deepcopy + opt: paths=source_relative +- name: go-grpc out: . - opt: paths=source_relative,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/rpc/status.proto=istio.io/gogo-genproto/googleapis/google/rpc,Mgoogle/rpc/code.proto=istio.io/gogo-genproto/googleapis/google/rpc,Mgoogle/rpc/error_details.proto=istio.io/gogo-genproto/googleapis/google/rpc,Mgoogle/api/field_behavior.proto=istio.io/gogo-genproto/googleapis/google/api -- name: jsonshim + opt: paths=source_relative +- name: golang-deepcopy out: . - opt: paths=source_relative,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/rpc/status.proto=istio.io/gogo-genproto/googleapis/google/rpc,Mgoogle/rpc/code.proto=istio.io/gogo-genproto/googleapis/google/rpc,Mgoogle/rpc/error_details.proto=istio.io/gogo-genproto/googleapis/google/rpc,Mgoogle/api/field_behavior.proto=istio.io/gogo-genproto/googleapis/google/api + opt: paths=source_relative +- name: golang-jsonshim + out: . + opt: paths=source_relative diff --git a/api/extensions/v1alpha1/wasm.pb.go b/api/extensions/v1alpha1/wasm.pb.go index a4ac35795..3865a8cfa 100644 --- a/api/extensions/v1alpha1/wasm.pb.go +++ b/api/extensions/v1alpha1/wasm.pb.go @@ -1,27 +1,45 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright Istio Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// Modified by Higress Authors + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) // source: extensions/v1alpha1/wasm.proto +// $schema: higress.extensions.v1alpha1.WasmPlugin +// $title: WasmPlugin +// $description: Extend the functionality provided by the envoy through WebAssembly filters. + package v1alpha1 import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - types "github.com/gogo/protobuf/types" - io "io" - math "math" - math_bits "math/bits" + _struct "github.com/golang/protobuf/ptypes/struct" + wrappers "github.com/golang/protobuf/ptypes/wrappers" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // The phase in the filter chain where the plugin will be injected. type PluginPhase int32 @@ -39,26 +57,47 @@ const ( PluginPhase_STATS PluginPhase = 3 ) -var PluginPhase_name = map[int32]string{ - 0: "UNSPECIFIED_PHASE", - 1: "AUTHN", - 2: "AUTHZ", - 3: "STATS", -} +// Enum value maps for PluginPhase. +var ( + PluginPhase_name = map[int32]string{ + 0: "UNSPECIFIED_PHASE", + 1: "AUTHN", + 2: "AUTHZ", + 3: "STATS", + } + PluginPhase_value = map[string]int32{ + "UNSPECIFIED_PHASE": 0, + "AUTHN": 1, + "AUTHZ": 2, + "STATS": 3, + } +) -var PluginPhase_value = map[string]int32{ - "UNSPECIFIED_PHASE": 0, - "AUTHN": 1, - "AUTHZ": 2, - "STATS": 3, +func (x PluginPhase) Enum() *PluginPhase { + p := new(PluginPhase) + *p = x + return p } func (x PluginPhase) String() string { - return proto.EnumName(PluginPhase_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (PluginPhase) Descriptor() protoreflect.EnumDescriptor { + return file_extensions_v1alpha1_wasm_proto_enumTypes[0].Descriptor() +} + +func (PluginPhase) Type() protoreflect.EnumType { + return &file_extensions_v1alpha1_wasm_proto_enumTypes[0] +} + +func (x PluginPhase) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PluginPhase.Descriptor instead. func (PluginPhase) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_4d60b240916c4e18, []int{0} + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{0} } // The pull behaviour to be applied when fetching an OCI image, @@ -82,24 +121,145 @@ const ( PullPolicy_Always PullPolicy = 2 ) -var PullPolicy_name = map[int32]string{ - 0: "UNSPECIFIED_POLICY", - 1: "IfNotPresent", - 2: "Always", -} +// Enum value maps for PullPolicy. +var ( + PullPolicy_name = map[int32]string{ + 0: "UNSPECIFIED_POLICY", + 1: "IfNotPresent", + 2: "Always", + } + PullPolicy_value = map[string]int32{ + "UNSPECIFIED_POLICY": 0, + "IfNotPresent": 1, + "Always": 2, + } +) -var PullPolicy_value = map[string]int32{ - "UNSPECIFIED_POLICY": 0, - "IfNotPresent": 1, - "Always": 2, +func (x PullPolicy) Enum() *PullPolicy { + p := new(PullPolicy) + *p = x + return p } func (x PullPolicy) String() string { - return proto.EnumName(PullPolicy_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (PullPolicy) Descriptor() protoreflect.EnumDescriptor { + return file_extensions_v1alpha1_wasm_proto_enumTypes[1].Descriptor() +} + +func (PullPolicy) Type() protoreflect.EnumType { + return &file_extensions_v1alpha1_wasm_proto_enumTypes[1] +} + +func (x PullPolicy) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PullPolicy.Descriptor instead. func (PullPolicy) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_4d60b240916c4e18, []int{1} + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{1} +} + +type EnvValueSource int32 + +const ( + // Explicitly given key-value pairs to be injected to this VM + EnvValueSource_INLINE EnvValueSource = 0 + // *Istio-proxy's* environment variables exposed to this VM. + EnvValueSource_HOST EnvValueSource = 1 +) + +// Enum value maps for EnvValueSource. +var ( + EnvValueSource_name = map[int32]string{ + 0: "INLINE", + 1: "HOST", + } + EnvValueSource_value = map[string]int32{ + "INLINE": 0, + "HOST": 1, + } +) + +func (x EnvValueSource) Enum() *EnvValueSource { + p := new(EnvValueSource) + *p = x + return p +} + +func (x EnvValueSource) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EnvValueSource) Descriptor() protoreflect.EnumDescriptor { + return file_extensions_v1alpha1_wasm_proto_enumTypes[2].Descriptor() +} + +func (EnvValueSource) Type() protoreflect.EnumType { + return &file_extensions_v1alpha1_wasm_proto_enumTypes[2] +} + +func (x EnvValueSource) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EnvValueSource.Descriptor instead. +func (EnvValueSource) EnumDescriptor() ([]byte, []int) { + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{2} +} + +type FailStrategy int32 + +const ( + // A fatal error in the binary fetching or during the plugin execution causes + // all subsequent requests to fail with 5xx. + FailStrategy_FAIL_CLOSE FailStrategy = 0 + // Enables the fail open behavior for the Wasm plugin fatal errors to bypass + // the plugin execution. A fatal error can be a failure to fetch the remote + // binary, an exception, or abort() on the VM. This flag is not recommended + // for the authentication or the authorization plugins. + FailStrategy_FAIL_OPEN FailStrategy = 1 +) + +// Enum value maps for FailStrategy. +var ( + FailStrategy_name = map[int32]string{ + 0: "FAIL_CLOSE", + 1: "FAIL_OPEN", + } + FailStrategy_value = map[string]int32{ + "FAIL_CLOSE": 0, + "FAIL_OPEN": 1, + } +) + +func (x FailStrategy) Enum() *FailStrategy { + p := new(FailStrategy) + *p = x + return p +} + +func (x FailStrategy) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FailStrategy) Descriptor() protoreflect.EnumDescriptor { + return file_extensions_v1alpha1_wasm_proto_enumTypes[3].Descriptor() +} + +func (FailStrategy) Type() protoreflect.EnumType { + return &file_extensions_v1alpha1_wasm_proto_enumTypes[3] +} + +func (x FailStrategy) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FailStrategy.Descriptor instead. +func (FailStrategy) EnumDescriptor() ([]byte, []int) { + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{3} } // type WasmPlugin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // URL of a Wasm module or OCI container. If no scheme is present, // defaults to `oci://`, referencing an OCI image. Other valid schemes // are `file://` for referencing .wasm module files present locally @@ -153,7 +317,7 @@ type WasmPlugin struct { // or Wasm modules. Must be supplied in PEM format. VerificationKey string `protobuf:"bytes,6,opt,name=verification_key,json=verificationKey,proto3" json:"verification_key,omitempty"` // The configuration that will be passed on to the plugin. - PluginConfig *types.Struct `protobuf:"bytes,7,opt,name=plugin_config,json=pluginConfig,proto3" json:"plugin_config,omitempty"` + PluginConfig *_struct.Struct `protobuf:"bytes,7,opt,name=plugin_config,json=pluginConfig,proto3" json:"plugin_config,omitempty"` // The plugin name to be used in the Envoy configuration (used to be called // `rootID`). Some .wasm modules might require this value to select the Wasm // plugin to execute. @@ -166,1290 +330,571 @@ type WasmPlugin struct { // If `priority` is not set, or two `WasmPlugins` exist with the same // value, the ordering will be deterministically derived from name and // namespace of the `WasmPlugins`. Defaults to `0`. - Priority *types.Int32Value `protobuf:"bytes,10,opt,name=priority,proto3" json:"priority,omitempty"` + Priority *wrappers.Int32Value `protobuf:"bytes,10,opt,name=priority,proto3" json:"priority,omitempty"` + // Specifies the failure behavior for the plugin due to fatal errors. + FailStrategy FailStrategy `protobuf:"varint,13,opt,name=fail_strategy,json=failStrategy,proto3,enum=higress.extensions.v1alpha1.FailStrategy" json:"fail_strategy,omitempty"` + // Configuration for a Wasm VM. + // more details can be found [here](https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/wasm/v3/wasm.proto#extensions-wasm-v3-vmconfig). + VmConfig *VmConfig `protobuf:"bytes,11,opt,name=vm_config,json=vmConfig,proto3" json:"vm_config,omitempty"` // Extended by Higress, the default configuration takes effect globally - DefaultConfig *types.Struct `protobuf:"bytes,101,opt,name=default_config,json=defaultConfig,proto3" json:"default_config,omitempty"` + DefaultConfig *_struct.Struct `protobuf:"bytes,101,opt,name=default_config,json=defaultConfig,proto3" json:"default_config,omitempty"` // Extended by Higress, matching rules take effect MatchRules []*MatchRule `protobuf:"bytes,102,rep,name=match_rules,json=matchRules,proto3" json:"match_rules,omitempty"` // disable the default config - DefaultConfigDisable bool `protobuf:"varint,103,opt,name=default_config_disable,json=defaultConfigDisable,proto3" json:"default_config_disable,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + DefaultConfigDisable bool `protobuf:"varint,103,opt,name=default_config_disable,json=defaultConfigDisable,proto3" json:"default_config_disable,omitempty"` } -func (m *WasmPlugin) Reset() { *m = WasmPlugin{} } -func (m *WasmPlugin) String() string { return proto.CompactTextString(m) } -func (*WasmPlugin) ProtoMessage() {} -func (*WasmPlugin) Descriptor() ([]byte, []int) { - return fileDescriptor_4d60b240916c4e18, []int{0} +func (x *WasmPlugin) Reset() { + *x = WasmPlugin{} + if protoimpl.UnsafeEnabled { + mi := &file_extensions_v1alpha1_wasm_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *WasmPlugin) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *WasmPlugin) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *WasmPlugin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WasmPlugin.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*WasmPlugin) ProtoMessage() {} + +func (x *WasmPlugin) ProtoReflect() protoreflect.Message { + mi := &file_extensions_v1alpha1_wasm_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *WasmPlugin) XXX_Merge(src proto.Message) { - xxx_messageInfo_WasmPlugin.Merge(m, src) -} -func (m *WasmPlugin) XXX_Size() int { - return m.Size() -} -func (m *WasmPlugin) XXX_DiscardUnknown() { - xxx_messageInfo_WasmPlugin.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_WasmPlugin proto.InternalMessageInfo +// Deprecated: Use WasmPlugin.ProtoReflect.Descriptor instead. +func (*WasmPlugin) Descriptor() ([]byte, []int) { + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{0} +} -func (m *WasmPlugin) GetUrl() string { - if m != nil { - return m.Url +func (x *WasmPlugin) GetUrl() string { + if x != nil { + return x.Url } return "" } -func (m *WasmPlugin) GetSha256() string { - if m != nil { - return m.Sha256 +func (x *WasmPlugin) GetSha256() string { + if x != nil { + return x.Sha256 } return "" } -func (m *WasmPlugin) GetImagePullPolicy() PullPolicy { - if m != nil { - return m.ImagePullPolicy +func (x *WasmPlugin) GetImagePullPolicy() PullPolicy { + if x != nil { + return x.ImagePullPolicy } return PullPolicy_UNSPECIFIED_POLICY } -func (m *WasmPlugin) GetImagePullSecret() string { - if m != nil { - return m.ImagePullSecret +func (x *WasmPlugin) GetImagePullSecret() string { + if x != nil { + return x.ImagePullSecret } return "" } -func (m *WasmPlugin) GetVerificationKey() string { - if m != nil { - return m.VerificationKey +func (x *WasmPlugin) GetVerificationKey() string { + if x != nil { + return x.VerificationKey } return "" } -func (m *WasmPlugin) GetPluginConfig() *types.Struct { - if m != nil { - return m.PluginConfig +func (x *WasmPlugin) GetPluginConfig() *_struct.Struct { + if x != nil { + return x.PluginConfig } return nil } -func (m *WasmPlugin) GetPluginName() string { - if m != nil { - return m.PluginName +func (x *WasmPlugin) GetPluginName() string { + if x != nil { + return x.PluginName } return "" } -func (m *WasmPlugin) GetPhase() PluginPhase { - if m != nil { - return m.Phase +func (x *WasmPlugin) GetPhase() PluginPhase { + if x != nil { + return x.Phase } return PluginPhase_UNSPECIFIED_PHASE } -func (m *WasmPlugin) GetPriority() *types.Int32Value { - if m != nil { - return m.Priority +func (x *WasmPlugin) GetPriority() *wrappers.Int32Value { + if x != nil { + return x.Priority } return nil } -func (m *WasmPlugin) GetDefaultConfig() *types.Struct { - if m != nil { - return m.DefaultConfig +func (x *WasmPlugin) GetFailStrategy() FailStrategy { + if x != nil { + return x.FailStrategy + } + return FailStrategy_FAIL_CLOSE +} + +func (x *WasmPlugin) GetVmConfig() *VmConfig { + if x != nil { + return x.VmConfig } return nil } -func (m *WasmPlugin) GetMatchRules() []*MatchRule { - if m != nil { - return m.MatchRules +func (x *WasmPlugin) GetDefaultConfig() *_struct.Struct { + if x != nil { + return x.DefaultConfig } return nil } -func (m *WasmPlugin) GetDefaultConfigDisable() bool { - if m != nil { - return m.DefaultConfigDisable +func (x *WasmPlugin) GetMatchRules() []*MatchRule { + if x != nil { + return x.MatchRules + } + return nil +} + +func (x *WasmPlugin) GetDefaultConfigDisable() bool { + if x != nil { + return x.DefaultConfigDisable } return false } // Extended by Higress type MatchRule struct { - Ingress []string `protobuf:"bytes,1,rep,name=ingress,proto3" json:"ingress,omitempty"` - Domain []string `protobuf:"bytes,2,rep,name=domain,proto3" json:"domain,omitempty"` - Config *types.Struct `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` - ConfigDisable bool `protobuf:"varint,4,opt,name=config_disable,json=configDisable,proto3" json:"config_disable,omitempty"` - Service []string `protobuf:"bytes,5,rep,name=service,proto3" json:"service,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ingress []string `protobuf:"bytes,1,rep,name=ingress,proto3" json:"ingress,omitempty"` + Domain []string `protobuf:"bytes,2,rep,name=domain,proto3" json:"domain,omitempty"` + Config *_struct.Struct `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` + ConfigDisable bool `protobuf:"varint,4,opt,name=config_disable,json=configDisable,proto3" json:"config_disable,omitempty"` + Service []string `protobuf:"bytes,5,rep,name=service,proto3" json:"service,omitempty"` } -func (m *MatchRule) Reset() { *m = MatchRule{} } -func (m *MatchRule) String() string { return proto.CompactTextString(m) } -func (*MatchRule) ProtoMessage() {} -func (*MatchRule) Descriptor() ([]byte, []int) { - return fileDescriptor_4d60b240916c4e18, []int{1} +func (x *MatchRule) Reset() { + *x = MatchRule{} + if protoimpl.UnsafeEnabled { + mi := &file_extensions_v1alpha1_wasm_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *MatchRule) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *MatchRule) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MatchRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MatchRule.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*MatchRule) ProtoMessage() {} + +func (x *MatchRule) ProtoReflect() protoreflect.Message { + mi := &file_extensions_v1alpha1_wasm_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *MatchRule) XXX_Merge(src proto.Message) { - xxx_messageInfo_MatchRule.Merge(m, src) -} -func (m *MatchRule) XXX_Size() int { - return m.Size() -} -func (m *MatchRule) XXX_DiscardUnknown() { - xxx_messageInfo_MatchRule.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_MatchRule proto.InternalMessageInfo +// Deprecated: Use MatchRule.ProtoReflect.Descriptor instead. +func (*MatchRule) Descriptor() ([]byte, []int) { + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{1} +} -func (m *MatchRule) GetIngress() []string { - if m != nil { - return m.Ingress +func (x *MatchRule) GetIngress() []string { + if x != nil { + return x.Ingress } return nil } -func (m *MatchRule) GetDomain() []string { - if m != nil { - return m.Domain +func (x *MatchRule) GetDomain() []string { + if x != nil { + return x.Domain } return nil } -func (m *MatchRule) GetConfig() *types.Struct { - if m != nil { - return m.Config +func (x *MatchRule) GetConfig() *_struct.Struct { + if x != nil { + return x.Config } return nil } -func (m *MatchRule) GetConfigDisable() bool { - if m != nil { - return m.ConfigDisable +func (x *MatchRule) GetConfigDisable() bool { + if x != nil { + return x.ConfigDisable } return false } -func (m *MatchRule) GetService() []string { - if m != nil { - return m.Service +func (x *MatchRule) GetService() []string { + if x != nil { + return x.Service } return nil } -func init() { - proto.RegisterEnum("higress.extensions.v1alpha1.PluginPhase", PluginPhase_name, PluginPhase_value) - proto.RegisterEnum("higress.extensions.v1alpha1.PullPolicy", PullPolicy_name, PullPolicy_value) - proto.RegisterType((*WasmPlugin)(nil), "higress.extensions.v1alpha1.WasmPlugin") - proto.RegisterType((*MatchRule)(nil), "higress.extensions.v1alpha1.MatchRule") +// Configuration for a Wasm VM. +// more details can be found [here](https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/wasm/v3/wasm.proto#extensions-wasm-v3-vmconfig). +type VmConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Specifies environment variables to be injected to this VM. + // Note that if a key does not exist, it will be ignored. + Env []*EnvVar `protobuf:"bytes,1,rep,name=env,proto3" json:"env,omitempty"` } -func init() { proto.RegisterFile("extensions/v1alpha1/wasm.proto", fileDescriptor_4d60b240916c4e18) } - -var fileDescriptor_4d60b240916c4e18 = []byte{ - // 631 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0xdd, 0x6e, 0xd3, 0x4c, - 0x10, 0x86, 0xeb, 0xa4, 0x49, 0x9b, 0x49, 0xdb, 0xcf, 0x5d, 0x7d, 0x94, 0x55, 0x8b, 0x42, 0x54, - 0x09, 0x30, 0x3d, 0xb0, 0xd5, 0x94, 0x9f, 0x13, 0x54, 0x91, 0xb6, 0x81, 0x46, 0x40, 0xb0, 0xec, - 0x16, 0x44, 0x4f, 0xac, 0x8d, 0xbb, 0x71, 0x56, 0xac, 0x7f, 0xe4, 0x5d, 0xb7, 0xe4, 0xaa, 0xb8, - 0x0d, 0x0e, 0xb9, 0x04, 0xd4, 0xbb, 0xe0, 0x0c, 0x65, 0xed, 0x34, 0x49, 0x41, 0x39, 0xdb, 0x9d, - 0x79, 0x66, 0xe6, 0x7d, 0xc7, 0x2b, 0x43, 0x83, 0x7e, 0x93, 0x34, 0x12, 0x2c, 0x8e, 0x84, 0x75, - 0xb5, 0x4f, 0x78, 0x32, 0x24, 0xfb, 0xd6, 0x35, 0x11, 0xa1, 0x99, 0xa4, 0xb1, 0x8c, 0xd1, 0xce, - 0x90, 0x05, 0x29, 0x15, 0xc2, 0x9c, 0x72, 0xe6, 0x84, 0xdb, 0x6e, 0x04, 0x71, 0x1c, 0x70, 0x6a, - 0x29, 0xb4, 0x9f, 0x0d, 0xac, 0xeb, 0x94, 0x24, 0x09, 0x4d, 0x45, 0x5e, 0xbc, 0xfd, 0xe0, 0x6e, - 0x5e, 0xc8, 0x34, 0xf3, 0x65, 0x9e, 0xdd, 0xfd, 0xbd, 0x0c, 0xf0, 0x99, 0x88, 0xd0, 0xe6, 0x59, - 0xc0, 0x22, 0xa4, 0x43, 0x39, 0x4b, 0x39, 0x2e, 0x35, 0x35, 0xa3, 0xe6, 0x8c, 0x8f, 0x68, 0x0b, - 0xaa, 0x62, 0x48, 0x5a, 0xcf, 0x5f, 0xe0, 0xb2, 0x0a, 0x16, 0x37, 0xe4, 0xc2, 0x26, 0x0b, 0x49, - 0x40, 0xbd, 0x24, 0xe3, 0xdc, 0x4b, 0x62, 0xce, 0xfc, 0x11, 0x5e, 0x6e, 0x6a, 0xc6, 0x46, 0xeb, - 0x89, 0xb9, 0x40, 0xaf, 0x69, 0x67, 0x9c, 0xdb, 0x0a, 0x77, 0xfe, 0x53, 0x1d, 0xa6, 0x01, 0xb4, - 0x37, 0xd7, 0x54, 0x50, 0x3f, 0xa5, 0x12, 0x57, 0xd4, 0xdc, 0x29, 0xeb, 0xaa, 0x30, 0x7a, 0x0a, - 0xfa, 0x15, 0x4d, 0xd9, 0x80, 0xf9, 0x44, 0xb2, 0x38, 0xf2, 0xbe, 0xd2, 0x11, 0xae, 0xe6, 0xe8, - 0x6c, 0xfc, 0x1d, 0x1d, 0xa1, 0x57, 0xb0, 0x9e, 0x28, 0x7f, 0x9e, 0x1f, 0x47, 0x03, 0x16, 0xe0, - 0x95, 0xa6, 0x66, 0xd4, 0x5b, 0xf7, 0xcd, 0x7c, 0x35, 0xe6, 0x64, 0x35, 0xa6, 0xab, 0x56, 0xe3, - 0xac, 0xe5, 0xf4, 0xb1, 0x82, 0xd1, 0x43, 0xa8, 0x17, 0xd5, 0x11, 0x09, 0x29, 0x5e, 0x55, 0x33, - 0x20, 0x0f, 0xf5, 0x48, 0x48, 0xd1, 0x21, 0x54, 0x92, 0x21, 0x11, 0x14, 0xd7, 0x94, 0x7d, 0x63, - 0xb1, 0x7d, 0x55, 0x67, 0x8f, 0x79, 0x27, 0x2f, 0x43, 0x2f, 0x61, 0x35, 0x49, 0x59, 0x9c, 0x32, - 0x39, 0xc2, 0xa0, 0x94, 0xed, 0xfc, 0xa5, 0xac, 0x1b, 0xc9, 0x83, 0xd6, 0x27, 0xc2, 0x33, 0xea, - 0xdc, 0xc2, 0xe8, 0x10, 0x36, 0x2e, 0xe9, 0x80, 0x64, 0x5c, 0x4e, 0x8c, 0xd1, 0xc5, 0xc6, 0xd6, - 0x0b, 0xbc, 0x70, 0xf6, 0x16, 0xea, 0x21, 0x91, 0xfe, 0xd0, 0x4b, 0x33, 0x4e, 0x05, 0x1e, 0x34, - 0xcb, 0x46, 0xbd, 0xf5, 0x78, 0xa1, 0xfc, 0x0f, 0x63, 0xde, 0xc9, 0x38, 0x75, 0x20, 0x9c, 0x1c, - 0x05, 0x7a, 0x06, 0x5b, 0xf3, 0x42, 0xbc, 0x4b, 0x26, 0x48, 0x9f, 0x53, 0x1c, 0x34, 0x35, 0x63, - 0xd5, 0xf9, 0x7f, 0x6e, 0xee, 0x49, 0x9e, 0xdb, 0xfd, 0xae, 0x41, 0xed, 0xb6, 0x1f, 0xc2, 0xb0, - 0xc2, 0x22, 0x35, 0x18, 0x6b, 0xcd, 0xb2, 0x51, 0x73, 0x26, 0xd7, 0xf1, 0x13, 0xbc, 0x8c, 0x43, - 0xc2, 0x22, 0x5c, 0x52, 0x89, 0xe2, 0x86, 0x2c, 0xa8, 0x16, 0xb6, 0xcb, 0x8b, 0x6d, 0x17, 0x18, - 0x7a, 0x04, 0x1b, 0x77, 0xe4, 0x2d, 0x2b, 0x79, 0xeb, 0xfe, 0xac, 0xae, 0xb1, 0x12, 0x41, 0xd3, - 0x2b, 0xe6, 0x53, 0x5c, 0xc9, 0x95, 0x14, 0xd7, 0xbd, 0x0e, 0xd4, 0x67, 0xbe, 0x1f, 0xba, 0x07, - 0x9b, 0xe7, 0x3d, 0xd7, 0xee, 0x1c, 0x77, 0xdf, 0x74, 0x3b, 0x27, 0x9e, 0x7d, 0xda, 0x76, 0x3b, - 0xfa, 0x12, 0xaa, 0x41, 0xa5, 0x7d, 0x7e, 0x76, 0xda, 0xd3, 0xb5, 0xc9, 0xf1, 0x42, 0x2f, 0x8d, - 0x8f, 0xee, 0x59, 0xfb, 0xcc, 0xd5, 0xcb, 0x7b, 0x47, 0x00, 0x33, 0x8f, 0x7e, 0x0b, 0xd0, 0x5c, - 0x97, 0x8f, 0xef, 0xbb, 0xc7, 0x5f, 0xf4, 0x25, 0xa4, 0xc3, 0x5a, 0x77, 0xd0, 0x8b, 0xa5, 0x9d, - 0x52, 0x41, 0x23, 0xa9, 0x6b, 0x08, 0xa0, 0xda, 0xe6, 0xd7, 0x64, 0x24, 0xf4, 0xd2, 0xd1, 0xeb, - 0x1f, 0x37, 0x0d, 0xed, 0xe7, 0x4d, 0x43, 0xfb, 0x75, 0xd3, 0xd0, 0x2e, 0x5a, 0x01, 0x93, 0xc3, - 0xac, 0x6f, 0xfa, 0x71, 0x68, 0x11, 0xce, 0xfa, 0xa4, 0x4f, 0xac, 0xe2, 0x33, 0x5a, 0x24, 0x61, - 0xd6, 0x3f, 0x7e, 0x30, 0xfd, 0xaa, 0x5a, 0xd3, 0xc1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0b, - 0x3c, 0xc3, 0xcf, 0x7e, 0x04, 0x00, 0x00, +func (x *VmConfig) Reset() { + *x = VmConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_extensions_v1alpha1_wasm_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *WasmPlugin) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *VmConfig) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *WasmPlugin) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (*VmConfig) ProtoMessage() {} + +func (x *VmConfig) ProtoReflect() protoreflect.Message { + mi := &file_extensions_v1alpha1_wasm_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *WasmPlugin) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.DefaultConfigDisable { - i-- - if m.DefaultConfigDisable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x6 - i-- - dAtA[i] = 0xb8 - } - if len(m.MatchRules) > 0 { - for iNdEx := len(m.MatchRules) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.MatchRules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWasm(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6 - i-- - dAtA[i] = 0xb2 - } - } - if m.DefaultConfig != nil { - { - size, err := m.DefaultConfig.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWasm(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6 - i-- - dAtA[i] = 0xaa - } - if m.Priority != nil { - { - size, err := m.Priority.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWasm(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - if m.Phase != 0 { - i = encodeVarintWasm(dAtA, i, uint64(m.Phase)) - i-- - dAtA[i] = 0x48 - } - if len(m.PluginName) > 0 { - i -= len(m.PluginName) - copy(dAtA[i:], m.PluginName) - i = encodeVarintWasm(dAtA, i, uint64(len(m.PluginName))) - i-- - dAtA[i] = 0x42 - } - if m.PluginConfig != nil { - { - size, err := m.PluginConfig.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWasm(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if len(m.VerificationKey) > 0 { - i -= len(m.VerificationKey) - copy(dAtA[i:], m.VerificationKey) - i = encodeVarintWasm(dAtA, i, uint64(len(m.VerificationKey))) - i-- - dAtA[i] = 0x32 - } - if len(m.ImagePullSecret) > 0 { - i -= len(m.ImagePullSecret) - copy(dAtA[i:], m.ImagePullSecret) - i = encodeVarintWasm(dAtA, i, uint64(len(m.ImagePullSecret))) - i-- - dAtA[i] = 0x2a - } - if m.ImagePullPolicy != 0 { - i = encodeVarintWasm(dAtA, i, uint64(m.ImagePullPolicy)) - i-- - dAtA[i] = 0x20 - } - if len(m.Sha256) > 0 { - i -= len(m.Sha256) - copy(dAtA[i:], m.Sha256) - i = encodeVarintWasm(dAtA, i, uint64(len(m.Sha256))) - i-- - dAtA[i] = 0x1a - } - if len(m.Url) > 0 { - i -= len(m.Url) - copy(dAtA[i:], m.Url) - i = encodeVarintWasm(dAtA, i, uint64(len(m.Url))) - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil +// Deprecated: Use VmConfig.ProtoReflect.Descriptor instead. +func (*VmConfig) Descriptor() ([]byte, []int) { + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{2} } -func (m *MatchRule) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MatchRule) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MatchRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Service) > 0 { - for iNdEx := len(m.Service) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Service[iNdEx]) - copy(dAtA[i:], m.Service[iNdEx]) - i = encodeVarintWasm(dAtA, i, uint64(len(m.Service[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if m.ConfigDisable { - i-- - if m.ConfigDisable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Config != nil { - { - size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWasm(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Domain) > 0 { - for iNdEx := len(m.Domain) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Domain[iNdEx]) - copy(dAtA[i:], m.Domain[iNdEx]) - i = encodeVarintWasm(dAtA, i, uint64(len(m.Domain[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Ingress) > 0 { - for iNdEx := len(m.Ingress) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Ingress[iNdEx]) - copy(dAtA[i:], m.Ingress[iNdEx]) - i = encodeVarintWasm(dAtA, i, uint64(len(m.Ingress[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintWasm(dAtA []byte, offset int, v uint64) int { - offset -= sovWasm(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *WasmPlugin) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Url) - if l > 0 { - n += 1 + l + sovWasm(uint64(l)) - } - l = len(m.Sha256) - if l > 0 { - n += 1 + l + sovWasm(uint64(l)) - } - if m.ImagePullPolicy != 0 { - n += 1 + sovWasm(uint64(m.ImagePullPolicy)) - } - l = len(m.ImagePullSecret) - if l > 0 { - n += 1 + l + sovWasm(uint64(l)) - } - l = len(m.VerificationKey) - if l > 0 { - n += 1 + l + sovWasm(uint64(l)) - } - if m.PluginConfig != nil { - l = m.PluginConfig.Size() - n += 1 + l + sovWasm(uint64(l)) - } - l = len(m.PluginName) - if l > 0 { - n += 1 + l + sovWasm(uint64(l)) - } - if m.Phase != 0 { - n += 1 + sovWasm(uint64(m.Phase)) - } - if m.Priority != nil { - l = m.Priority.Size() - n += 1 + l + sovWasm(uint64(l)) - } - if m.DefaultConfig != nil { - l = m.DefaultConfig.Size() - n += 2 + l + sovWasm(uint64(l)) - } - if len(m.MatchRules) > 0 { - for _, e := range m.MatchRules { - l = e.Size() - n += 2 + l + sovWasm(uint64(l)) - } - } - if m.DefaultConfigDisable { - n += 3 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MatchRule) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Ingress) > 0 { - for _, s := range m.Ingress { - l = len(s) - n += 1 + l + sovWasm(uint64(l)) - } - } - if len(m.Domain) > 0 { - for _, s := range m.Domain { - l = len(s) - n += 1 + l + sovWasm(uint64(l)) - } - } - if m.Config != nil { - l = m.Config.Size() - n += 1 + l + sovWasm(uint64(l)) - } - if m.ConfigDisable { - n += 2 - } - if len(m.Service) > 0 { - for _, s := range m.Service { - l = len(s) - n += 1 + l + sovWasm(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovWasm(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozWasm(x uint64) (n int) { - return sovWasm(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *WasmPlugin) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WasmPlugin: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WasmPlugin: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Url = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sha256", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sha256 = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ImagePullPolicy", wireType) - } - m.ImagePullPolicy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ImagePullPolicy |= PullPolicy(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImagePullSecret", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImagePullSecret = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VerificationKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VerificationKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PluginConfig", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PluginConfig == nil { - m.PluginConfig = &types.Struct{} - } - if err := m.PluginConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PluginName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PluginName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Phase", wireType) - } - m.Phase = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Phase |= PluginPhase(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Priority == nil { - m.Priority = &types.Int32Value{} - } - if err := m.Priority.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 101: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultConfig", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DefaultConfig == nil { - m.DefaultConfig = &types.Struct{} - } - if err := m.DefaultConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 102: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MatchRules", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MatchRules = append(m.MatchRules, &MatchRule{}) - if err := m.MatchRules[len(m.MatchRules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 103: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultConfigDisable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.DefaultConfigDisable = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipWasm(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWasm - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *VmConfig) GetEnv() []*EnvVar { + if x != nil { + return x.Env } return nil } -func (m *MatchRule) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MatchRule: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MatchRule: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ingress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ingress = append(m.Ingress, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = append(m.Domain, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Config == nil { - m.Config = &types.Struct{} - } - if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ConfigDisable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ConfigDisable = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWasm - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWasm - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWasm - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Service = append(m.Service, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWasm(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWasm - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +type EnvVar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required + // Name of the environment variable. Must be a C_IDENTIFIER. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Required + // Source for the environment variable's value. + ValueFrom EnvValueSource `protobuf:"varint,3,opt,name=value_from,json=valueFrom,proto3,enum=higress.extensions.v1alpha1.EnvValueSource" json:"value_from,omitempty"` + // Value for the environment variable. + // Note that if `value_from` is `HOST`, it will be ignored. + // Defaults to "". + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func skipWasm(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWasm - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWasm - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWasm - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthWasm - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupWasm - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthWasm - } - if depth == 0 { - return iNdEx, nil - } + +func (x *EnvVar) Reset() { + *x = EnvVar{} + if protoimpl.UnsafeEnabled { + mi := &file_extensions_v1alpha1_wasm_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return 0, io.ErrUnexpectedEOF +} + +func (x *EnvVar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnvVar) ProtoMessage() {} + +func (x *EnvVar) ProtoReflect() protoreflect.Message { + mi := &file_extensions_v1alpha1_wasm_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnvVar.ProtoReflect.Descriptor instead. +func (*EnvVar) Descriptor() ([]byte, []int) { + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{3} +} + +func (x *EnvVar) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *EnvVar) GetValueFrom() EnvValueSource { + if x != nil { + return x.ValueFrom + } + return EnvValueSource_INLINE +} + +func (x *EnvVar) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_extensions_v1alpha1_wasm_proto protoreflect.FileDescriptor + +var file_extensions_v1alpha1_wasm_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x77, 0x61, 0x73, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x1b, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, + 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x06, 0x0a, 0x0a, + 0x57, 0x61, 0x73, 0x6d, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x68, + 0x61, 0x32, 0x35, 0x36, 0x12, 0x53, 0x0a, 0x11, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x75, + 0x6c, 0x6c, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x27, 0x2e, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x75, + 0x6c, 0x6c, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x50, + 0x75, 0x6c, 0x6c, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x2a, 0x0a, 0x11, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x5f, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x50, 0x75, 0x6c, 0x6c, 0x53, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, + 0x12, 0x3c, 0x0a, 0x0d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x52, 0x0c, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, + 0x0a, 0x0b, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x3e, 0x0a, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, + 0x2e, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x50, 0x68, 0x61, 0x73, 0x65, 0x52, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x12, + 0x37, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, + 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x4e, 0x0a, 0x0d, 0x66, 0x61, 0x69, 0x6c, + 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x29, 0x2e, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x61, + 0x69, 0x6c, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x0c, 0x66, 0x61, 0x69, 0x6c, + 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x42, 0x0a, 0x09, 0x76, 0x6d, 0x5f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x68, 0x69, + 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x6d, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x08, 0x76, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3e, 0x0a, 0x0e, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x65, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0d, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x47, 0x0a, 0x0b, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x66, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x18, + 0x67, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x22, 0xaf, 0x01, 0x0a, 0x09, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x69, 0x6e, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x2f, 0x0a, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x25, 0x0a, 0x0e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x41, 0x0a, + 0x08, 0x56, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x35, 0x0a, 0x03, 0x65, 0x6e, 0x76, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, + 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x52, 0x03, 0x65, 0x6e, 0x76, + 0x22, 0x7e, 0x0a, 0x06, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4a, + 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x2a, 0x45, 0x0a, 0x0b, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x68, 0x61, 0x73, 0x65, 0x12, + 0x15, 0x0a, 0x11, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x50, + 0x48, 0x41, 0x53, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x55, 0x54, 0x48, 0x4e, 0x10, + 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x55, 0x54, 0x48, 0x5a, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, + 0x53, 0x54, 0x41, 0x54, 0x53, 0x10, 0x03, 0x2a, 0x42, 0x0a, 0x0a, 0x50, 0x75, 0x6c, 0x6c, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x16, 0x0a, 0x12, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x10, 0x00, 0x12, 0x10, 0x0a, + 0x0c, 0x49, 0x66, 0x4e, 0x6f, 0x74, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x10, 0x01, 0x12, + 0x0a, 0x0a, 0x06, 0x41, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x10, 0x02, 0x2a, 0x26, 0x0a, 0x0e, 0x45, + 0x6e, 0x76, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0a, 0x0a, + 0x06, 0x49, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x53, + 0x54, 0x10, 0x01, 0x2a, 0x2d, 0x0a, 0x0c, 0x46, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x72, 0x61, 0x74, + 0x65, 0x67, 0x79, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x41, 0x49, 0x4c, 0x5f, 0x43, 0x4c, 0x4f, 0x53, + 0x45, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x41, 0x49, 0x4c, 0x5f, 0x4f, 0x50, 0x45, 0x4e, + 0x10, 0x01, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x61, 0x6c, 0x69, 0x62, 0x61, 0x62, 0x61, 0x2f, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthWasm = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowWasm = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupWasm = fmt.Errorf("proto: unexpected end of group") + file_extensions_v1alpha1_wasm_proto_rawDescOnce sync.Once + file_extensions_v1alpha1_wasm_proto_rawDescData = file_extensions_v1alpha1_wasm_proto_rawDesc ) + +func file_extensions_v1alpha1_wasm_proto_rawDescGZIP() []byte { + file_extensions_v1alpha1_wasm_proto_rawDescOnce.Do(func() { + file_extensions_v1alpha1_wasm_proto_rawDescData = protoimpl.X.CompressGZIP(file_extensions_v1alpha1_wasm_proto_rawDescData) + }) + return file_extensions_v1alpha1_wasm_proto_rawDescData +} + +var file_extensions_v1alpha1_wasm_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_extensions_v1alpha1_wasm_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_extensions_v1alpha1_wasm_proto_goTypes = []interface{}{ + (PluginPhase)(0), // 0: higress.extensions.v1alpha1.PluginPhase + (PullPolicy)(0), // 1: higress.extensions.v1alpha1.PullPolicy + (EnvValueSource)(0), // 2: higress.extensions.v1alpha1.EnvValueSource + (FailStrategy)(0), // 3: higress.extensions.v1alpha1.FailStrategy + (*WasmPlugin)(nil), // 4: higress.extensions.v1alpha1.WasmPlugin + (*MatchRule)(nil), // 5: higress.extensions.v1alpha1.MatchRule + (*VmConfig)(nil), // 6: higress.extensions.v1alpha1.VmConfig + (*EnvVar)(nil), // 7: higress.extensions.v1alpha1.EnvVar + (*_struct.Struct)(nil), // 8: google.protobuf.Struct + (*wrappers.Int32Value)(nil), // 9: google.protobuf.Int32Value +} +var file_extensions_v1alpha1_wasm_proto_depIdxs = []int32{ + 1, // 0: higress.extensions.v1alpha1.WasmPlugin.image_pull_policy:type_name -> higress.extensions.v1alpha1.PullPolicy + 8, // 1: higress.extensions.v1alpha1.WasmPlugin.plugin_config:type_name -> google.protobuf.Struct + 0, // 2: higress.extensions.v1alpha1.WasmPlugin.phase:type_name -> higress.extensions.v1alpha1.PluginPhase + 9, // 3: higress.extensions.v1alpha1.WasmPlugin.priority:type_name -> google.protobuf.Int32Value + 3, // 4: higress.extensions.v1alpha1.WasmPlugin.fail_strategy:type_name -> higress.extensions.v1alpha1.FailStrategy + 6, // 5: higress.extensions.v1alpha1.WasmPlugin.vm_config:type_name -> higress.extensions.v1alpha1.VmConfig + 8, // 6: higress.extensions.v1alpha1.WasmPlugin.default_config:type_name -> google.protobuf.Struct + 5, // 7: higress.extensions.v1alpha1.WasmPlugin.match_rules:type_name -> higress.extensions.v1alpha1.MatchRule + 8, // 8: higress.extensions.v1alpha1.MatchRule.config:type_name -> google.protobuf.Struct + 7, // 9: higress.extensions.v1alpha1.VmConfig.env:type_name -> higress.extensions.v1alpha1.EnvVar + 2, // 10: higress.extensions.v1alpha1.EnvVar.value_from:type_name -> higress.extensions.v1alpha1.EnvValueSource + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_extensions_v1alpha1_wasm_proto_init() } +func file_extensions_v1alpha1_wasm_proto_init() { + if File_extensions_v1alpha1_wasm_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_extensions_v1alpha1_wasm_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WasmPlugin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_extensions_v1alpha1_wasm_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MatchRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_extensions_v1alpha1_wasm_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VmConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_extensions_v1alpha1_wasm_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnvVar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_extensions_v1alpha1_wasm_proto_rawDesc, + NumEnums: 4, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_extensions_v1alpha1_wasm_proto_goTypes, + DependencyIndexes: file_extensions_v1alpha1_wasm_proto_depIdxs, + EnumInfos: file_extensions_v1alpha1_wasm_proto_enumTypes, + MessageInfos: file_extensions_v1alpha1_wasm_proto_msgTypes, + }.Build() + File_extensions_v1alpha1_wasm_proto = out.File + file_extensions_v1alpha1_wasm_proto_rawDesc = nil + file_extensions_v1alpha1_wasm_proto_goTypes = nil + file_extensions_v1alpha1_wasm_proto_depIdxs = nil +} diff --git a/api/extensions/v1alpha1/wasm.proto b/api/extensions/v1alpha1/wasm.proto index df6fbe426..95e067aa1 100644 --- a/api/extensions/v1alpha1/wasm.proto +++ b/api/extensions/v1alpha1/wasm.proto @@ -100,6 +100,13 @@ message WasmPlugin { // namespace of the `WasmPlugins`. Defaults to `0`. google.protobuf.Int32Value priority = 10; + // Specifies the failure behavior for the plugin due to fatal errors. + FailStrategy fail_strategy = 13; + + // Configuration for a Wasm VM. + // more details can be found [here](https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/wasm/v3/wasm.proto#extensions-wasm-v3-vmconfig). + VmConfig vm_config = 11; + // Extended by Higress, the default configuration takes effect globally google.protobuf.Struct default_config = 101; // Extended by Higress, matching rules take effect @@ -154,3 +161,46 @@ enum PullPolicy { // this plugin. Always = 2; } + +// Configuration for a Wasm VM. +// more details can be found [here](https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/wasm/v3/wasm.proto#extensions-wasm-v3-vmconfig). +message VmConfig { + // Specifies environment variables to be injected to this VM. + // Note that if a key does not exist, it will be ignored. + repeated EnvVar env = 1; +} + +message EnvVar { + // Required + // Name of the environment variable. Must be a C_IDENTIFIER. + string name = 1; + + // Required + // Source for the environment variable's value. + EnvValueSource value_from = 3; + + // Value for the environment variable. + // Note that if `value_from` is `HOST`, it will be ignored. + // Defaults to "". + string value = 2; +} + +enum EnvValueSource { + // Explicitly given key-value pairs to be injected to this VM + INLINE = 0; + + // *Istio-proxy's* environment variables exposed to this VM. + HOST = 1; +} + +enum FailStrategy { + // A fatal error in the binary fetching or during the plugin execution causes + // all subsequent requests to fail with 5xx. + FAIL_CLOSE = 0; + + // Enables the fail open behavior for the Wasm plugin fatal errors to bypass + // the plugin execution. A fatal error can be a failure to fetch the remote + // binary, an exception, or abort() on the VM. This flag is not recommended + // for the authentication or the authorization plugins. + FAIL_OPEN = 1; +} diff --git a/api/extensions/v1alpha1/wasm_deepcopy.gen.go b/api/extensions/v1alpha1/wasm_deepcopy.gen.go index adc299278..c5398f85b 100644 --- a/api/extensions/v1alpha1/wasm_deepcopy.gen.go +++ b/api/extensions/v1alpha1/wasm_deepcopy.gen.go @@ -1,20 +1,10 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: extensions/v1alpha1/wasm.proto - +// Code generated by protoc-gen-deepcopy. DO NOT EDIT. package v1alpha1 import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - math "math" + proto "google.golang.org/protobuf/proto" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - // DeepCopyInto supports using WasmPlugin within kubernetes types, where deepcopy-gen is used. func (in *WasmPlugin) DeepCopyInto(out *WasmPlugin) { p := proto.Clone(in).(*WasmPlugin) @@ -56,3 +46,45 @@ func (in *MatchRule) DeepCopy() *MatchRule { func (in *MatchRule) DeepCopyInterface() interface{} { return in.DeepCopy() } + +// DeepCopyInto supports using VmConfig within kubernetes types, where deepcopy-gen is used. +func (in *VmConfig) DeepCopyInto(out *VmConfig) { + p := proto.Clone(in).(*VmConfig) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VmConfig. Required by controller-gen. +func (in *VmConfig) DeepCopy() *VmConfig { + if in == nil { + return nil + } + out := new(VmConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new VmConfig. Required by controller-gen. +func (in *VmConfig) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using EnvVar within kubernetes types, where deepcopy-gen is used. +func (in *EnvVar) DeepCopyInto(out *EnvVar) { + p := proto.Clone(in).(*EnvVar) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvVar. Required by controller-gen. +func (in *EnvVar) DeepCopy() *EnvVar { + if in == nil { + return nil + } + out := new(EnvVar) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new EnvVar. Required by controller-gen. +func (in *EnvVar) DeepCopyInterface() interface{} { + return in.DeepCopy() +} diff --git a/api/extensions/v1alpha1/wasm_json.gen.go b/api/extensions/v1alpha1/wasm_json.gen.go index 5c04a18b3..f78ebcb83 100644 --- a/api/extensions/v1alpha1/wasm_json.gen.go +++ b/api/extensions/v1alpha1/wasm_json.gen.go @@ -1,22 +1,11 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: extensions/v1alpha1/wasm.proto - +// Code generated by protoc-gen-jsonshim. DO NOT EDIT. package v1alpha1 import ( bytes "bytes" - fmt "fmt" - github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - math "math" + jsonpb "github.com/golang/protobuf/jsonpb" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - // MarshalJSON is a custom marshaler for WasmPlugin func (this *WasmPlugin) MarshalJSON() ([]byte, error) { str, err := WasmMarshaler.MarshalToString(this) @@ -39,7 +28,29 @@ func (this *MatchRule) UnmarshalJSON(b []byte) error { return WasmUnmarshaler.Unmarshal(bytes.NewReader(b), this) } +// MarshalJSON is a custom marshaler for VmConfig +func (this *VmConfig) MarshalJSON() ([]byte, error) { + str, err := WasmMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for VmConfig +func (this *VmConfig) UnmarshalJSON(b []byte) error { + return WasmUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvVar +func (this *EnvVar) MarshalJSON() ([]byte, error) { + str, err := WasmMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvVar +func (this *EnvVar) UnmarshalJSON(b []byte) error { + return WasmUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + var ( - WasmMarshaler = &github_com_gogo_protobuf_jsonpb.Marshaler{} - WasmUnmarshaler = &github_com_gogo_protobuf_jsonpb.Unmarshaler{AllowUnknownFields: true} + WasmMarshaler = &jsonpb.Marshaler{} + WasmUnmarshaler = &jsonpb.Unmarshaler{AllowUnknownFields: true} ) diff --git a/api/kubernetes/customresourcedefinitions.gen.yaml b/api/kubernetes/customresourcedefinitions.gen.yaml index b0e328d56..1398b462f 100644 --- a/api/kubernetes/customresourcedefinitions.gen.yaml +++ b/api/kubernetes/customresourcedefinitions.gen.yaml @@ -37,6 +37,13 @@ spec: x-kubernetes-preserve-unknown-fields: true defaultConfigDisable: type: boolean + failStrategy: + description: Specifies the failure behavior for the plugin due to + fatal errors. + enum: + - FAIL_CLOSE + - FAIL_OPEN + type: string imagePullPolicy: description: The pull behaviour to be applied when fetching an OCI image. @@ -98,6 +105,27 @@ spec: type: string verificationKey: type: string + vmConfig: + description: Configuration for a Wasm VM. + properties: + env: + description: Specifies environment variables to be injected to + this VM. + items: + properties: + name: + type: string + value: + description: Value for the environment variable. + type: string + valueFrom: + enum: + - INLINE + - HOST + type: string + type: object + type: array + type: object type: object status: type: object diff --git a/api/networking/v1/http_2_rpc.pb.go b/api/networking/v1/http_2_rpc.pb.go index 6d2843800..e0be86c78 100644 --- a/api/networking/v1/http_2_rpc.pb.go +++ b/api/networking/v1/http_2_rpc.pb.go @@ -1,27 +1,44 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) 2022 Alibaba Group Holding Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) // source: networking/v1/http_2_rpc.proto +// $schema: higress.networking.v1.Http2Rpc +// $title: Http2Rpc +// $description: Configuration affecting service discovery from multi registries +// $mode: none + package v1 import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - _ "istio.io/gogo-genproto/googleapis/google/api" - math "math" - math_bits "math/bits" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // type Http2Rpc struct { - // Types that are valid to be assigned to Destination: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Destination: + // // *Http2Rpc_Dubbo // *Http2Rpc_Grpc - Destination isHttp2Rpc_Destination `protobuf_oneof:"destination"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Destination isHttp2Rpc_Destination `protobuf_oneof:"destination"` } -func (m *Http2Rpc) Reset() { *m = Http2Rpc{} } -func (m *Http2Rpc) String() string { return proto.CompactTextString(m) } -func (*Http2Rpc) ProtoMessage() {} -func (*Http2Rpc) Descriptor() ([]byte, []int) { - return fileDescriptor_dc706c3b890c1c84, []int{0} -} -func (m *Http2Rpc) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Http2Rpc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Http2Rpc.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *Http2Rpc) Reset() { + *x = Http2Rpc{} + if protoimpl.UnsafeEnabled { + mi := &file_networking_v1_http_2_rpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *Http2Rpc) XXX_Merge(src proto.Message) { - xxx_messageInfo_Http2Rpc.Merge(m, src) -} -func (m *Http2Rpc) XXX_Size() int { - return m.Size() -} -func (m *Http2Rpc) XXX_DiscardUnknown() { - xxx_messageInfo_Http2Rpc.DiscardUnknown(m) + +func (x *Http2Rpc) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_Http2Rpc proto.InternalMessageInfo +func (*Http2Rpc) ProtoMessage() {} -type isHttp2Rpc_Destination interface { - isHttp2Rpc_Destination() - MarshalTo([]byte) (int, error) - Size() int +func (x *Http2Rpc) ProtoReflect() protoreflect.Message { + mi := &file_networking_v1_http_2_rpc_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type Http2Rpc_Dubbo struct { - Dubbo *DubboService `protobuf:"bytes,1,opt,name=dubbo,proto3,oneof" json:"dubbo,omitempty"` +// Deprecated: Use Http2Rpc.ProtoReflect.Descriptor instead. +func (*Http2Rpc) Descriptor() ([]byte, []int) { + return file_networking_v1_http_2_rpc_proto_rawDescGZIP(), []int{0} } -type Http2Rpc_Grpc struct { - Grpc *GrpcService `protobuf:"bytes,2,opt,name=grpc,proto3,oneof" json:"grpc,omitempty"` -} - -func (*Http2Rpc_Dubbo) isHttp2Rpc_Destination() {} -func (*Http2Rpc_Grpc) isHttp2Rpc_Destination() {} func (m *Http2Rpc) GetDestination() isHttp2Rpc_Destination { if m != nil { @@ -106,1805 +108,542 @@ func (m *Http2Rpc) GetDestination() isHttp2Rpc_Destination { return nil } -func (m *Http2Rpc) GetDubbo() *DubboService { - if x, ok := m.GetDestination().(*Http2Rpc_Dubbo); ok { +func (x *Http2Rpc) GetDubbo() *DubboService { + if x, ok := x.GetDestination().(*Http2Rpc_Dubbo); ok { return x.Dubbo } return nil } -func (m *Http2Rpc) GetGrpc() *GrpcService { - if x, ok := m.GetDestination().(*Http2Rpc_Grpc); ok { +func (x *Http2Rpc) GetGrpc() *GrpcService { + if x, ok := x.GetDestination().(*Http2Rpc_Grpc); ok { return x.Grpc } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Http2Rpc) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Http2Rpc_Dubbo)(nil), - (*Http2Rpc_Grpc)(nil), - } +type isHttp2Rpc_Destination interface { + isHttp2Rpc_Destination() } +type Http2Rpc_Dubbo struct { + Dubbo *DubboService `protobuf:"bytes,1,opt,name=dubbo,proto3,oneof"` +} + +type Http2Rpc_Grpc struct { + Grpc *GrpcService `protobuf:"bytes,2,opt,name=grpc,proto3,oneof"` +} + +func (*Http2Rpc_Dubbo) isHttp2Rpc_Destination() {} + +func (*Http2Rpc_Grpc) isHttp2Rpc_Destination() {} + type DubboService struct { - Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group,omitempty"` - Methods []*Method `protobuf:"bytes,4,rep,name=methods,proto3" json:"methods,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group,omitempty"` + Methods []*Method `protobuf:"bytes,4,rep,name=methods,proto3" json:"methods,omitempty"` } -func (m *DubboService) Reset() { *m = DubboService{} } -func (m *DubboService) String() string { return proto.CompactTextString(m) } -func (*DubboService) ProtoMessage() {} -func (*DubboService) Descriptor() ([]byte, []int) { - return fileDescriptor_dc706c3b890c1c84, []int{1} +func (x *DubboService) Reset() { + *x = DubboService{} + if protoimpl.UnsafeEnabled { + mi := &file_networking_v1_http_2_rpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *DubboService) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *DubboService) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DubboService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DubboService.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*DubboService) ProtoMessage() {} + +func (x *DubboService) ProtoReflect() protoreflect.Message { + mi := &file_networking_v1_http_2_rpc_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *DubboService) XXX_Merge(src proto.Message) { - xxx_messageInfo_DubboService.Merge(m, src) -} -func (m *DubboService) XXX_Size() int { - return m.Size() -} -func (m *DubboService) XXX_DiscardUnknown() { - xxx_messageInfo_DubboService.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_DubboService proto.InternalMessageInfo +// Deprecated: Use DubboService.ProtoReflect.Descriptor instead. +func (*DubboService) Descriptor() ([]byte, []int) { + return file_networking_v1_http_2_rpc_proto_rawDescGZIP(), []int{1} +} -func (m *DubboService) GetService() string { - if m != nil { - return m.Service +func (x *DubboService) GetService() string { + if x != nil { + return x.Service } return "" } -func (m *DubboService) GetVersion() string { - if m != nil { - return m.Version +func (x *DubboService) GetVersion() string { + if x != nil { + return x.Version } return "" } -func (m *DubboService) GetGroup() string { - if m != nil { - return m.Group +func (x *DubboService) GetGroup() string { + if x != nil { + return x.Group } return "" } -func (m *DubboService) GetMethods() []*Method { - if m != nil { - return m.Methods +func (x *DubboService) GetMethods() []*Method { + if x != nil { + return x.Methods } return nil } type Method struct { - ServiceMethod string `protobuf:"bytes,1,opt,name=service_method,json=serviceMethod,proto3" json:"service_method,omitempty"` - HeadersAttach string `protobuf:"bytes,2,opt,name=headers_attach,json=headersAttach,proto3" json:"headers_attach,omitempty"` - HttpPath string `protobuf:"bytes,3,opt,name=http_path,json=httpPath,proto3" json:"http_path,omitempty"` - HttpMethods []string `protobuf:"bytes,4,rep,name=http_methods,json=httpMethods,proto3" json:"http_methods,omitempty"` - Params []*Param `protobuf:"bytes,5,rep,name=params,proto3" json:"params,omitempty"` - ParamFromEntireBody *ParamFromEntireBody `protobuf:"bytes,6,opt,name=paramFromEntireBody,proto3" json:"paramFromEntireBody,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceMethod string `protobuf:"bytes,1,opt,name=service_method,json=serviceMethod,proto3" json:"service_method,omitempty"` + HeadersAttach string `protobuf:"bytes,2,opt,name=headers_attach,json=headersAttach,proto3" json:"headers_attach,omitempty"` + HttpPath string `protobuf:"bytes,3,opt,name=http_path,json=httpPath,proto3" json:"http_path,omitempty"` + HttpMethods []string `protobuf:"bytes,4,rep,name=http_methods,json=httpMethods,proto3" json:"http_methods,omitempty"` + Params []*Param `protobuf:"bytes,5,rep,name=params,proto3" json:"params,omitempty"` + ParamFromEntireBody *ParamFromEntireBody `protobuf:"bytes,6,opt,name=paramFromEntireBody,proto3" json:"paramFromEntireBody,omitempty"` } -func (m *Method) Reset() { *m = Method{} } -func (m *Method) String() string { return proto.CompactTextString(m) } -func (*Method) ProtoMessage() {} -func (*Method) Descriptor() ([]byte, []int) { - return fileDescriptor_dc706c3b890c1c84, []int{2} +func (x *Method) Reset() { + *x = Method{} + if protoimpl.UnsafeEnabled { + mi := &file_networking_v1_http_2_rpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Method) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *Method) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Method) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Method.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*Method) ProtoMessage() {} + +func (x *Method) ProtoReflect() protoreflect.Message { + mi := &file_networking_v1_http_2_rpc_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *Method) XXX_Merge(src proto.Message) { - xxx_messageInfo_Method.Merge(m, src) -} -func (m *Method) XXX_Size() int { - return m.Size() -} -func (m *Method) XXX_DiscardUnknown() { - xxx_messageInfo_Method.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_Method proto.InternalMessageInfo +// Deprecated: Use Method.ProtoReflect.Descriptor instead. +func (*Method) Descriptor() ([]byte, []int) { + return file_networking_v1_http_2_rpc_proto_rawDescGZIP(), []int{2} +} -func (m *Method) GetServiceMethod() string { - if m != nil { - return m.ServiceMethod +func (x *Method) GetServiceMethod() string { + if x != nil { + return x.ServiceMethod } return "" } -func (m *Method) GetHeadersAttach() string { - if m != nil { - return m.HeadersAttach +func (x *Method) GetHeadersAttach() string { + if x != nil { + return x.HeadersAttach } return "" } -func (m *Method) GetHttpPath() string { - if m != nil { - return m.HttpPath +func (x *Method) GetHttpPath() string { + if x != nil { + return x.HttpPath } return "" } -func (m *Method) GetHttpMethods() []string { - if m != nil { - return m.HttpMethods +func (x *Method) GetHttpMethods() []string { + if x != nil { + return x.HttpMethods } return nil } -func (m *Method) GetParams() []*Param { - if m != nil { - return m.Params +func (x *Method) GetParams() []*Param { + if x != nil { + return x.Params } return nil } -func (m *Method) GetParamFromEntireBody() *ParamFromEntireBody { - if m != nil { - return m.ParamFromEntireBody +func (x *Method) GetParamFromEntireBody() *ParamFromEntireBody { + if x != nil { + return x.ParamFromEntireBody } return nil } type Param struct { - ParamSource string `protobuf:"bytes,1,opt,name=param_source,json=paramSource,proto3" json:"param_source,omitempty"` - ParamKey string `protobuf:"bytes,2,opt,name=param_key,json=paramKey,proto3" json:"param_key,omitempty"` - ParamType string `protobuf:"bytes,3,opt,name=param_type,json=paramType,proto3" json:"param_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ParamSource string `protobuf:"bytes,1,opt,name=param_source,json=paramSource,proto3" json:"param_source,omitempty"` + ParamKey string `protobuf:"bytes,2,opt,name=param_key,json=paramKey,proto3" json:"param_key,omitempty"` + ParamType string `protobuf:"bytes,3,opt,name=param_type,json=paramType,proto3" json:"param_type,omitempty"` } -func (m *Param) Reset() { *m = Param{} } -func (m *Param) String() string { return proto.CompactTextString(m) } -func (*Param) ProtoMessage() {} -func (*Param) Descriptor() ([]byte, []int) { - return fileDescriptor_dc706c3b890c1c84, []int{3} +func (x *Param) Reset() { + *x = Param{} + if protoimpl.UnsafeEnabled { + mi := &file_networking_v1_http_2_rpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Param) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *Param) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Param) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Param.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*Param) ProtoMessage() {} + +func (x *Param) ProtoReflect() protoreflect.Message { + mi := &file_networking_v1_http_2_rpc_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *Param) XXX_Merge(src proto.Message) { - xxx_messageInfo_Param.Merge(m, src) -} -func (m *Param) XXX_Size() int { - return m.Size() -} -func (m *Param) XXX_DiscardUnknown() { - xxx_messageInfo_Param.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_Param proto.InternalMessageInfo +// Deprecated: Use Param.ProtoReflect.Descriptor instead. +func (*Param) Descriptor() ([]byte, []int) { + return file_networking_v1_http_2_rpc_proto_rawDescGZIP(), []int{3} +} -func (m *Param) GetParamSource() string { - if m != nil { - return m.ParamSource +func (x *Param) GetParamSource() string { + if x != nil { + return x.ParamSource } return "" } -func (m *Param) GetParamKey() string { - if m != nil { - return m.ParamKey +func (x *Param) GetParamKey() string { + if x != nil { + return x.ParamKey } return "" } -func (m *Param) GetParamType() string { - if m != nil { - return m.ParamType +func (x *Param) GetParamType() string { + if x != nil { + return x.ParamType } return "" } type ParamFromEntireBody struct { - ParamType string `protobuf:"bytes,1,opt,name=param_type,json=paramType,proto3" json:"param_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ParamType string `protobuf:"bytes,1,opt,name=param_type,json=paramType,proto3" json:"param_type,omitempty"` } -func (m *ParamFromEntireBody) Reset() { *m = ParamFromEntireBody{} } -func (m *ParamFromEntireBody) String() string { return proto.CompactTextString(m) } -func (*ParamFromEntireBody) ProtoMessage() {} -func (*ParamFromEntireBody) Descriptor() ([]byte, []int) { - return fileDescriptor_dc706c3b890c1c84, []int{4} -} -func (m *ParamFromEntireBody) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ParamFromEntireBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ParamFromEntireBody.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ParamFromEntireBody) Reset() { + *x = ParamFromEntireBody{} + if protoimpl.UnsafeEnabled { + mi := &file_networking_v1_http_2_rpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *ParamFromEntireBody) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParamFromEntireBody.Merge(m, src) -} -func (m *ParamFromEntireBody) XXX_Size() int { - return m.Size() -} -func (m *ParamFromEntireBody) XXX_DiscardUnknown() { - xxx_messageInfo_ParamFromEntireBody.DiscardUnknown(m) + +func (x *ParamFromEntireBody) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_ParamFromEntireBody proto.InternalMessageInfo +func (*ParamFromEntireBody) ProtoMessage() {} -func (m *ParamFromEntireBody) GetParamType() string { - if m != nil { - return m.ParamType +func (x *ParamFromEntireBody) ProtoReflect() protoreflect.Message { + mi := &file_networking_v1_http_2_rpc_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ParamFromEntireBody.ProtoReflect.Descriptor instead. +func (*ParamFromEntireBody) Descriptor() ([]byte, []int) { + return file_networking_v1_http_2_rpc_proto_rawDescGZIP(), []int{4} +} + +func (x *ParamFromEntireBody) GetParamType() string { + if x != nil { + return x.ParamType } return "" } type GrpcService struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *GrpcService) Reset() { *m = GrpcService{} } -func (m *GrpcService) String() string { return proto.CompactTextString(m) } -func (*GrpcService) ProtoMessage() {} +func (x *GrpcService) Reset() { + *x = GrpcService{} + if protoimpl.UnsafeEnabled { + mi := &file_networking_v1_http_2_rpc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrpcService) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrpcService) ProtoMessage() {} + +func (x *GrpcService) ProtoReflect() protoreflect.Message { + mi := &file_networking_v1_http_2_rpc_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GrpcService.ProtoReflect.Descriptor instead. func (*GrpcService) Descriptor() ([]byte, []int) { - return fileDescriptor_dc706c3b890c1c84, []int{5} -} -func (m *GrpcService) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GrpcService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GrpcService.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GrpcService) XXX_Merge(src proto.Message) { - xxx_messageInfo_GrpcService.Merge(m, src) -} -func (m *GrpcService) XXX_Size() int { - return m.Size() -} -func (m *GrpcService) XXX_DiscardUnknown() { - xxx_messageInfo_GrpcService.DiscardUnknown(m) + return file_networking_v1_http_2_rpc_proto_rawDescGZIP(), []int{5} } -var xxx_messageInfo_GrpcService proto.InternalMessageInfo +var File_networking_v1_http_2_rpc_proto protoreflect.FileDescriptor -func init() { - proto.RegisterType((*Http2Rpc)(nil), "higress.networking.v1.Http2Rpc") - proto.RegisterType((*DubboService)(nil), "higress.networking.v1.DubboService") - proto.RegisterType((*Method)(nil), "higress.networking.v1.Method") - proto.RegisterType((*Param)(nil), "higress.networking.v1.Param") - proto.RegisterType((*ParamFromEntireBody)(nil), "higress.networking.v1.ParamFromEntireBody") - proto.RegisterType((*GrpcService)(nil), "higress.networking.v1.GrpcService") -} - -func init() { proto.RegisterFile("networking/v1/http_2_rpc.proto", fileDescriptor_dc706c3b890c1c84) } - -var fileDescriptor_dc706c3b890c1c84 = []byte{ - // 506 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xdf, 0x6e, 0xd3, 0x30, - 0x14, 0xc6, 0x71, 0xd7, 0x76, 0xdd, 0xc9, 0xca, 0x85, 0x27, 0xa4, 0x68, 0x82, 0x32, 0xb2, 0x0b, - 0x26, 0x40, 0x89, 0x56, 0xb8, 0x40, 0x43, 0x5c, 0xac, 0xe2, 0xcf, 0x24, 0x84, 0x34, 0x65, 0x5c, - 0x71, 0x13, 0x39, 0x89, 0x49, 0xac, 0xb5, 0xb1, 0x65, 0xbb, 0x85, 0xbc, 0x05, 0xaf, 0xc1, 0x9b, - 0xec, 0x92, 0x47, 0x40, 0x7d, 0x12, 0x14, 0x3b, 0x5d, 0x93, 0xa9, 0xdd, 0x5d, 0x74, 0xbe, 0xef, - 0x77, 0x7c, 0x3e, 0x9f, 0x18, 0x46, 0x05, 0xd5, 0x3f, 0xb9, 0xbc, 0x66, 0x45, 0x16, 0x2c, 0x4e, - 0x83, 0x5c, 0x6b, 0x11, 0x8d, 0x23, 0x29, 0x12, 0x5f, 0x48, 0xae, 0x39, 0x7e, 0x94, 0xb3, 0x4c, - 0x52, 0xa5, 0xfc, 0xb5, 0xcf, 0x5f, 0x9c, 0x1e, 0x3e, 0xcd, 0x38, 0xcf, 0xa6, 0x34, 0x20, 0x82, - 0x05, 0x3f, 0x18, 0x9d, 0xa6, 0x51, 0x4c, 0x73, 0xb2, 0x60, 0x5c, 0x5a, 0xce, 0xfb, 0x8d, 0x60, - 0x70, 0xa1, 0xb5, 0x18, 0x87, 0x22, 0xc1, 0xef, 0xa0, 0x97, 0xce, 0xe3, 0x98, 0xbb, 0xe8, 0x08, - 0x9d, 0x38, 0xe3, 0x63, 0x7f, 0x63, 0x53, 0xff, 0x43, 0xe5, 0xb9, 0xa2, 0x72, 0xc1, 0x12, 0x7a, - 0xf1, 0x20, 0xb4, 0x0c, 0x7e, 0x0b, 0xdd, 0x4c, 0x8a, 0xc4, 0xed, 0x18, 0xd6, 0xdb, 0xc2, 0x7e, - 0x96, 0x22, 0x59, 0xa3, 0x86, 0x98, 0x0c, 0xc1, 0x49, 0xa9, 0xd2, 0xac, 0x20, 0x9a, 0xf1, 0xc2, - 0xfb, 0x83, 0x60, 0xbf, 0x79, 0x04, 0x1e, 0xc1, 0xae, 0xb2, 0x9f, 0x66, 0xb0, 0xbd, 0x49, 0x77, - 0x79, 0x8e, 0x3a, 0xe1, 0xaa, 0x58, 0xe9, 0x0b, 0x2a, 0x15, 0xe3, 0x85, 0x39, 0xfc, 0x56, 0xaf, - 0x8b, 0xf8, 0x10, 0x7a, 0x99, 0xe4, 0x73, 0xe1, 0xee, 0xdc, 0xaa, 0x28, 0xb4, 0x25, 0xfc, 0x1e, - 0x76, 0x67, 0x54, 0xe7, 0x3c, 0x55, 0x6e, 0xf7, 0x68, 0xe7, 0xc4, 0x19, 0x3f, 0xd9, 0x32, 0xf8, - 0x57, 0xe3, 0x5a, 0xb5, 0xae, 0x19, 0xef, 0xa6, 0x03, 0x7d, 0xab, 0xe0, 0x97, 0xf0, 0xb0, 0x1e, - 0x28, 0xb2, 0x6a, 0x6b, 0xd8, 0x61, 0xad, 0xad, 0xcd, 0x39, 0x25, 0x29, 0x95, 0x2a, 0x22, 0x5a, - 0x93, 0x24, 0x6f, 0x4c, 0x8e, 0xc2, 0x61, 0xad, 0x9d, 0x1b, 0x09, 0x3f, 0x83, 0x3d, 0xb3, 0x6f, - 0x41, 0x74, 0xde, 0xc8, 0xd0, 0x09, 0x07, 0x55, 0xf9, 0x92, 0xe8, 0x1c, 0x3f, 0x87, 0x7d, 0x63, - 0x69, 0x66, 0x59, 0xb9, 0x9c, 0x4a, 0xb1, 0xe7, 0x2a, 0xfc, 0x06, 0xfa, 0x82, 0x48, 0x32, 0x53, - 0x6e, 0xcf, 0xc4, 0x7d, 0xbc, 0x25, 0xee, 0x65, 0x65, 0x0a, 0x6b, 0x2f, 0x8e, 0xe1, 0xc0, 0x7c, - 0x7d, 0x92, 0x7c, 0xf6, 0xb1, 0xd0, 0x4c, 0xd2, 0x09, 0x4f, 0x4b, 0xb7, 0x6f, 0x56, 0xfd, 0xe2, - 0xbe, 0x16, 0x6d, 0xa2, 0xce, 0xb7, 0xa9, 0x99, 0xf7, 0x0b, 0x7a, 0x86, 0xa8, 0xb2, 0x18, 0x3d, - 0x52, 0x7c, 0x2e, 0xef, 0xec, 0xdc, 0x31, 0xca, 0x95, 0x11, 0xaa, 0x7b, 0xb1, 0xc6, 0x6b, 0x5a, - 0xb6, 0x36, 0x3f, 0x30, 0xe5, 0x2f, 0xb4, 0xc4, 0xc7, 0x00, 0xd6, 0xa2, 0x4b, 0x41, 0x5b, 0x77, - 0x67, 0xd1, 0x6f, 0xa5, 0xa0, 0xde, 0x19, 0x1c, 0x6c, 0x98, 0xf5, 0x0e, 0x8b, 0x36, 0xb3, 0x43, - 0x70, 0x1a, 0xbf, 0xf4, 0xe4, 0xec, 0x66, 0x39, 0x42, 0x7f, 0x97, 0x23, 0xf4, 0x6f, 0x39, 0x42, - 0xdf, 0x5f, 0x65, 0x4c, 0xe7, 0xf3, 0xd8, 0x4f, 0xf8, 0x2c, 0x20, 0x53, 0x16, 0x93, 0x98, 0x04, - 0xf5, 0x5d, 0x99, 0x17, 0xd9, 0x7a, 0xd3, 0x71, 0xdf, 0xbc, 0xc8, 0xd7, 0xff, 0x03, 0x00, 0x00, - 0xff, 0xff, 0x30, 0xef, 0x3d, 0xa9, 0xeb, 0x03, 0x00, 0x00, -} - -func (m *Http2Rpc) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Http2Rpc) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Http2Rpc) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Destination != nil { - { - size := m.Destination.Size() - i -= size - if _, err := m.Destination.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Http2Rpc_Dubbo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Http2Rpc_Dubbo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Dubbo != nil { - { - size, err := m.Dubbo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Http2Rpc_Grpc) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Http2Rpc_Grpc) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Grpc != nil { - { - size, err := m.Grpc.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *DubboService) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DubboService) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DubboService) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Methods) > 0 { - for iNdEx := len(m.Methods) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Methods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Group) > 0 { - i -= len(m.Group) - copy(dAtA[i:], m.Group) - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.Group))) - i-- - dAtA[i] = 0x1a - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x12 - } - if len(m.Service) > 0 { - i -= len(m.Service) - copy(dAtA[i:], m.Service) - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.Service))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Method) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Method) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Method) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ParamFromEntireBody != nil { - { - size, err := m.ParamFromEntireBody.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if len(m.Params) > 0 { - for iNdEx := len(m.Params) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Params[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.HttpMethods) > 0 { - for iNdEx := len(m.HttpMethods) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.HttpMethods[iNdEx]) - copy(dAtA[i:], m.HttpMethods[iNdEx]) - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.HttpMethods[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.HttpPath) > 0 { - i -= len(m.HttpPath) - copy(dAtA[i:], m.HttpPath) - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.HttpPath))) - i-- - dAtA[i] = 0x1a - } - if len(m.HeadersAttach) > 0 { - i -= len(m.HeadersAttach) - copy(dAtA[i:], m.HeadersAttach) - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.HeadersAttach))) - i-- - dAtA[i] = 0x12 - } - if len(m.ServiceMethod) > 0 { - i -= len(m.ServiceMethod) - copy(dAtA[i:], m.ServiceMethod) - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.ServiceMethod))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Param) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Param) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Param) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ParamType) > 0 { - i -= len(m.ParamType) - copy(dAtA[i:], m.ParamType) - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.ParamType))) - i-- - dAtA[i] = 0x1a - } - if len(m.ParamKey) > 0 { - i -= len(m.ParamKey) - copy(dAtA[i:], m.ParamKey) - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.ParamKey))) - i-- - dAtA[i] = 0x12 - } - if len(m.ParamSource) > 0 { - i -= len(m.ParamSource) - copy(dAtA[i:], m.ParamSource) - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.ParamSource))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ParamFromEntireBody) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ParamFromEntireBody) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ParamFromEntireBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ParamType) > 0 { - i -= len(m.ParamType) - copy(dAtA[i:], m.ParamType) - i = encodeVarintHttp_2Rpc(dAtA, i, uint64(len(m.ParamType))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GrpcService) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GrpcService) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GrpcService) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func encodeVarintHttp_2Rpc(dAtA []byte, offset int, v uint64) int { - offset -= sovHttp_2Rpc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Http2Rpc) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Destination != nil { - n += m.Destination.Size() - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Http2Rpc_Dubbo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Dubbo != nil { - l = m.Dubbo.Size() - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - return n -} -func (m *Http2Rpc_Grpc) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Grpc != nil { - l = m.Grpc.Size() - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - return n -} -func (m *DubboService) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Service) - if l > 0 { - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - l = len(m.Group) - if l > 0 { - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - if len(m.Methods) > 0 { - for _, e := range m.Methods { - l = e.Size() - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Method) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceMethod) - if l > 0 { - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - l = len(m.HeadersAttach) - if l > 0 { - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - l = len(m.HttpPath) - if l > 0 { - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - if len(m.HttpMethods) > 0 { - for _, s := range m.HttpMethods { - l = len(s) - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - } - if len(m.Params) > 0 { - for _, e := range m.Params { - l = e.Size() - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - } - if m.ParamFromEntireBody != nil { - l = m.ParamFromEntireBody.Size() - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Param) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ParamSource) - if l > 0 { - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - l = len(m.ParamKey) - if l > 0 { - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - l = len(m.ParamType) - if l > 0 { - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ParamFromEntireBody) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ParamType) - if l > 0 { - n += 1 + l + sovHttp_2Rpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GrpcService) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovHttp_2Rpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozHttp_2Rpc(x uint64) (n int) { - return sovHttp_2Rpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Http2Rpc) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Http2Rpc: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Http2Rpc: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dubbo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &DubboService{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Destination = &Http2Rpc_Dubbo{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grpc", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &GrpcService{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Destination = &Http2Rpc_Grpc{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHttp_2Rpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DubboService) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DubboService: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DubboService: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Service = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Group = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Methods", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Methods = append(m.Methods, &Method{}) - if err := m.Methods[len(m.Methods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHttp_2Rpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Method) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Method: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Method: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceMethod", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceMethod = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HeadersAttach", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HeadersAttach = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HttpPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HttpPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HttpMethods", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HttpMethods = append(m.HttpMethods, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Params = append(m.Params, &Param{}) - if err := m.Params[len(m.Params)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParamFromEntireBody", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ParamFromEntireBody == nil { - m.ParamFromEntireBody = &ParamFromEntireBody{} - } - if err := m.ParamFromEntireBody.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHttp_2Rpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Param) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Param: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Param: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParamSource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ParamSource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParamKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ParamKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParamType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ParamType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHttp_2Rpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ParamFromEntireBody) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ParamFromEntireBody: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ParamFromEntireBody: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParamType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHttp_2Rpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ParamType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHttp_2Rpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GrpcService) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GrpcService: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GrpcService: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipHttp_2Rpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHttp_2Rpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipHttp_2Rpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowHttp_2Rpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthHttp_2Rpc - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupHttp_2Rpc - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthHttp_2Rpc - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF +var file_networking_v1_http_2_rpc_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, + 0x68, 0x74, 0x74, 0x70, 0x5f, 0x32, 0x5f, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x15, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, + 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x90, 0x01, 0x0a, 0x08, 0x48, 0x74, 0x74, + 0x70, 0x32, 0x52, 0x70, 0x63, 0x12, 0x3b, 0x0a, 0x05, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x75, 0x62, + 0x62, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x00, 0x52, 0x05, 0x64, 0x75, 0x62, + 0x62, 0x6f, 0x12, 0x38, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x48, 0x00, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x42, 0x0d, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa5, 0x01, 0x0a, 0x0c, + 0x44, 0x75, 0x62, 0x62, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x07, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x02, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x05, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x3c, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, + 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x73, 0x22, 0xc3, 0x02, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2a, + 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0d, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2a, 0x0a, 0x0e, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x12, 0x20, 0x0a, 0x09, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, + 0x68, 0x74, 0x74, 0x70, 0x50, 0x61, 0x74, 0x68, 0x12, 0x26, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, + 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, + 0x12, 0x34, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x61, 0x0a, 0x13, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x46, + 0x72, 0x6f, 0x6d, 0x45, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x45, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x45, + 0x6e, 0x74, 0x69, 0x72, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x22, 0x75, 0x0a, 0x05, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x12, 0x26, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x5f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x02, 0x52, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x4b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x0a, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x54, 0x79, 0x70, 0x65, + 0x22, 0x39, 0x0a, 0x13, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x45, 0x6e, 0x74, + 0x69, 0x72, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, + 0x52, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x47, + 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x6c, 0x69, 0x62, 0x61, 0x62, 0x61, + 0x2f, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( - ErrInvalidLengthHttp_2Rpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowHttp_2Rpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupHttp_2Rpc = fmt.Errorf("proto: unexpected end of group") + file_networking_v1_http_2_rpc_proto_rawDescOnce sync.Once + file_networking_v1_http_2_rpc_proto_rawDescData = file_networking_v1_http_2_rpc_proto_rawDesc ) + +func file_networking_v1_http_2_rpc_proto_rawDescGZIP() []byte { + file_networking_v1_http_2_rpc_proto_rawDescOnce.Do(func() { + file_networking_v1_http_2_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_networking_v1_http_2_rpc_proto_rawDescData) + }) + return file_networking_v1_http_2_rpc_proto_rawDescData +} + +var file_networking_v1_http_2_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_networking_v1_http_2_rpc_proto_goTypes = []interface{}{ + (*Http2Rpc)(nil), // 0: higress.networking.v1.Http2Rpc + (*DubboService)(nil), // 1: higress.networking.v1.DubboService + (*Method)(nil), // 2: higress.networking.v1.Method + (*Param)(nil), // 3: higress.networking.v1.Param + (*ParamFromEntireBody)(nil), // 4: higress.networking.v1.ParamFromEntireBody + (*GrpcService)(nil), // 5: higress.networking.v1.GrpcService +} +var file_networking_v1_http_2_rpc_proto_depIdxs = []int32{ + 1, // 0: higress.networking.v1.Http2Rpc.dubbo:type_name -> higress.networking.v1.DubboService + 5, // 1: higress.networking.v1.Http2Rpc.grpc:type_name -> higress.networking.v1.GrpcService + 2, // 2: higress.networking.v1.DubboService.methods:type_name -> higress.networking.v1.Method + 3, // 3: higress.networking.v1.Method.params:type_name -> higress.networking.v1.Param + 4, // 4: higress.networking.v1.Method.paramFromEntireBody:type_name -> higress.networking.v1.ParamFromEntireBody + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_networking_v1_http_2_rpc_proto_init() } +func file_networking_v1_http_2_rpc_proto_init() { + if File_networking_v1_http_2_rpc_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_networking_v1_http_2_rpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Http2Rpc); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_networking_v1_http_2_rpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DubboService); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_networking_v1_http_2_rpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Method); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_networking_v1_http_2_rpc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Param); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_networking_v1_http_2_rpc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ParamFromEntireBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_networking_v1_http_2_rpc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrpcService); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_networking_v1_http_2_rpc_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*Http2Rpc_Dubbo)(nil), + (*Http2Rpc_Grpc)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_networking_v1_http_2_rpc_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_networking_v1_http_2_rpc_proto_goTypes, + DependencyIndexes: file_networking_v1_http_2_rpc_proto_depIdxs, + MessageInfos: file_networking_v1_http_2_rpc_proto_msgTypes, + }.Build() + File_networking_v1_http_2_rpc_proto = out.File + file_networking_v1_http_2_rpc_proto_rawDesc = nil + file_networking_v1_http_2_rpc_proto_goTypes = nil + file_networking_v1_http_2_rpc_proto_depIdxs = nil +} diff --git a/api/networking/v1/http_2_rpc_deepcopy.gen.go b/api/networking/v1/http_2_rpc_deepcopy.gen.go index dc717a327..3af67afc0 100644 --- a/api/networking/v1/http_2_rpc_deepcopy.gen.go +++ b/api/networking/v1/http_2_rpc_deepcopy.gen.go @@ -1,20 +1,10 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: networking/v1/http_2_rpc.proto - +// Code generated by protoc-gen-deepcopy. DO NOT EDIT. package v1 import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - _ "istio.io/gogo-genproto/googleapis/google/api" - math "math" + proto "google.golang.org/protobuf/proto" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - // DeepCopyInto supports using Http2Rpc within kubernetes types, where deepcopy-gen is used. func (in *Http2Rpc) DeepCopyInto(out *Http2Rpc) { p := proto.Clone(in).(*Http2Rpc) diff --git a/api/networking/v1/http_2_rpc_json.gen.go b/api/networking/v1/http_2_rpc_json.gen.go index d48e556e0..c86235c61 100644 --- a/api/networking/v1/http_2_rpc_json.gen.go +++ b/api/networking/v1/http_2_rpc_json.gen.go @@ -1,22 +1,11 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: networking/v1/http_2_rpc.proto - +// Code generated by protoc-gen-jsonshim. DO NOT EDIT. package v1 import ( bytes "bytes" - fmt "fmt" - github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" - proto "github.com/gogo/protobuf/proto" - _ "istio.io/gogo-genproto/googleapis/google/api" - math "math" + jsonpb "github.com/golang/protobuf/jsonpb" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - // MarshalJSON is a custom marshaler for Http2Rpc func (this *Http2Rpc) MarshalJSON() ([]byte, error) { str, err := Http_2RpcMarshaler.MarshalToString(this) @@ -84,6 +73,6 @@ func (this *GrpcService) UnmarshalJSON(b []byte) error { } var ( - Http_2RpcMarshaler = &github_com_gogo_protobuf_jsonpb.Marshaler{} - Http_2RpcUnmarshaler = &github_com_gogo_protobuf_jsonpb.Unmarshaler{AllowUnknownFields: true} + Http_2RpcMarshaler = &jsonpb.Marshaler{} + Http_2RpcUnmarshaler = &jsonpb.Unmarshaler{AllowUnknownFields: true} ) diff --git a/api/networking/v1/mcp_bridge.pb.go b/api/networking/v1/mcp_bridge.pb.go index 021ed0452..7aa8fbf28 100644 --- a/api/networking/v1/mcp_bridge.pb.go +++ b/api/networking/v1/mcp_bridge.pb.go @@ -1,27 +1,44 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Copyright (c) 2022 Alibaba Group Holding Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) // source: networking/v1/mcp_bridge.proto +// $schema: higress.networking.v1.McpBridge +// $title: McpBridge +// $description: Configuration affecting service discovery from multi registries +// $mode: none + package v1 import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - _ "istio.io/gogo-genproto/googleapis/google/api" - math "math" - math_bits "math/bits" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // type McpBridge struct { - Registries []*RegistryConfig `protobuf:"bytes,1,rep,name=registries,proto3" json:"registries,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Registries []*RegistryConfig `protobuf:"bytes,1,rep,name=registries,proto3" json:"registries,omitempty"` } -func (m *McpBridge) Reset() { *m = McpBridge{} } -func (m *McpBridge) String() string { return proto.CompactTextString(m) } -func (*McpBridge) ProtoMessage() {} -func (*McpBridge) Descriptor() ([]byte, []int) { - return fileDescriptor_3fcc59a15c34642d, []int{0} -} -func (m *McpBridge) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *McpBridge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_McpBridge.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *McpBridge) Reset() { + *x = McpBridge{} + if protoimpl.UnsafeEnabled { + mi := &file_networking_v1_mcp_bridge_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *McpBridge) XXX_Merge(src proto.Message) { - xxx_messageInfo_McpBridge.Merge(m, src) -} -func (m *McpBridge) XXX_Size() int { - return m.Size() -} -func (m *McpBridge) XXX_DiscardUnknown() { - xxx_messageInfo_McpBridge.DiscardUnknown(m) + +func (x *McpBridge) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_McpBridge proto.InternalMessageInfo +func (*McpBridge) ProtoMessage() {} -func (m *McpBridge) GetRegistries() []*RegistryConfig { - if m != nil { - return m.Registries +func (x *McpBridge) ProtoReflect() protoreflect.Message { + mi := &file_networking_v1_mcp_bridge_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use McpBridge.ProtoReflect.Descriptor instead. +func (*McpBridge) Descriptor() ([]byte, []int) { + return file_networking_v1_mcp_bridge_proto_rawDescGZIP(), []int{0} +} + +func (x *McpBridge) GetRegistries() []*RegistryConfig { + if x != nil { + return x.Registries } return nil } type RegistryConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain,omitempty"` @@ -105,1231 +126,294 @@ type RegistryConfig struct { ConsulServiceTag string `protobuf:"bytes,15,opt,name=consulServiceTag,proto3" json:"consulServiceTag,omitempty"` ConsulRefreshInterval int64 `protobuf:"varint,16,opt,name=consulRefreshInterval,proto3" json:"consulRefreshInterval,omitempty"` AuthSecretName string `protobuf:"bytes,17,opt,name=authSecretName,proto3" json:"authSecretName,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *RegistryConfig) Reset() { *m = RegistryConfig{} } -func (m *RegistryConfig) String() string { return proto.CompactTextString(m) } -func (*RegistryConfig) ProtoMessage() {} +func (x *RegistryConfig) Reset() { + *x = RegistryConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_networking_v1_mcp_bridge_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegistryConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegistryConfig) ProtoMessage() {} + +func (x *RegistryConfig) ProtoReflect() protoreflect.Message { + mi := &file_networking_v1_mcp_bridge_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegistryConfig.ProtoReflect.Descriptor instead. func (*RegistryConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_3fcc59a15c34642d, []int{1} -} -func (m *RegistryConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RegistryConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RegistryConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RegistryConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegistryConfig.Merge(m, src) -} -func (m *RegistryConfig) XXX_Size() int { - return m.Size() -} -func (m *RegistryConfig) XXX_DiscardUnknown() { - xxx_messageInfo_RegistryConfig.DiscardUnknown(m) + return file_networking_v1_mcp_bridge_proto_rawDescGZIP(), []int{1} } -var xxx_messageInfo_RegistryConfig proto.InternalMessageInfo - -func (m *RegistryConfig) GetType() string { - if m != nil { - return m.Type +func (x *RegistryConfig) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *RegistryConfig) GetName() string { - if m != nil { - return m.Name +func (x *RegistryConfig) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *RegistryConfig) GetDomain() string { - if m != nil { - return m.Domain +func (x *RegistryConfig) GetDomain() string { + if x != nil { + return x.Domain } return "" } -func (m *RegistryConfig) GetPort() uint32 { - if m != nil { - return m.Port +func (x *RegistryConfig) GetPort() uint32 { + if x != nil { + return x.Port } return 0 } -func (m *RegistryConfig) GetNacosAddressServer() string { - if m != nil { - return m.NacosAddressServer +func (x *RegistryConfig) GetNacosAddressServer() string { + if x != nil { + return x.NacosAddressServer } return "" } -func (m *RegistryConfig) GetNacosAccessKey() string { - if m != nil { - return m.NacosAccessKey +func (x *RegistryConfig) GetNacosAccessKey() string { + if x != nil { + return x.NacosAccessKey } return "" } -func (m *RegistryConfig) GetNacosSecretKey() string { - if m != nil { - return m.NacosSecretKey +func (x *RegistryConfig) GetNacosSecretKey() string { + if x != nil { + return x.NacosSecretKey } return "" } -func (m *RegistryConfig) GetNacosNamespaceId() string { - if m != nil { - return m.NacosNamespaceId +func (x *RegistryConfig) GetNacosNamespaceId() string { + if x != nil { + return x.NacosNamespaceId } return "" } -func (m *RegistryConfig) GetNacosNamespace() string { - if m != nil { - return m.NacosNamespace +func (x *RegistryConfig) GetNacosNamespace() string { + if x != nil { + return x.NacosNamespace } return "" } -func (m *RegistryConfig) GetNacosGroups() []string { - if m != nil { - return m.NacosGroups +func (x *RegistryConfig) GetNacosGroups() []string { + if x != nil { + return x.NacosGroups } return nil } -func (m *RegistryConfig) GetNacosRefreshInterval() int64 { - if m != nil { - return m.NacosRefreshInterval +func (x *RegistryConfig) GetNacosRefreshInterval() int64 { + if x != nil { + return x.NacosRefreshInterval } return 0 } -func (m *RegistryConfig) GetConsulNamespace() string { - if m != nil { - return m.ConsulNamespace +func (x *RegistryConfig) GetConsulNamespace() string { + if x != nil { + return x.ConsulNamespace } return "" } -func (m *RegistryConfig) GetZkServicesPath() []string { - if m != nil { - return m.ZkServicesPath +func (x *RegistryConfig) GetZkServicesPath() []string { + if x != nil { + return x.ZkServicesPath } return nil } -func (m *RegistryConfig) GetConsulDatacenter() string { - if m != nil { - return m.ConsulDatacenter +func (x *RegistryConfig) GetConsulDatacenter() string { + if x != nil { + return x.ConsulDatacenter } return "" } -func (m *RegistryConfig) GetConsulServiceTag() string { - if m != nil { - return m.ConsulServiceTag +func (x *RegistryConfig) GetConsulServiceTag() string { + if x != nil { + return x.ConsulServiceTag } return "" } -func (m *RegistryConfig) GetConsulRefreshInterval() int64 { - if m != nil { - return m.ConsulRefreshInterval +func (x *RegistryConfig) GetConsulRefreshInterval() int64 { + if x != nil { + return x.ConsulRefreshInterval } return 0 } -func (m *RegistryConfig) GetAuthSecretName() string { - if m != nil { - return m.AuthSecretName +func (x *RegistryConfig) GetAuthSecretName() string { + if x != nil { + return x.AuthSecretName } return "" } -func init() { - proto.RegisterType((*McpBridge)(nil), "higress.networking.v1.McpBridge") - proto.RegisterType((*RegistryConfig)(nil), "higress.networking.v1.RegistryConfig") -} +var File_networking_v1_mcp_bridge_proto protoreflect.FileDescriptor -func init() { proto.RegisterFile("networking/v1/mcp_bridge.proto", fileDescriptor_3fcc59a15c34642d) } - -var fileDescriptor_3fcc59a15c34642d = []byte{ - // 477 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xd1, 0x6e, 0xd3, 0x30, - 0x14, 0x86, 0x95, 0xb5, 0x2b, 0xd4, 0x65, 0xdd, 0xb0, 0x98, 0x64, 0x21, 0x54, 0xa2, 0x49, 0xa0, - 0x08, 0xa1, 0x44, 0x1b, 0x5c, 0x71, 0xb7, 0x02, 0x42, 0x13, 0x02, 0xa1, 0x8c, 0x2b, 0x6e, 0x26, - 0xc7, 0x39, 0x75, 0xac, 0x26, 0x71, 0x64, 0xbb, 0x41, 0xe5, 0x89, 0x78, 0x14, 0x2e, 0x79, 0x04, - 0xd4, 0x27, 0x41, 0x76, 0x4a, 0x9a, 0x86, 0xde, 0x25, 0xdf, 0xf9, 0xfd, 0x9f, 0xf3, 0x3b, 0x39, - 0x68, 0x56, 0x82, 0xf9, 0x2e, 0xd5, 0x52, 0x94, 0x3c, 0xaa, 0x2f, 0xa3, 0x82, 0x55, 0x77, 0x89, - 0x12, 0x29, 0x87, 0xb0, 0x52, 0xd2, 0x48, 0x7c, 0x9e, 0x09, 0xae, 0x40, 0xeb, 0x70, 0xa7, 0x0b, - 0xeb, 0xcb, 0xc7, 0x4f, 0xb9, 0x94, 0x3c, 0x87, 0x88, 0x56, 0x22, 0x5a, 0x08, 0xc8, 0xd3, 0xbb, - 0x04, 0x32, 0x5a, 0x0b, 0xa9, 0x9a, 0x73, 0x17, 0x31, 0x1a, 0x7f, 0x62, 0xd5, 0xdc, 0x59, 0xe1, - 0xf7, 0x08, 0x29, 0xe0, 0x42, 0x1b, 0x25, 0x40, 0x13, 0xcf, 0x1f, 0x04, 0x93, 0xab, 0x67, 0xe1, - 0x41, 0xe7, 0x30, 0x6e, 0x84, 0xeb, 0xb7, 0xb2, 0x5c, 0x08, 0x1e, 0x77, 0x0e, 0x5e, 0xfc, 0x3c, - 0x46, 0xd3, 0xfd, 0x32, 0x26, 0x68, 0x68, 0xd6, 0x15, 0x10, 0xcf, 0xf7, 0x82, 0xf1, 0x7c, 0xb8, - 0xb9, 0xf6, 0x8e, 0x62, 0x47, 0x30, 0x46, 0xc3, 0x92, 0x16, 0x40, 0x8e, 0x6c, 0x25, 0x76, 0xcf, - 0xf8, 0x09, 0x1a, 0xa5, 0xb2, 0xa0, 0xa2, 0x24, 0x83, 0x8e, 0x7e, 0xcb, 0xac, 0x57, 0x25, 0x95, - 0x21, 0x43, 0xdf, 0x0b, 0x4e, 0xfe, 0x79, 0x59, 0x82, 0x43, 0x84, 0x4b, 0xca, 0xa4, 0xbe, 0x4e, - 0x53, 0x3b, 0xf1, 0x2d, 0xa8, 0x1a, 0x14, 0x39, 0x76, 0xce, 0x07, 0x2a, 0xf8, 0x39, 0x9a, 0x36, - 0x94, 0x31, 0xd0, 0xfa, 0x23, 0xac, 0xc9, 0xc8, 0x69, 0x7b, 0xb4, 0xd5, 0xdd, 0x02, 0x53, 0x60, - 0xac, 0xee, 0x5e, 0x47, 0xd7, 0x52, 0xfc, 0x02, 0x9d, 0x39, 0xf2, 0x99, 0x16, 0xa0, 0x2b, 0xca, - 0xe0, 0x26, 0x25, 0xf7, 0x9d, 0xf2, 0x3f, 0xde, 0x7a, 0xb6, 0x8c, 0x8c, 0x3b, 0x9e, 0x2d, 0xc5, - 0x3e, 0x9a, 0x38, 0xf2, 0x41, 0xc9, 0x55, 0xa5, 0x09, 0xf2, 0x07, 0xc1, 0x38, 0xee, 0x22, 0x7c, - 0x85, 0x1e, 0xb9, 0xd7, 0x18, 0x16, 0x0a, 0x74, 0x76, 0x53, 0x1a, 0x50, 0x35, 0xcd, 0xc9, 0xc4, - 0xf7, 0x82, 0x41, 0x7c, 0xb0, 0x86, 0x03, 0x74, 0xca, 0x64, 0xa9, 0x57, 0xf9, 0xae, 0xfd, 0x03, - 0xd7, 0xbe, 0x8f, 0xed, 0x9c, 0x3f, 0x96, 0xf6, 0xbe, 0x04, 0x03, 0xfd, 0x85, 0x9a, 0x8c, 0x9c, - 0xb8, 0x11, 0x7a, 0xd4, 0x66, 0x6f, 0x8e, 0xbe, 0xa3, 0x86, 0x32, 0xb0, 0x8d, 0xc8, 0xb4, 0xc9, - 0xde, 0xe7, 0x3b, 0xed, 0xd6, 0xe1, 0x2b, 0xe5, 0xe4, 0xb4, 0xab, 0xdd, 0x71, 0xfc, 0x1a, 0x9d, - 0x37, 0xac, 0x1f, 0xef, 0xcc, 0xc5, 0x3b, 0x5c, 0xb4, 0x53, 0xd3, 0x95, 0xc9, 0x9a, 0x4f, 0x63, - 0xc3, 0x90, 0x87, 0xcd, 0xed, 0xee, 0xd3, 0xf9, 0x9b, 0x5f, 0x9b, 0x99, 0xf7, 0x7b, 0x33, 0xf3, - 0xfe, 0x6c, 0x66, 0xde, 0xb7, 0x97, 0x5c, 0x98, 0x6c, 0x95, 0x84, 0x4c, 0x16, 0x11, 0xcd, 0x45, - 0x42, 0x13, 0x1a, 0x6d, 0xff, 0x7e, 0xb7, 0x41, 0x7b, 0x3b, 0x98, 0x8c, 0xdc, 0x06, 0xbd, 0xfa, - 0x1b, 0x00, 0x00, 0xff, 0xff, 0x21, 0x2e, 0x82, 0x0a, 0x9b, 0x03, 0x00, 0x00, -} - -func (m *McpBridge) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *McpBridge) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *McpBridge) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Registries) > 0 { - for iNdEx := len(m.Registries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Registries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMcpBridge(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *RegistryConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RegistryConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RegistryConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.AuthSecretName) > 0 { - i -= len(m.AuthSecretName) - copy(dAtA[i:], m.AuthSecretName) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.AuthSecretName))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - if m.ConsulRefreshInterval != 0 { - i = encodeVarintMcpBridge(dAtA, i, uint64(m.ConsulRefreshInterval)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x80 - } - if len(m.ConsulServiceTag) > 0 { - i -= len(m.ConsulServiceTag) - copy(dAtA[i:], m.ConsulServiceTag) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.ConsulServiceTag))) - i-- - dAtA[i] = 0x7a - } - if len(m.ConsulDatacenter) > 0 { - i -= len(m.ConsulDatacenter) - copy(dAtA[i:], m.ConsulDatacenter) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.ConsulDatacenter))) - i-- - dAtA[i] = 0x72 - } - if len(m.ZkServicesPath) > 0 { - for iNdEx := len(m.ZkServicesPath) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ZkServicesPath[iNdEx]) - copy(dAtA[i:], m.ZkServicesPath[iNdEx]) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.ZkServicesPath[iNdEx]))) - i-- - dAtA[i] = 0x6a - } - } - if len(m.ConsulNamespace) > 0 { - i -= len(m.ConsulNamespace) - copy(dAtA[i:], m.ConsulNamespace) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.ConsulNamespace))) - i-- - dAtA[i] = 0x62 - } - if m.NacosRefreshInterval != 0 { - i = encodeVarintMcpBridge(dAtA, i, uint64(m.NacosRefreshInterval)) - i-- - dAtA[i] = 0x58 - } - if len(m.NacosGroups) > 0 { - for iNdEx := len(m.NacosGroups) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NacosGroups[iNdEx]) - copy(dAtA[i:], m.NacosGroups[iNdEx]) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.NacosGroups[iNdEx]))) - i-- - dAtA[i] = 0x52 - } - } - if len(m.NacosNamespace) > 0 { - i -= len(m.NacosNamespace) - copy(dAtA[i:], m.NacosNamespace) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.NacosNamespace))) - i-- - dAtA[i] = 0x4a - } - if len(m.NacosNamespaceId) > 0 { - i -= len(m.NacosNamespaceId) - copy(dAtA[i:], m.NacosNamespaceId) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.NacosNamespaceId))) - i-- - dAtA[i] = 0x42 - } - if len(m.NacosSecretKey) > 0 { - i -= len(m.NacosSecretKey) - copy(dAtA[i:], m.NacosSecretKey) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.NacosSecretKey))) - i-- - dAtA[i] = 0x3a - } - if len(m.NacosAccessKey) > 0 { - i -= len(m.NacosAccessKey) - copy(dAtA[i:], m.NacosAccessKey) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.NacosAccessKey))) - i-- - dAtA[i] = 0x32 - } - if len(m.NacosAddressServer) > 0 { - i -= len(m.NacosAddressServer) - copy(dAtA[i:], m.NacosAddressServer) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.NacosAddressServer))) - i-- - dAtA[i] = 0x2a - } - if m.Port != 0 { - i = encodeVarintMcpBridge(dAtA, i, uint64(m.Port)) - i-- - dAtA[i] = 0x20 - } - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintMcpBridge(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintMcpBridge(dAtA []byte, offset int, v uint64) int { - offset -= sovMcpBridge(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *McpBridge) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Registries) > 0 { - for _, e := range m.Registries { - l = e.Size() - n += 1 + l + sovMcpBridge(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RegistryConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - if l > 0 { - n += 1 + l + sovMcpBridge(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovMcpBridge(uint64(l)) - } - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovMcpBridge(uint64(l)) - } - if m.Port != 0 { - n += 1 + sovMcpBridge(uint64(m.Port)) - } - l = len(m.NacosAddressServer) - if l > 0 { - n += 1 + l + sovMcpBridge(uint64(l)) - } - l = len(m.NacosAccessKey) - if l > 0 { - n += 1 + l + sovMcpBridge(uint64(l)) - } - l = len(m.NacosSecretKey) - if l > 0 { - n += 1 + l + sovMcpBridge(uint64(l)) - } - l = len(m.NacosNamespaceId) - if l > 0 { - n += 1 + l + sovMcpBridge(uint64(l)) - } - l = len(m.NacosNamespace) - if l > 0 { - n += 1 + l + sovMcpBridge(uint64(l)) - } - if len(m.NacosGroups) > 0 { - for _, s := range m.NacosGroups { - l = len(s) - n += 1 + l + sovMcpBridge(uint64(l)) - } - } - if m.NacosRefreshInterval != 0 { - n += 1 + sovMcpBridge(uint64(m.NacosRefreshInterval)) - } - l = len(m.ConsulNamespace) - if l > 0 { - n += 1 + l + sovMcpBridge(uint64(l)) - } - if len(m.ZkServicesPath) > 0 { - for _, s := range m.ZkServicesPath { - l = len(s) - n += 1 + l + sovMcpBridge(uint64(l)) - } - } - l = len(m.ConsulDatacenter) - if l > 0 { - n += 1 + l + sovMcpBridge(uint64(l)) - } - l = len(m.ConsulServiceTag) - if l > 0 { - n += 1 + l + sovMcpBridge(uint64(l)) - } - if m.ConsulRefreshInterval != 0 { - n += 2 + sovMcpBridge(uint64(m.ConsulRefreshInterval)) - } - l = len(m.AuthSecretName) - if l > 0 { - n += 2 + l + sovMcpBridge(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovMcpBridge(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMcpBridge(x uint64) (n int) { - return sovMcpBridge(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *McpBridge) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: McpBridge: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: McpBridge: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Registries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Registries = append(m.Registries, &RegistryConfig{}) - if err := m.Registries[len(m.Registries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMcpBridge(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMcpBridge - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RegistryConfig) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RegistryConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RegistryConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - m.Port = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Port |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NacosAddressServer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NacosAddressServer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NacosAccessKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NacosAccessKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NacosSecretKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NacosSecretKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NacosNamespaceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NacosNamespaceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NacosNamespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NacosNamespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NacosGroups", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NacosGroups = append(m.NacosGroups, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NacosRefreshInterval", wireType) - } - m.NacosRefreshInterval = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NacosRefreshInterval |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsulNamespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsulNamespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ZkServicesPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ZkServicesPath = append(m.ZkServicesPath, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsulDatacenter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsulDatacenter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsulServiceTag", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsulServiceTag = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsulRefreshInterval", wireType) - } - m.ConsulRefreshInterval = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ConsulRefreshInterval |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthSecretName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMcpBridge - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMcpBridge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AuthSecretName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMcpBridge(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMcpBridge - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMcpBridge(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMcpBridge - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthMcpBridge - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupMcpBridge - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthMcpBridge - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF +var file_networking_v1_mcp_bridge_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x63, 0x70, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x15, 0x68, 0x69, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, + 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x52, 0x0a, 0x09, 0x4d, 0x63, 0x70, 0x42, + 0x72, 0x69, 0x64, 0x67, 0x65, 0x12, 0x45, 0x0a, 0x0a, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x68, 0x69, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, + 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x0a, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x22, 0xa5, 0x05, 0x0a, + 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x17, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x02, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x06, + 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x17, 0x0a, 0x04, 0x70, 0x6f, 0x72, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x70, 0x6f, + 0x72, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, + 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x4b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6e, 0x61, 0x63, 0x6f, + 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x0e, 0x6e, 0x61, + 0x63, 0x6f, 0x73, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, + 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x10, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6e, 0x61, + 0x63, 0x6f, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x26, + 0x0a, 0x0e, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x4e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61, 0x63, + 0x6f, 0x73, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x32, 0x0a, 0x14, 0x6e, 0x61, 0x63, 0x6f, + 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x14, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x52, 0x65, 0x66, + 0x72, 0x65, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x28, 0x0a, 0x0f, + 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x4e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x7a, 0x6b, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x50, 0x61, 0x74, 0x68, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, + 0x7a, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2a, + 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6e, 0x74, + 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, + 0x44, 0x61, 0x74, 0x61, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x10, 0x63, 0x6f, + 0x6e, 0x73, 0x75, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x61, 0x67, 0x18, 0x0f, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x54, 0x61, 0x67, 0x12, 0x34, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, + 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, + 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x65, 0x66, + 0x72, 0x65, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x26, 0x0a, 0x0e, + 0x61, 0x75, 0x74, 0x68, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x61, 0x6c, 0x69, 0x62, 0x61, 0x62, 0x61, 0x2f, 0x68, 0x69, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, + 0x67, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthMcpBridge = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMcpBridge = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupMcpBridge = fmt.Errorf("proto: unexpected end of group") + file_networking_v1_mcp_bridge_proto_rawDescOnce sync.Once + file_networking_v1_mcp_bridge_proto_rawDescData = file_networking_v1_mcp_bridge_proto_rawDesc ) + +func file_networking_v1_mcp_bridge_proto_rawDescGZIP() []byte { + file_networking_v1_mcp_bridge_proto_rawDescOnce.Do(func() { + file_networking_v1_mcp_bridge_proto_rawDescData = protoimpl.X.CompressGZIP(file_networking_v1_mcp_bridge_proto_rawDescData) + }) + return file_networking_v1_mcp_bridge_proto_rawDescData +} + +var file_networking_v1_mcp_bridge_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_networking_v1_mcp_bridge_proto_goTypes = []interface{}{ + (*McpBridge)(nil), // 0: higress.networking.v1.McpBridge + (*RegistryConfig)(nil), // 1: higress.networking.v1.RegistryConfig +} +var file_networking_v1_mcp_bridge_proto_depIdxs = []int32{ + 1, // 0: higress.networking.v1.McpBridge.registries:type_name -> higress.networking.v1.RegistryConfig + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_networking_v1_mcp_bridge_proto_init() } +func file_networking_v1_mcp_bridge_proto_init() { + if File_networking_v1_mcp_bridge_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_networking_v1_mcp_bridge_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*McpBridge); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_networking_v1_mcp_bridge_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegistryConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_networking_v1_mcp_bridge_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_networking_v1_mcp_bridge_proto_goTypes, + DependencyIndexes: file_networking_v1_mcp_bridge_proto_depIdxs, + MessageInfos: file_networking_v1_mcp_bridge_proto_msgTypes, + }.Build() + File_networking_v1_mcp_bridge_proto = out.File + file_networking_v1_mcp_bridge_proto_rawDesc = nil + file_networking_v1_mcp_bridge_proto_goTypes = nil + file_networking_v1_mcp_bridge_proto_depIdxs = nil +} diff --git a/api/networking/v1/mcp_bridge_deepcopy.gen.go b/api/networking/v1/mcp_bridge_deepcopy.gen.go index 842dc83ce..3abbc520e 100644 --- a/api/networking/v1/mcp_bridge_deepcopy.gen.go +++ b/api/networking/v1/mcp_bridge_deepcopy.gen.go @@ -1,20 +1,10 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: networking/v1/mcp_bridge.proto - +// Code generated by protoc-gen-deepcopy. DO NOT EDIT. package v1 import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - _ "istio.io/gogo-genproto/googleapis/google/api" - math "math" + proto "google.golang.org/protobuf/proto" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - // DeepCopyInto supports using McpBridge within kubernetes types, where deepcopy-gen is used. func (in *McpBridge) DeepCopyInto(out *McpBridge) { p := proto.Clone(in).(*McpBridge) diff --git a/api/networking/v1/mcp_bridge_json.gen.go b/api/networking/v1/mcp_bridge_json.gen.go index 7926cee31..65b9bc860 100644 --- a/api/networking/v1/mcp_bridge_json.gen.go +++ b/api/networking/v1/mcp_bridge_json.gen.go @@ -1,22 +1,11 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: networking/v1/mcp_bridge.proto - +// Code generated by protoc-gen-jsonshim. DO NOT EDIT. package v1 import ( bytes "bytes" - fmt "fmt" - github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" - proto "github.com/gogo/protobuf/proto" - _ "istio.io/gogo-genproto/googleapis/google/api" - math "math" + jsonpb "github.com/golang/protobuf/jsonpb" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - // MarshalJSON is a custom marshaler for McpBridge func (this *McpBridge) MarshalJSON() ([]byte, error) { str, err := McpBridgeMarshaler.MarshalToString(this) @@ -40,6 +29,6 @@ func (this *RegistryConfig) UnmarshalJSON(b []byte) error { } var ( - McpBridgeMarshaler = &github_com_gogo_protobuf_jsonpb.Marshaler{} - McpBridgeUnmarshaler = &github_com_gogo_protobuf_jsonpb.Unmarshaler{AllowUnknownFields: true} + McpBridgeMarshaler = &jsonpb.Marshaler{} + McpBridgeUnmarshaler = &jsonpb.Unmarshaler{AllowUnknownFields: true} ) diff --git a/client/Makefile b/client/Makefile index 09e1e9955..eef033828 100644 --- a/client/Makefile +++ b/client/Makefile @@ -16,6 +16,7 @@ ######################## # kubernetes code generators ######################## +applyconfiguration_gen = applyconfiguration-gen kubetype_gen = kubetype-gen deepcopy_gen = deepcopy-gen client_gen = client-gen @@ -42,6 +43,8 @@ kube_api_packages = $(subst $(space),$(empty), \ $(kube_api_base_package)/networking/v1, \ $(kube_api_base_package)/extensions/v1alpha1 \ ) +# this is needed to properly generate ssa functions +kube_api_applyconfiguration_packages = $(kube_api_packages),k8s.io/apimachinery/pkg/apis/meta/v1 # base output package used by kubernetes client-gen kube_clientset_package = $(kube_base_output_package)/clientset # clientset name used by kubernetes client-gen @@ -50,6 +53,8 @@ kube_clientset_name = versioned kube_listers_package = $(kube_base_output_package)/listers # base output package used by kubernetes informer-gen kube_informers_package = $(kube_base_output_package)/informers +# base output package used by kubernetes applyconfiguration-gen +kube_applyconfiguration_package = $(kube_base_output_package)/applyconfiguration # file header text kube_go_header_text = header.go.txt @@ -73,12 +78,14 @@ rename_generated_files=\ .PHONY: generate-k8s-client generate-k8s-client: # generate kube api type wrappers for higress types - @$(kubetype_gen) --input-dirs $(kube_source_packages) --output-package $(kube_api_base_package) -h $(kube_go_header_text) + @KUBETYPE_GOLANG_PROTOBUF=true $(kubetype_gen) --input-dirs $(kube_source_packages) --output-package $(kube_api_base_package) -h $(kube_go_header_text) @$(move_generated) # generate deepcopy for kube api types @$(deepcopy_gen) --input-dirs $(kube_api_packages) -O zz_generated.deepcopy -h $(kube_go_header_text) + # generate ssa for kube api types + @$(applyconfiguration_gen) --input-dirs $(kube_api_applyconfiguration_packages) --output-package $(kube_applyconfiguration_package) -h $(kube_go_header_text) # generate clientsets for kube api types - @$(client_gen) --clientset-name $(kube_clientset_name) --input-base "" --input $(kube_api_packages) --output-package $(kube_clientset_package) -h $(kube_go_header_text) + @$(client_gen) --clientset-name $(kube_clientset_name) --input-base "" --input $(kube_api_packages) --output-package $(kube_clientset_package) -h $(kube_go_header_text) --apply-configuration-package $(kube_applyconfiguration_package) # generate listers for kube api types @$(lister_gen) --input-dirs $(kube_api_packages) --output-package $(kube_listers_package) -h $(kube_go_header_text) # generate informers for kube api types @@ -88,6 +95,6 @@ generate-k8s-client: .PHONY: clean-k8s-client -clean-k8s-client: +clean-k8s-cliennt: # remove generated code @rm -rf pkg/ diff --git a/client/pkg/apis/extensions/v1alpha1/types.gen.go b/client/pkg/apis/extensions/v1alpha1/types.gen.go index 412046234..48594cce4 100644 --- a/client/pkg/apis/extensions/v1alpha1/types.gen.go +++ b/client/pkg/apis/extensions/v1alpha1/types.gen.go @@ -65,5 +65,5 @@ type WasmPluginList struct { v1.TypeMeta `json:",inline"` // +optional v1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - Items []WasmPlugin `json:"items" protobuf:"bytes,2,rep,name=items"` + Items []*WasmPlugin `json:"items" protobuf:"bytes,2,rep,name=items"` } diff --git a/client/pkg/apis/extensions/v1alpha1/zz_generated.deepcopy.gen.go b/client/pkg/apis/extensions/v1alpha1/zz_generated.deepcopy.gen.go index 8ceb8a8b7..94caa3d6d 100644 --- a/client/pkg/apis/extensions/v1alpha1/zz_generated.deepcopy.gen.go +++ b/client/pkg/apis/extensions/v1alpha1/zz_generated.deepcopy.gen.go @@ -58,9 +58,13 @@ func (in *WasmPluginList) DeepCopyInto(out *WasmPluginList) { in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]WasmPlugin, len(*in)) + *out = make([]*WasmPlugin, len(*in)) for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(WasmPlugin) + (*in).DeepCopyInto(*out) + } } } return diff --git a/client/pkg/apis/networking/v1/types.gen.go b/client/pkg/apis/networking/v1/types.gen.go index 90173090e..05edb384b 100644 --- a/client/pkg/apis/networking/v1/types.gen.go +++ b/client/pkg/apis/networking/v1/types.gen.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// please upgrade the proto package +// // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object //