refactor(v2): upgrade module to github.com/alibaba/higress/v2 (#2922)

Signed-off-by: Xijun Dai <daixijun1990@gmail.com>
This commit is contained in:
Xijun Dai
2025-09-21 14:29:07 +08:00
committed by GitHub
parent cd2082033c
commit 47827ad271
235 changed files with 1077 additions and 1045 deletions

View File

@@ -10,7 +10,7 @@ export BASE_VERSION ?= $(HIGRESS_BASE_VERSION)
export CHARTS ?= higress-registry.cn-hangzhou.cr.aliyuncs.com/charts
VERSION_PACKAGE := github.com/alibaba/higress/pkg/cmd/lversion
VERSION_PACKAGE := github.com/alibaba/higress/v2/pkg/cmd/lversion
GIT_COMMIT:=$(shell git rev-parse HEAD)

View File

@@ -1,6 +1,6 @@
# Cuelang configuration to generate OpenAPI schema for Higress configs.
module: github.com/alibaba/higress/api
module: github.com/alibaba/higress/v2/api
openapi:
selfContained: true

View File

@@ -24,7 +24,7 @@ import "google/protobuf/struct.proto";
package higress.extensions.v1alpha1;
option go_package="github.com/alibaba/higress/api/extensions/v1alpha1";
option go_package="github.com/alibaba/higress/v2/api/extensions/v1alpha1";
// <!-- crd generation tags
// +cue-gen:WasmPlugin:groupName:extensions.higress.io

View File

@@ -7,5 +7,5 @@ buf generate \
--path networking \
--path extensions
# Generate CRDs
# Generate CRDs
cue-gen -verbose -f=./cue.yaml -crd=true

View File

@@ -1,11 +1,11 @@
// 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.
@@ -23,7 +23,7 @@ import "google/api/field_behavior.proto";
package higress.networking.v1;
option go_package = "github.com/alibaba/higress/api/networking/v1";
option go_package = "github.com/alibaba/higress/v2/api/networking/v1";
// <!-- crd generation tags
// +cue-gen:Http2Rpc:groupName:networking.higress.io

View File

@@ -1,11 +1,11 @@
// 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.
@@ -25,7 +25,7 @@ import "google/protobuf/struct.proto";
package higress.networking.v1;
option go_package = "github.com/alibaba/higress/api/networking/v1";
option go_package = "github.com/alibaba/higress/v2/api/networking/v1";
// <!-- crd generation tags
// +cue-gen:McpBridge:groupName:networking.higress.io
@@ -50,7 +50,7 @@ message McpBridge {
}
message RegistryConfig {
string type = 1 [(google.api.field_behavior) = REQUIRED];
string type = 1 [(google.api.field_behavior) = REQUIRED];
string name = 2;
string domain = 3 [(google.api.field_behavior) = REQUIRED];
uint32 port = 4 [(google.api.field_behavior) = REQUIRED];

View File

@@ -29,12 +29,12 @@ comma := ,
# source packages to scan for kubetype-gen tags
kube_source_packages = $(subst $(space),$(empty), \
github.com/alibaba/higress/api/networking/v1, \
github.com/alibaba/higress/api/extensions/v1alpha1 \
github.com/alibaba/higress/v2/api/networking/v1, \
github.com/alibaba/higress/v2/api/extensions/v1alpha1 \
)
# base output package for generated files
kube_base_output_package = github.com/alibaba/higress/client/pkg
kube_base_output_package = github.com/alibaba/higress/v2/client/pkg
# base output package for kubernetes types, register, etc...
kube_api_base_package = $(kube_base_output_package)/apis
# source packages to scan for kubernetes generator tags, e.g. deepcopy-gen, client-gen, etc.
@@ -72,7 +72,7 @@ else
endif
rename_generated_files=\
find $(subst github.com/alibaba/higress/client/, $(empty), $(subst $(comma), $(space), $(kube_api_packages)) $(kube_clientset_package) $(kube_listers_package) $(kube_informers_package)) \
find $(subst github.com/alibaba/higress/v2/client/, $(empty), $(subst $(comma), $(space), $(kube_api_packages)) $(kube_clientset_package) $(kube_listers_package) $(kube_informers_package)) \
-name '*.go' -and -not -name 'doc.go' -and -not -name '*.gen.go' -type f -exec sh -c 'mv "$$1" "$${1%.go}".gen.go' - '{}' \;
.PHONY: generate-k8s-client

View File

@@ -17,7 +17,7 @@
package v1alpha1
import (
extensionsv1alpha1 "github.com/alibaba/higress/api/extensions/v1alpha1"
extensionsv1alpha1 "github.com/alibaba/higress/v2/api/extensions/v1alpha1"
metav1alpha1 "istio.io/api/meta/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

View File

@@ -17,7 +17,7 @@
package v1
import (
networkingv1 "github.com/alibaba/higress/api/networking/v1"
networkingv1 "github.com/alibaba/higress/v2/api/networking/v1"
v1alpha1 "istio.io/api/meta/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

View File

@@ -17,8 +17,8 @@
package v1alpha1
import (
v1alpha1 "github.com/alibaba/higress/api/extensions/v1alpha1"
v1 "github.com/alibaba/higress/client/pkg/applyconfiguration/meta/v1"
v1alpha1 "github.com/alibaba/higress/v2/api/extensions/v1alpha1"
v1 "github.com/alibaba/higress/v2/client/pkg/applyconfiguration/meta/v1"
metav1alpha1 "istio.io/api/meta/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"

View File

@@ -17,8 +17,8 @@
package v1
import (
networkingv1 "github.com/alibaba/higress/api/networking/v1"
v1 "github.com/alibaba/higress/client/pkg/applyconfiguration/meta/v1"
networkingv1 "github.com/alibaba/higress/v2/api/networking/v1"
v1 "github.com/alibaba/higress/v2/client/pkg/applyconfiguration/meta/v1"
v1alpha1 "istio.io/api/meta/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"

View File

@@ -17,8 +17,8 @@
package v1
import (
networkingv1 "github.com/alibaba/higress/api/networking/v1"
v1 "github.com/alibaba/higress/client/pkg/applyconfiguration/meta/v1"
networkingv1 "github.com/alibaba/higress/v2/api/networking/v1"
v1 "github.com/alibaba/higress/v2/client/pkg/applyconfiguration/meta/v1"
v1alpha1 "istio.io/api/meta/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"

View File

@@ -17,11 +17,11 @@
package applyconfiguration
import (
v1alpha1 "github.com/alibaba/higress/client/pkg/apis/extensions/v1alpha1"
networkingv1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
extensionsv1alpha1 "github.com/alibaba/higress/client/pkg/applyconfiguration/extensions/v1alpha1"
metav1 "github.com/alibaba/higress/client/pkg/applyconfiguration/meta/v1"
applyconfigurationnetworkingv1 "github.com/alibaba/higress/client/pkg/applyconfiguration/networking/v1"
v1alpha1 "github.com/alibaba/higress/v2/client/pkg/apis/extensions/v1alpha1"
networkingv1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
extensionsv1alpha1 "github.com/alibaba/higress/v2/client/pkg/applyconfiguration/extensions/v1alpha1"
metav1 "github.com/alibaba/higress/v2/client/pkg/applyconfiguration/meta/v1"
applyconfigurationnetworkingv1 "github.com/alibaba/higress/v2/client/pkg/applyconfiguration/networking/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
schema "k8s.io/apimachinery/pkg/runtime/schema"
)

View File

@@ -20,8 +20,8 @@ import (
"fmt"
"net/http"
extensionsv1alpha1 "github.com/alibaba/higress/client/pkg/clientset/versioned/typed/extensions/v1alpha1"
networkingv1 "github.com/alibaba/higress/client/pkg/clientset/versioned/typed/networking/v1"
extensionsv1alpha1 "github.com/alibaba/higress/v2/client/pkg/clientset/versioned/typed/extensions/v1alpha1"
networkingv1 "github.com/alibaba/higress/v2/client/pkg/clientset/versioned/typed/networking/v1"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"

View File

@@ -17,11 +17,11 @@
package fake
import (
clientset "github.com/alibaba/higress/client/pkg/clientset/versioned"
extensionsv1alpha1 "github.com/alibaba/higress/client/pkg/clientset/versioned/typed/extensions/v1alpha1"
fakeextensionsv1alpha1 "github.com/alibaba/higress/client/pkg/clientset/versioned/typed/extensions/v1alpha1/fake"
networkingv1 "github.com/alibaba/higress/client/pkg/clientset/versioned/typed/networking/v1"
fakenetworkingv1 "github.com/alibaba/higress/client/pkg/clientset/versioned/typed/networking/v1/fake"
clientset "github.com/alibaba/higress/v2/client/pkg/clientset/versioned"
extensionsv1alpha1 "github.com/alibaba/higress/v2/client/pkg/clientset/versioned/typed/extensions/v1alpha1"
fakeextensionsv1alpha1 "github.com/alibaba/higress/v2/client/pkg/clientset/versioned/typed/extensions/v1alpha1/fake"
networkingv1 "github.com/alibaba/higress/v2/client/pkg/clientset/versioned/typed/networking/v1"
fakenetworkingv1 "github.com/alibaba/higress/v2/client/pkg/clientset/versioned/typed/networking/v1/fake"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"

View File

@@ -17,8 +17,8 @@
package fake
import (
extensionsv1alpha1 "github.com/alibaba/higress/client/pkg/apis/extensions/v1alpha1"
networkingv1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
extensionsv1alpha1 "github.com/alibaba/higress/v2/client/pkg/apis/extensions/v1alpha1"
networkingv1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@@ -26,8 +26,10 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
var scheme = runtime.NewScheme()
var codecs = serializer.NewCodecFactory(scheme)
var (
scheme = runtime.NewScheme()
codecs = serializer.NewCodecFactory(scheme)
)
var localSchemeBuilder = runtime.SchemeBuilder{
extensionsv1alpha1.AddToScheme,

View File

@@ -17,8 +17,8 @@
package scheme
import (
extensionsv1alpha1 "github.com/alibaba/higress/client/pkg/apis/extensions/v1alpha1"
networkingv1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
extensionsv1alpha1 "github.com/alibaba/higress/v2/client/pkg/apis/extensions/v1alpha1"
networkingv1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@@ -26,13 +26,15 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
var Scheme = runtime.NewScheme()
var Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
extensionsv1alpha1.AddToScheme,
networkingv1.AddToScheme,
}
var (
Scheme = runtime.NewScheme()
Codecs = serializer.NewCodecFactory(Scheme)
ParameterCodec = runtime.NewParameterCodec(Scheme)
localSchemeBuilder = runtime.SchemeBuilder{
extensionsv1alpha1.AddToScheme,
networkingv1.AddToScheme,
}
)
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:

View File

@@ -19,8 +19,8 @@ package v1alpha1
import (
"net/http"
v1alpha1 "github.com/alibaba/higress/client/pkg/apis/extensions/v1alpha1"
"github.com/alibaba/higress/client/pkg/clientset/versioned/scheme"
v1alpha1 "github.com/alibaba/higress/v2/client/pkg/apis/extensions/v1alpha1"
"github.com/alibaba/higress/v2/client/pkg/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)

View File

@@ -17,7 +17,7 @@
package fake
import (
v1alpha1 "github.com/alibaba/higress/client/pkg/clientset/versioned/typed/extensions/v1alpha1"
v1alpha1 "github.com/alibaba/higress/v2/client/pkg/clientset/versioned/typed/extensions/v1alpha1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)

View File

@@ -21,8 +21,8 @@ import (
json "encoding/json"
"fmt"
v1alpha1 "github.com/alibaba/higress/client/pkg/apis/extensions/v1alpha1"
extensionsv1alpha1 "github.com/alibaba/higress/client/pkg/applyconfiguration/extensions/v1alpha1"
v1alpha1 "github.com/alibaba/higress/v2/client/pkg/apis/extensions/v1alpha1"
extensionsv1alpha1 "github.com/alibaba/higress/v2/client/pkg/applyconfiguration/extensions/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
@@ -77,7 +77,6 @@ func (c *FakeWasmPlugins) List(ctx context.Context, opts v1.ListOptions) (result
func (c *FakeWasmPlugins) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(wasmpluginsResource, c.ns, opts))
}
// Create takes the representation of a wasmPlugin and creates it. Returns the server's representation of the wasmPlugin, and an error, if there is any.

View File

@@ -22,9 +22,9 @@ import (
"fmt"
"time"
v1alpha1 "github.com/alibaba/higress/client/pkg/apis/extensions/v1alpha1"
extensionsv1alpha1 "github.com/alibaba/higress/client/pkg/applyconfiguration/extensions/v1alpha1"
scheme "github.com/alibaba/higress/client/pkg/clientset/versioned/scheme"
v1alpha1 "github.com/alibaba/higress/v2/client/pkg/apis/extensions/v1alpha1"
extensionsv1alpha1 "github.com/alibaba/higress/v2/client/pkg/applyconfiguration/extensions/v1alpha1"
scheme "github.com/alibaba/higress/v2/client/pkg/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"

View File

@@ -21,8 +21,8 @@ import (
json "encoding/json"
"fmt"
v1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
networkingv1 "github.com/alibaba/higress/client/pkg/applyconfiguration/networking/v1"
v1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
networkingv1 "github.com/alibaba/higress/v2/client/pkg/applyconfiguration/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
@@ -77,7 +77,6 @@ func (c *FakeHttp2Rpcs) List(ctx context.Context, opts metav1.ListOptions) (resu
func (c *FakeHttp2Rpcs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(http2rpcsResource, c.ns, opts))
}
// Create takes the representation of a http2Rpc and creates it. Returns the server's representation of the http2Rpc, and an error, if there is any.

View File

@@ -21,8 +21,8 @@ import (
json "encoding/json"
"fmt"
v1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
networkingv1 "github.com/alibaba/higress/client/pkg/applyconfiguration/networking/v1"
v1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
networkingv1 "github.com/alibaba/higress/v2/client/pkg/applyconfiguration/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
@@ -77,7 +77,6 @@ func (c *FakeMcpBridges) List(ctx context.Context, opts metav1.ListOptions) (res
func (c *FakeMcpBridges) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(mcpbridgesResource, c.ns, opts))
}
// Create takes the representation of a mcpBridge and creates it. Returns the server's representation of the mcpBridge, and an error, if there is any.

View File

@@ -17,7 +17,7 @@
package fake
import (
v1 "github.com/alibaba/higress/client/pkg/clientset/versioned/typed/networking/v1"
v1 "github.com/alibaba/higress/v2/client/pkg/clientset/versioned/typed/networking/v1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)

View File

@@ -22,9 +22,9 @@ import (
"fmt"
"time"
v1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
networkingv1 "github.com/alibaba/higress/client/pkg/applyconfiguration/networking/v1"
scheme "github.com/alibaba/higress/client/pkg/clientset/versioned/scheme"
v1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
networkingv1 "github.com/alibaba/higress/v2/client/pkg/applyconfiguration/networking/v1"
scheme "github.com/alibaba/higress/v2/client/pkg/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"

View File

@@ -22,9 +22,9 @@ import (
"fmt"
"time"
v1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
networkingv1 "github.com/alibaba/higress/client/pkg/applyconfiguration/networking/v1"
scheme "github.com/alibaba/higress/client/pkg/clientset/versioned/scheme"
v1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
networkingv1 "github.com/alibaba/higress/v2/client/pkg/applyconfiguration/networking/v1"
scheme "github.com/alibaba/higress/v2/client/pkg/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"

View File

@@ -19,8 +19,8 @@ package v1
import (
"net/http"
v1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
"github.com/alibaba/higress/client/pkg/clientset/versioned/scheme"
v1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
"github.com/alibaba/higress/v2/client/pkg/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)

View File

@@ -17,8 +17,8 @@
package extensions
import (
v1alpha1 "github.com/alibaba/higress/client/pkg/informers/externalversions/extensions/v1alpha1"
internalinterfaces "github.com/alibaba/higress/client/pkg/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/alibaba/higress/v2/client/pkg/informers/externalversions/extensions/v1alpha1"
internalinterfaces "github.com/alibaba/higress/v2/client/pkg/informers/externalversions/internalinterfaces"
)
// Interface provides access to each of this group's versions.

View File

@@ -17,7 +17,7 @@
package v1alpha1
import (
internalinterfaces "github.com/alibaba/higress/client/pkg/informers/externalversions/internalinterfaces"
internalinterfaces "github.com/alibaba/higress/v2/client/pkg/informers/externalversions/internalinterfaces"
)
// Interface provides access to all the informers in this group version.

View File

@@ -20,10 +20,10 @@ import (
"context"
time "time"
extensionsv1alpha1 "github.com/alibaba/higress/client/pkg/apis/extensions/v1alpha1"
versioned "github.com/alibaba/higress/client/pkg/clientset/versioned"
internalinterfaces "github.com/alibaba/higress/client/pkg/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/alibaba/higress/client/pkg/listers/extensions/v1alpha1"
extensionsv1alpha1 "github.com/alibaba/higress/v2/client/pkg/apis/extensions/v1alpha1"
versioned "github.com/alibaba/higress/v2/client/pkg/clientset/versioned"
internalinterfaces "github.com/alibaba/higress/v2/client/pkg/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/alibaba/higress/v2/client/pkg/listers/extensions/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"

View File

@@ -21,10 +21,10 @@ import (
sync "sync"
time "time"
versioned "github.com/alibaba/higress/client/pkg/clientset/versioned"
extensions "github.com/alibaba/higress/client/pkg/informers/externalversions/extensions"
internalinterfaces "github.com/alibaba/higress/client/pkg/informers/externalversions/internalinterfaces"
networking "github.com/alibaba/higress/client/pkg/informers/externalversions/networking"
versioned "github.com/alibaba/higress/v2/client/pkg/clientset/versioned"
extensions "github.com/alibaba/higress/v2/client/pkg/informers/externalversions/extensions"
internalinterfaces "github.com/alibaba/higress/v2/client/pkg/informers/externalversions/internalinterfaces"
networking "github.com/alibaba/higress/v2/client/pkg/informers/externalversions/networking"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"

View File

@@ -19,8 +19,8 @@ package externalversions
import (
"fmt"
v1alpha1 "github.com/alibaba/higress/client/pkg/apis/extensions/v1alpha1"
v1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
v1alpha1 "github.com/alibaba/higress/v2/client/pkg/apis/extensions/v1alpha1"
v1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
)

View File

@@ -19,7 +19,7 @@ package internalinterfaces
import (
time "time"
versioned "github.com/alibaba/higress/client/pkg/clientset/versioned"
versioned "github.com/alibaba/higress/v2/client/pkg/clientset/versioned"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
cache "k8s.io/client-go/tools/cache"

View File

@@ -17,8 +17,8 @@
package networking
import (
internalinterfaces "github.com/alibaba/higress/client/pkg/informers/externalversions/internalinterfaces"
v1 "github.com/alibaba/higress/client/pkg/informers/externalversions/networking/v1"
internalinterfaces "github.com/alibaba/higress/v2/client/pkg/informers/externalversions/internalinterfaces"
v1 "github.com/alibaba/higress/v2/client/pkg/informers/externalversions/networking/v1"
)
// Interface provides access to each of this group's versions.

View File

@@ -20,10 +20,10 @@ import (
"context"
time "time"
networkingv1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
versioned "github.com/alibaba/higress/client/pkg/clientset/versioned"
internalinterfaces "github.com/alibaba/higress/client/pkg/informers/externalversions/internalinterfaces"
v1 "github.com/alibaba/higress/client/pkg/listers/networking/v1"
networkingv1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
versioned "github.com/alibaba/higress/v2/client/pkg/clientset/versioned"
internalinterfaces "github.com/alibaba/higress/v2/client/pkg/informers/externalversions/internalinterfaces"
v1 "github.com/alibaba/higress/v2/client/pkg/listers/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"

View File

@@ -17,7 +17,7 @@
package v1
import (
internalinterfaces "github.com/alibaba/higress/client/pkg/informers/externalversions/internalinterfaces"
internalinterfaces "github.com/alibaba/higress/v2/client/pkg/informers/externalversions/internalinterfaces"
)
// Interface provides access to all the informers in this group version.

View File

@@ -20,10 +20,10 @@ import (
"context"
time "time"
networkingv1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
versioned "github.com/alibaba/higress/client/pkg/clientset/versioned"
internalinterfaces "github.com/alibaba/higress/client/pkg/informers/externalversions/internalinterfaces"
v1 "github.com/alibaba/higress/client/pkg/listers/networking/v1"
networkingv1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
versioned "github.com/alibaba/higress/v2/client/pkg/clientset/versioned"
internalinterfaces "github.com/alibaba/higress/v2/client/pkg/informers/externalversions/internalinterfaces"
v1 "github.com/alibaba/higress/v2/client/pkg/listers/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"

View File

@@ -17,7 +17,7 @@
package v1alpha1
import (
v1alpha1 "github.com/alibaba/higress/client/pkg/apis/extensions/v1alpha1"
v1alpha1 "github.com/alibaba/higress/v2/client/pkg/apis/extensions/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"

View File

@@ -17,7 +17,7 @@
package v1
import (
v1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
v1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"

View File

@@ -17,7 +17,7 @@
package v1
import (
v1 "github.com/alibaba/higress/client/pkg/apis/networking/v1"
v1 "github.com/alibaba/higress/v2/client/pkg/apis/networking/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"

View File

@@ -20,7 +20,7 @@ import (
"istio.io/pkg/log"
"github.com/alibaba/higress/pkg/cmd"
"github.com/alibaba/higress/v2/pkg/cmd"
)
func main() {

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/alibaba/higress
module github.com/alibaba/higress/v2
go 1.22.2

View File

@@ -27,7 +27,7 @@ import (
"sigs.k8s.io/yaml"
"github.com/alibaba/higress/hgctl/pkg/kubernetes"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
)
var (

View File

@@ -148,7 +148,8 @@ func TestExtractSubResourcesConfigDump(t *testing.T) {
output: "yaml",
resourceType: BootstrapEnvoyConfigType,
expected: "out.bootstrap.yaml",
}, {
},
{
output: "json",
resourceType: ClusterEnvoyConfigType,
expected: "out.cluster.json",
@@ -157,7 +158,8 @@ func TestExtractSubResourcesConfigDump(t *testing.T) {
output: "yaml",
resourceType: ClusterEnvoyConfigType,
expected: "out.cluster.yaml",
}, {
},
{
output: "json",
resourceType: ListenerEnvoyConfigType,
expected: "out.listener.json",
@@ -166,7 +168,8 @@ func TestExtractSubResourcesConfigDump(t *testing.T) {
output: "yaml",
resourceType: ListenerEnvoyConfigType,
expected: "out.listener.yaml",
}, {
},
{
output: "json",
resourceType: RouteEnvoyConfigType,
expected: "out.route.json",

View File

@@ -18,7 +18,7 @@ import (
"fmt"
"os"
"github.com/alibaba/higress/hgctl/pkg"
hgctl "github.com/alibaba/higress/hgctl/pkg"
)
func main() {

View File

@@ -15,9 +15,11 @@ replace github.com/docker/distribution => github.com/docker/distribution v0.0.0-
// Client-go does not handle different versions of mergo due to some breaking changes - use the matching version
replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.5
replace github.com/alibaba/higress/v2 => ../
require (
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/alibaba/higress v0.0.0
github.com/alibaba/higress/v2 v2.0.0-00010101000000-000000000000
github.com/compose-spec/compose-go v1.17.0
github.com/docker/cli v24.0.7+incompatible
github.com/docker/compose/v2 v2.23.3

View File

@@ -18,7 +18,7 @@ import (
"fmt"
"github.com/alibaba/higress/hgctl/cmd/hgctl/config"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
"github.com/spf13/cobra"
cmdutil "k8s.io/kubectl/pkg/cmd/util"
)

View File

@@ -30,7 +30,7 @@ import (
"github.com/alibaba/higress/hgctl/pkg/docker"
"github.com/alibaba/higress/hgctl/pkg/kubernetes"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
)
var (
@@ -418,7 +418,6 @@ func openBrowser(url string, writer io.Writer, browser bool) {
default:
fmt.Fprintf(writer, "Unsupported platform %q; open %s in your browser.\n", runtime.GOOS, url)
}
}
func openCommand(writer io.Writer, command string, args ...string) {

View File

@@ -137,7 +137,6 @@ func GenerateConfig(inFilenames []string, setFlags []string) (string, *Profile,
}
profileString, profile, err := GenProfile(profileName, valuesOverlay, setFlags)
if err != nil {
return "", nil, "", err
}

View File

@@ -652,14 +652,14 @@ func TestK8sObject_ResolveK8sConflict(t *testing.T) {
kind: PodDisruptionBudget
metadata:
name: istio
spec:
spec:
maxUnavailable: 3`),
o2: getK8sObject(`
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: istio
spec:
spec:
maxUnavailable: 3`),
},
{
@@ -669,7 +669,7 @@ func TestK8sObject_ResolveK8sConflict(t *testing.T) {
kind: PodDisruptionBudget
metadata:
name: istio
spec:
spec:
maxUnavailable: 50%
minAvailable: 3`),
o2: getK8sObject(`
@@ -677,7 +677,7 @@ func TestK8sObject_ResolveK8sConflict(t *testing.T) {
kind: PodDisruptionBudget
metadata:
name: istio
spec:
spec:
maxUnavailable: 50%`),
},
{
@@ -687,7 +687,7 @@ func TestK8sObject_ResolveK8sConflict(t *testing.T) {
kind: PodDisruptionBudget
metadata:
name: istio
spec:
spec:
minAvailable: 0
maxUnavailable: 0`),
o2: getK8sObject(`

View File

@@ -585,7 +585,6 @@ func locateChart(cpOpts *action.ChartPathOptions, name string, settings *cli.Env
}
func ParseLatestVersion(repoUrl string, version string, devel bool) (string, error) {
cpOpts := &action.ChartPathOptions{
RepoURL: repoUrl,
Version: version,
@@ -603,7 +602,6 @@ func ParseLatestVersion(repoUrl string, version string, devel bool) (string, err
}
client, err := getter.All(settings).ByScheme(u.Scheme)
if err != nil {
return "", fmt.Errorf("could not find protocol handler for: %s", u.Scheme)
}
@@ -615,7 +613,6 @@ func ParseLatestVersion(repoUrl string, version string, devel bool) (string, err
getter.WithBasicAuth(cpOpts.Username, cpOpts.Password),
getter.WithPassCredentialsAll(cpOpts.PassCredentialsAll),
)
if err != nil {
return "", err
}

View File

@@ -63,7 +63,6 @@ func GetPathContext(root any, path util.Path, createMissing bool) (*PathContext,
// WritePathContext writes the given value to the Node in the given PathContext.
func WritePathContext(nc *PathContext, value any, merge bool) error {
if !util.IsValueNil(value) {
return setPathContext(nc, value, merge)
}

View File

@@ -114,7 +114,7 @@ a:
desc: "ModifyListEntryMapValue",
path: `a.b.[name:n2]`,
value: `name: n2
list:
list:
- nk1: nv1
- nk2: nv2`,
wantFound: true,
@@ -503,7 +503,7 @@ a: {}
want: `
a:
list:
- v1
- v1
`,
},
{
@@ -517,7 +517,7 @@ a:
value: `v2`,
want: `
a:
list:
list:
- v1
- v2
`,

View File

@@ -22,7 +22,7 @@ import (
"github.com/alibaba/higress/hgctl/pkg/helm"
"github.com/alibaba/higress/hgctl/pkg/installer"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
"github.com/spf13/cobra"
)
@@ -91,8 +91,8 @@ func newInstallCmd() *cobra.Command {
Example: ` # Apply a default higress installation
hgctl install
# Install higress on local kubernetes cluster
hgctl install --set profile=local-k8s
# Install higress on local kubernetes cluster
hgctl install --set profile=local-k8s
# Install higress on local docker environment with specific gateway port
hgctl install --set profile=local-docker --set gateway.httpPort=80 --set gateway.httpsPort=443
@@ -192,7 +192,6 @@ func promptProfileName(writer io.Writer) string {
return profileNameLocalDocker
}
}
}
func installManifests(profile *helm.Profile, writer io.Writer, devel bool) error {

View File

@@ -22,7 +22,7 @@ import (
"strings"
"github.com/alibaba/higress/hgctl/pkg/helm"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
)
type HelmRelease struct {

View File

@@ -24,7 +24,7 @@ import (
"github.com/alibaba/higress/hgctl/pkg/helm"
"github.com/alibaba/higress/hgctl/pkg/kubernetes"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
"k8s.io/client-go/util/homedir"
)

View File

@@ -48,7 +48,6 @@ func (d *DockerInstaller) Install() error {
}
func (d *DockerInstaller) UnInstall() error {
fmt.Fprintf(d.writer, "\n⌛ Processing uninstallation... \n\n")
if err := d.standalone.UnInstall(); err != nil {

View File

@@ -59,7 +59,7 @@ type FileDirProfileStore struct {
func (f *FileDirProfileStore) Save(profile *helm.Profile) (string, error) {
namespace := profile.Global.Namespace
install := profile.Global.Install
var profileName = ""
profileName := ""
if install == helm.InstallK8s || install == helm.InstallLocalK8s {
profileName = filepath.Join(f.profilesPath, fmt.Sprintf("%s-%s.yaml", ProfileFilePrefix, namespace))
} else {
@@ -109,7 +109,7 @@ func (f *FileDirProfileStore) List() ([]*ProfileContext, error) {
func (f *FileDirProfileStore) Delete(profile *helm.Profile) (string, error) {
namespace := profile.Global.Namespace
install := profile.Global.Install
var profileName = ""
profileName := ""
if install == helm.InstallK8s || install == helm.InstallLocalK8s {
profileName = filepath.Join(f.profilesPath, fmt.Sprintf("%s-%s.yaml", ProfileFilePrefix, namespace))
} else {

View File

@@ -22,7 +22,7 @@ import (
"github.com/alibaba/higress/hgctl/pkg/helm"
"github.com/alibaba/higress/hgctl/pkg/installer"
"github.com/alibaba/higress/hgctl/pkg/kubernetes"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
"github.com/spf13/cobra"
)

View File

@@ -423,13 +423,11 @@ func (b *Builder) filesHandler() error {
return nil
}
var (
optionalProducts = [][2]string{
{"README_ZH.md", MediaTypeREADME_ZH},
{"README_EN.md", MediaTypeREADME_EN},
{"icon.png", MediaTypeIcon},
}
)
var optionalProducts = [][2]string{
{"README_ZH.md", MediaTypeREADME_ZH},
{"README_EN.md", MediaTypeREADME_EN},
{"icon.png", MediaTypeIcon},
}
// TODO(WeixinX): If the image exists, no push is performed
func (b *Builder) imageHandler() error {
@@ -536,7 +534,7 @@ func (b *Builder) config(f ConfigFunc) (err error) {
if err != nil {
return errors.Wrapf(err, "failed to parse output destination %q", b.Output.Dest)
}
err = os.MkdirAll(b.Output.Dest, 0755)
err = os.MkdirAll(b.Output.Dest, 0o755)
if err != nil && !os.IsExist(err) {
return errors.Wrapf(err, "failed to create output destination %q", b.Output.Dest)
}
@@ -574,7 +572,7 @@ func (b *Builder) config(f ConfigFunc) (err error) {
if err != nil && !os.IsExist(err) {
return errors.Wrap(err, "failed to create the docker entrypoint file")
}
err = dockerEp.Chmod(0777)
err = dockerEp.Chmod(0o777)
if err != nil {
return err
}

View File

@@ -47,11 +47,11 @@ cd {{ .BuildDestDir }}
tar czf plugin.tar.gz plugin.wasm
cmd="{{ .BasicCmd }}"
products=({{ .Products }})
for ((i=0; i<${#products[*]}; i=i+2)); do
for ((i=0; i<${#products[*]}; i=i+2)); do
f=${products[i]}
typ=${products[i+1]}
if [ -e ${f} ]; then
cmd="${cmd} ./${f}:${typ}"
if [ -e ${f} ]; then
cmd="${cmd} ./${f}:${typ}"
fi
done
cmd="${cmd} ./plugin.tar.gz:{{ .MediaTypePlugin }}"
@@ -79,7 +79,7 @@ type ImageTmplFields struct {
}
func genFilesDockerEntrypoint(ft *FilesTmplFields, target string) error {
f, err := os.OpenFile(target, os.O_CREATE|os.O_WRONLY, 0777)
f, err := os.OpenFile(target, os.O_CREATE|os.O_WRONLY, 0o777)
if err != nil {
return err
}
@@ -93,7 +93,7 @@ func genFilesDockerEntrypoint(ft *FilesTmplFields, target string) error {
}
func genImageDockerEntrypoint(it *ImageTmplFields, target string) error {
f, err := os.OpenFile(target, os.O_CREATE|os.O_WRONLY, 0777)
f, err := os.OpenFile(target, os.O_CREATE|os.O_WRONLY, 0o777)
if err != nil {
return err
}

View File

@@ -49,7 +49,7 @@ func create(w io.Writer, target string) error {
if err != nil {
return errors.Wrap(err, "invalid target path")
}
if err = os.MkdirAll(target, 0755); err != nil {
if err = os.MkdirAll(target, 0o755); err != nil {
return err
}
if err = GenPluginConfYAML(configHelpTmpl, target); err != nil {

View File

@@ -22,7 +22,7 @@ import (
"os"
k8s "github.com/alibaba/higress/hgctl/pkg/kubernetes"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
"github.com/pkg/errors"
"github.com/spf13/cobra"

View File

@@ -156,5 +156,4 @@ func (pc *PluginConf) withDefaultValue() {
if pc.Phase == "" {
pc.Phase = string(types.PhaseDefault)
}
}

View File

@@ -63,7 +63,7 @@ func runInit(w io.Writer, target string) (err error) {
return errors.Wrap(err, "invalid target directory")
}
dir := fmt.Sprintf("%s/%s", target, ans.Name)
err = os.MkdirAll(dir, 0755)
err = os.MkdirAll(dir, 0o755)
defer func() {
if err != nil {
os.RemoveAll(dir)

View File

@@ -28,7 +28,7 @@ import (
"github.com/alibaba/higress/hgctl/pkg/plugin/option"
"github.com/alibaba/higress/hgctl/pkg/plugin/types"
"github.com/alibaba/higress/hgctl/pkg/plugin/utils"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
"github.com/AlecAivazis/survey/v2/terminal"
"github.com/pkg/errors"

View File

@@ -21,7 +21,7 @@ import (
"time"
k8s "github.com/alibaba/higress/hgctl/pkg/kubernetes"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
"github.com/pkg/errors"
"github.com/spf13/cobra"

View File

@@ -51,7 +51,7 @@ func newCreateCommand() *cobra.Command {
Example: ` # If the option.yaml file exists in the current path, do the following:
hgctl plugin test create
# Explicitly specify the source of the parameters (directory of the build
# Explicitly specify the source of the parameters (directory of the build
products) and the directory where the test configuration files is stored
hgctl plugin test create -d ./out -t ./test
`,
@@ -139,9 +139,8 @@ func (c *creator) create() (err error) {
fields.Envoy = &Envoy{JSONExample: jsExample}
// 4. generate corresponding test files
if err = os.MkdirAll(target, 0755); err != nil {
if err = os.MkdirAll(target, 0o755); err != nil {
return errors.Wrap(err, "failed to create the test environment")
}
if err = c.genTestConfFiles(fields); err != nil {
return errors.Wrap(err, "failed to create the test environment")

View File

@@ -22,10 +22,12 @@ type TestExStruct struct {
three []bool
}
type ExPointerInt **int
type ExBool bool
type ExSlice []*string
type ExAlias nested.TestNestedStruct
type (
ExPointerInt **int
ExBool bool
ExSlice []*string
ExAlias nested.TestNestedStruct
)
type TestNestedStruct struct {
NestedStruct *nested.TestNestedStruct

View File

@@ -44,11 +44,13 @@ type TestAliasStruct struct {
MyStruct MyStruct
}
type MyString string
type MyPointerInt *int
type MyStruct TestBasicStruct
type NestedAlias ext.ExAlias
type NestedBasicAlias ext.ExBool
type (
MyString string
MyPointerInt *int
MyStruct TestBasicStruct
NestedAlias ext.ExAlias
NestedBasicAlias ext.ExBool
)
type TestExternalStruct struct {
InternalFloat float64
@@ -62,8 +64,7 @@ type TestNestedStruct struct {
NestedStruct *ext.TestNestedStruct
}
type MyInterface interface {
}
type MyInterface interface{}
var MyConst bool

View File

@@ -20,7 +20,7 @@ import (
"io"
k8s "github.com/alibaba/higress/hgctl/pkg/kubernetes"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
"github.com/pkg/errors"
"github.com/spf13/cobra"

View File

@@ -61,7 +61,7 @@ func profileDump(cmd *cobra.Command, args []string, pdArgs *profileDumpArgs) err
return err
}
if len(pdArgs.output) > 0 {
err2 := os.WriteFile(pdArgs.output, []byte(yaml), 0644)
err2 := os.WriteFile(pdArgs.output, []byte(yaml), 0o644)
if err2 != nil {
return err2
}

View File

@@ -44,7 +44,6 @@ func profileListCmd(plArgs *profileListArgs) *cobra.Command {
// profileList list all the builtin profiles.
func profileList(cmd *cobra.Command, plArgs *profileListArgs) error {
profiles, err := helm.ListProfiles(plArgs.manifestsPath)
if err != nil {
return err

View File

@@ -15,9 +15,10 @@
package hgctl
import (
"os"
"github.com/alibaba/higress/hgctl/pkg/plugin"
"github.com/spf13/cobra"
"os"
)
// GetRootCommand returns the root cobra command to be executed

View File

@@ -23,7 +23,7 @@ import (
"github.com/alibaba/higress/hgctl/pkg/helm"
"github.com/alibaba/higress/hgctl/pkg/installer"
"github.com/alibaba/higress/hgctl/pkg/util"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
"github.com/spf13/cobra"
)
@@ -44,9 +44,9 @@ func newUninstallCmd() *cobra.Command {
Use: "uninstall",
Short: "Uninstall higress from a cluster",
Long: "The uninstall command uninstalls higress from a cluster or local environment",
Example: `# Uninstall higress
Example: `# Uninstall higress
hgctl uninstal
# Uninstall higress, istioAPI and GatewayAPI from a cluster
hgctl uninstall --purge-resources
`,

View File

@@ -25,7 +25,7 @@ import (
"github.com/alibaba/higress/hgctl/pkg/installer"
"github.com/alibaba/higress/hgctl/pkg/kubernetes"
"github.com/alibaba/higress/hgctl/pkg/util"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/options"
"github.com/spf13/cobra"
)

View File

@@ -22,8 +22,8 @@ import (
"strings"
"github.com/alibaba/higress/hgctl/pkg/kubernetes"
"github.com/alibaba/higress/pkg/cmd/options"
"github.com/alibaba/higress/pkg/cmd/version"
"github.com/alibaba/higress/v2/pkg/cmd/options"
"github.com/alibaba/higress/v2/pkg/cmd/version"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"gopkg.in/yaml.v2"

View File

@@ -49,12 +49,12 @@ import (
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"
"github.com/alibaba/higress/pkg/cert"
higressconfig "github.com/alibaba/higress/pkg/config"
"github.com/alibaba/higress/pkg/ingress/kube/common"
"github.com/alibaba/higress/pkg/ingress/mcp"
"github.com/alibaba/higress/pkg/ingress/translation"
higresskube "github.com/alibaba/higress/pkg/kube"
"github.com/alibaba/higress/v2/pkg/cert"
higressconfig "github.com/alibaba/higress/v2/pkg/config"
"github.com/alibaba/higress/v2/pkg/ingress/kube/common"
"github.com/alibaba/higress/v2/pkg/ingress/mcp"
"github.com/alibaba/higress/v2/pkg/ingress/translation"
higresskube "github.com/alibaba/higress/v2/pkg/kube"
)
type XdsOptions struct {

View File

@@ -22,7 +22,7 @@ import (
"istio.io/istio/pilot/pkg/features"
"istio.io/istio/pkg/keepalive"
higresskube "github.com/alibaba/higress/pkg/kube"
higresskube "github.com/alibaba/higress/v2/pkg/kube"
)
func TestStartWithNoError(t *testing.T) {

View File

@@ -17,8 +17,8 @@ package cmd
import (
"fmt"
"github.com/alibaba/higress/pkg/bootstrap"
innerconstants "github.com/alibaba/higress/pkg/config/constants"
"github.com/alibaba/higress/v2/pkg/bootstrap"
innerconstants "github.com/alibaba/higress/v2/pkg/config/constants"
"github.com/spf13/cobra"
"istio.io/istio/pilot/pkg/features"
"istio.io/istio/pkg/cmd"

View File

@@ -19,7 +19,7 @@ import (
"testing"
"time"
"github.com/alibaba/higress/pkg/bootstrap"
"github.com/alibaba/higress/v2/pkg/bootstrap"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
)

View File

@@ -15,7 +15,7 @@
package cmd
import (
"github.com/alibaba/higress/pkg/cmd/version"
"github.com/alibaba/higress/v2/pkg/cmd/version"
"github.com/spf13/cobra"
)

View File

@@ -49,28 +49,28 @@ import (
listersv1 "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/tools/cache"
higressext "github.com/alibaba/higress/api/extensions/v1alpha1"
higressv1 "github.com/alibaba/higress/api/networking/v1"
extlisterv1 "github.com/alibaba/higress/client/pkg/listers/extensions/v1alpha1"
netlisterv1 "github.com/alibaba/higress/client/pkg/listers/networking/v1"
"github.com/alibaba/higress/pkg/cert"
higressconst "github.com/alibaba/higress/pkg/config/constants"
"github.com/alibaba/higress/pkg/ingress/kube/annotations"
"github.com/alibaba/higress/pkg/ingress/kube/common"
"github.com/alibaba/higress/pkg/ingress/kube/configmap"
"github.com/alibaba/higress/pkg/ingress/kube/gateway"
"github.com/alibaba/higress/pkg/ingress/kube/http2rpc"
"github.com/alibaba/higress/pkg/ingress/kube/ingress"
"github.com/alibaba/higress/pkg/ingress/kube/ingressv1"
"github.com/alibaba/higress/pkg/ingress/kube/mcpbridge"
"github.com/alibaba/higress/pkg/ingress/kube/mcpserver"
"github.com/alibaba/higress/pkg/ingress/kube/secret"
"github.com/alibaba/higress/pkg/ingress/kube/util"
"github.com/alibaba/higress/pkg/ingress/kube/wasmplugin"
. "github.com/alibaba/higress/pkg/ingress/log"
"github.com/alibaba/higress/pkg/kube"
"github.com/alibaba/higress/registry"
"github.com/alibaba/higress/registry/reconcile"
higressext "github.com/alibaba/higress/v2/api/extensions/v1alpha1"
higressv1 "github.com/alibaba/higress/v2/api/networking/v1"
extlisterv1 "github.com/alibaba/higress/v2/client/pkg/listers/extensions/v1alpha1"
netlisterv1 "github.com/alibaba/higress/v2/client/pkg/listers/networking/v1"
"github.com/alibaba/higress/v2/pkg/cert"
higressconst "github.com/alibaba/higress/v2/pkg/config/constants"
"github.com/alibaba/higress/v2/pkg/ingress/kube/annotations"
"github.com/alibaba/higress/v2/pkg/ingress/kube/common"
"github.com/alibaba/higress/v2/pkg/ingress/kube/configmap"
"github.com/alibaba/higress/v2/pkg/ingress/kube/gateway"
"github.com/alibaba/higress/v2/pkg/ingress/kube/http2rpc"
"github.com/alibaba/higress/v2/pkg/ingress/kube/ingress"
"github.com/alibaba/higress/v2/pkg/ingress/kube/ingressv1"
"github.com/alibaba/higress/v2/pkg/ingress/kube/mcpbridge"
"github.com/alibaba/higress/v2/pkg/ingress/kube/mcpserver"
"github.com/alibaba/higress/v2/pkg/ingress/kube/secret"
"github.com/alibaba/higress/v2/pkg/ingress/kube/util"
"github.com/alibaba/higress/v2/pkg/ingress/kube/wasmplugin"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
"github.com/alibaba/higress/v2/pkg/kube"
"github.com/alibaba/higress/v2/registry"
"github.com/alibaba/higress/v2/registry/reconcile"
)
var (
@@ -292,7 +292,7 @@ func (m *IngressConfig) List(typ config.GroupVersionKind, namespace string) []co
typ != gvk.WasmPlugin {
return nil
}
var configs = make([]config.Config, 0)
configs := make([]config.Config, 0)
if configsFromIngress := m.listFromIngressControllers(typ, namespace); configsFromIngress != nil {
// Process templates for ingress configs
@@ -579,9 +579,11 @@ func (m *IngressConfig) convertVirtualService(configs []common.WrapperConfig) []
cleanHost := common.CleanHost(host)
// namespace/name, name format: (istio cluster id)-host
gateways := []string{m.namespace + "/" +
common.CreateConvertedName(m.clusterId.String(), cleanHost),
common.CreateConvertedName(constants.IstioIngressGatewayName, cleanHost)}
gateways := []string{
m.namespace + "/" +
common.CreateConvertedName(m.clusterId.String(), cleanHost),
common.CreateConvertedName(constants.IstioIngressGatewayName, cleanHost),
}
wrapperVS, exist := convertOptions.VirtualServices[host]
if !exist {
@@ -1563,19 +1565,19 @@ func (m *IngressConfig) constructHttp2RpcMethods(dubbo *higressv1.DubboService)
}`
var methods []interface{}
for _, serviceMethod := range dubbo.GetMethods() {
var method = make(map[string]interface{})
method := make(map[string]interface{})
method["name"] = serviceMethod.GetServiceMethod()
var params []interface{}
// paramFromEntireBody is for methods with single parameter. So when paramFromEntireBody exists, we just ignore params.
var paramFromEntireBody = serviceMethod.GetParamFromEntireBody()
paramFromEntireBody := serviceMethod.GetParamFromEntireBody()
if paramFromEntireBody != nil {
var param = make(map[string]interface{})
param := make(map[string]interface{})
param["extract_key_spec"] = Http2RpcParamSourceMap()["BODY"]
param["mapping_type"] = paramFromEntireBody.GetParamType()
params = append(params, param)
} else {
for _, methodParam := range serviceMethod.GetParams() {
var param = make(map[string]interface{})
param := make(map[string]interface{})
param["extract_key"] = methodParam.GetParamKey()
param["extract_key_spec"] = Http2RpcParamSourceMap()[methodParam.GetParamSource()]
param["mapping_type"] = methodParam.GetParamType()
@@ -1583,12 +1585,12 @@ func (m *IngressConfig) constructHttp2RpcMethods(dubbo *higressv1.DubboService)
}
}
method["parameter_mapping"] = params
var path_matcher = make(map[string]interface{})
path_matcher := make(map[string]interface{})
path_matcher["match_http_method_spec"] = Http2RpcMethodMap()[serviceMethod.HttpMethods[0]]
path_matcher["match_pattern"] = serviceMethod.GetHttpPath()
method["path_matcher"] = path_matcher
var passthrough_setting = make(map[string]interface{})
var headersAttach = serviceMethod.GetHeadersAttach()
passthrough_setting := make(map[string]interface{})
headersAttach := serviceMethod.GetHeadersAttach()
if headersAttach == "" {
passthrough_setting["passthrough_all_headers"] = false
} else if headersAttach == "*" {
@@ -1599,8 +1601,8 @@ func (m *IngressConfig) constructHttp2RpcMethods(dubbo *higressv1.DubboService)
method["passthrough_setting"] = passthrough_setting
methods = append(methods, method)
}
var serviceMapping = make(map[string]interface{})
var dubboServiceGroup = dubbo.GetGroup()
serviceMapping := make(map[string]interface{})
dubboServiceGroup := dubbo.GetGroup()
if dubboServiceGroup != "" {
serviceMapping["group"] = dubboServiceGroup
}

View File

@@ -28,11 +28,11 @@ import (
ingress "k8s.io/api/networking/v1"
ingressv1beta1 "k8s.io/api/networking/v1beta1"
"github.com/alibaba/higress/pkg/ingress/kube/annotations"
"github.com/alibaba/higress/pkg/ingress/kube/common"
controllerv1beta1 "github.com/alibaba/higress/pkg/ingress/kube/ingress"
controllerv1 "github.com/alibaba/higress/pkg/ingress/kube/ingressv1"
"github.com/alibaba/higress/pkg/kube"
"github.com/alibaba/higress/v2/pkg/ingress/kube/annotations"
"github.com/alibaba/higress/v2/pkg/ingress/kube/common"
controllerv1beta1 "github.com/alibaba/higress/v2/pkg/ingress/kube/ingress"
controllerv1 "github.com/alibaba/higress/v2/pkg/ingress/kube/ingressv1"
"github.com/alibaba/higress/v2/pkg/kube"
)
func TestNormalizeWeightedCluster(t *testing.T) {

View File

@@ -20,7 +20,7 @@ import (
"regexp"
"strings"
. "github.com/alibaba/higress/pkg/ingress/log"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
"google.golang.org/protobuf/proto"
"istio.io/istio/pkg/config"
)

View File

@@ -30,14 +30,14 @@ import (
listersv1 "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/tools/cache"
"github.com/alibaba/higress/pkg/ingress/kube/annotations"
"github.com/alibaba/higress/pkg/ingress/kube/common"
"github.com/alibaba/higress/pkg/ingress/kube/kingress"
"github.com/alibaba/higress/pkg/ingress/kube/secret"
"github.com/alibaba/higress/pkg/ingress/kube/util"
. "github.com/alibaba/higress/pkg/ingress/log"
"github.com/alibaba/higress/pkg/kube"
"github.com/alibaba/higress/registry/reconcile"
"github.com/alibaba/higress/v2/pkg/ingress/kube/annotations"
"github.com/alibaba/higress/v2/pkg/ingress/kube/common"
"github.com/alibaba/higress/v2/pkg/ingress/kube/kingress"
"github.com/alibaba/higress/v2/pkg/ingress/kube/secret"
"github.com/alibaba/higress/v2/pkg/ingress/kube/util"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
"github.com/alibaba/higress/v2/pkg/kube"
"github.com/alibaba/higress/v2/registry/reconcile"
)
var (
@@ -310,9 +310,11 @@ func (m *KIngressConfig) convertVirtualService(configs []common.WrapperConfig) [
cleanHost := common.CleanHost(host)
// namespace/name, name format: (istio cluster id)-host
gateways := []string{m.namespace + "/" +
common.CreateConvertedName(m.clusterId.String(), cleanHost),
common.CreateConvertedName(constants.IstioIngressGatewayName, cleanHost)}
gateways := []string{
m.namespace + "/" +
common.CreateConvertedName(m.clusterId.String(), cleanHost),
common.CreateConvertedName(constants.IstioIngressGatewayName, cleanHost),
}
wrapperVS, exist := convertOptions.VirtualServices[host]
if !exist {

View File

@@ -27,10 +27,10 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
ingress "knative.dev/networking/pkg/apis/networking/v1alpha1"
"github.com/alibaba/higress/pkg/ingress/kube/annotations"
"github.com/alibaba/higress/pkg/ingress/kube/common"
kcontrollerv1 "github.com/alibaba/higress/pkg/ingress/kube/kingress"
"github.com/alibaba/higress/pkg/kube"
"github.com/alibaba/higress/v2/pkg/ingress/kube/annotations"
"github.com/alibaba/higress/v2/pkg/ingress/kube/common"
kcontrollerv1 "github.com/alibaba/higress/v2/pkg/ingress/kube/kingress"
"github.com/alibaba/higress/v2/pkg/kube"
)
func TestNormalizeKWeightedCluster(t *testing.T) {
@@ -402,7 +402,7 @@ func TestConvertGatewaysForKIngress(t *testing.T) {
Tls: &networking.ServerTLSSettings{
Mode: networking.ServerTLSSettings_SIMPLE,
CredentialName: "kubernetes-ingress://kingress__/wakanda/foo-com",
//CipherSuites: []string{"ECDHE-RSA-AES128-GCM-SHA256", "AES256-SHA"},
// CipherSuites: []string{"ECDHE-RSA-AES128-GCM-SHA256", "AES256-SHA"},
},
},
},
@@ -441,7 +441,7 @@ func TestConvertGatewaysForKIngress(t *testing.T) {
Tls: &networking.ServerTLSSettings{
Mode: networking.ServerTLSSettings_SIMPLE,
CredentialName: "kubernetes-ingress://kingress__/wakanda/test-com",
//CipherSuites: []string{"ECDHE-RSA-AES128-GCM-SHA256", "AES256-SHA"},
// CipherSuites: []string{"ECDHE-RSA-AES128-GCM-SHA256", "AES256-SHA"},
},
},
},
@@ -489,11 +489,11 @@ func TestConvertGatewaysForKIngress(t *testing.T) {
for _, item := range result {
host := common.GetHost(item.Annotations)
fmt.Print(item)
//assert.Equal(t, testCase.expect[host], item)
// assert.Equal(t, testCase.expect[host], item)
target[host] = item
//break
// break
}
//assert.Equal(t, testCase.expect, target)
// assert.Equal(t, testCase.expect, target)
if diff := cmp.Diff(target, testCase.expect, cmpopts.IgnoreUnexported(unexportedIgnoredTypes...)); diff != "" {
t.Errorf("convertGateways() mismatch (-want +got):\n%s", diff)
}

View File

@@ -18,8 +18,8 @@ import (
"fmt"
"sync"
"github.com/alibaba/higress/pkg/ingress/kube/util"
. "github.com/alibaba/higress/pkg/ingress/log"
"github.com/alibaba/higress/v2/pkg/ingress/kube/util"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
istiomodel "istio.io/istio/pilot/pkg/model"
"istio.io/istio/pkg/config"
"istio.io/istio/pkg/config/schema/kind"

View File

@@ -15,10 +15,11 @@
package config
import (
"k8s.io/apimachinery/pkg/types"
"testing"
"github.com/alibaba/higress/pkg/ingress/kube/util"
"k8s.io/apimachinery/pkg/types"
"github.com/alibaba/higress/v2/pkg/ingress/kube/util"
"github.com/stretchr/testify/assert"
istiomodel "istio.io/istio/pilot/pkg/model"
"istio.io/istio/pkg/cluster"
@@ -32,27 +33,27 @@ type mockXdsUpdater struct {
}
func (m *mockXdsUpdater) EDSUpdate(shard istiomodel.ShardKey, hostname string, namespace string, entry []*istiomodel.IstioEndpoint) {
//TODO implement me
// TODO implement me
panic("implement me")
}
func (m *mockXdsUpdater) EDSCacheUpdate(shard istiomodel.ShardKey, hostname string, namespace string, entry []*istiomodel.IstioEndpoint) {
//TODO implement me
// TODO implement me
panic("implement me")
}
func (m *mockXdsUpdater) SvcUpdate(shard istiomodel.ShardKey, hostname string, namespace string, event istiomodel.Event) {
//TODO implement me
// TODO implement me
panic("implement me")
}
func (m *mockXdsUpdater) ProxyUpdate(clusterID cluster.ID, ip string) {
//TODO implement me
// TODO implement me
panic("implement me")
}
func (m *mockXdsUpdater) RemoveShard(shardKey istiomodel.ShardKey) {
//TODO implement me
// TODO implement me
panic("implement me")
}

View File

@@ -22,7 +22,7 @@ import (
"istio.io/istio/pkg/util/sets"
listersv1 "k8s.io/client-go/listers/core/v1"
"github.com/alibaba/higress/pkg/ingress/kube/mcpserver"
"github.com/alibaba/higress/v2/pkg/ingress/kube/mcpserver"
)
type GlobalContext struct {

View File

@@ -15,8 +15,8 @@
package annotations
import (
"github.com/alibaba/higress/pkg/ingress/kube/util"
. "github.com/alibaba/higress/pkg/ingress/log"
"github.com/alibaba/higress/v2/pkg/ingress/kube/util"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
)
const (

View File

@@ -17,8 +17,8 @@ package annotations
import (
"strconv"
"github.com/alibaba/higress/pkg/ingress/kube/util"
. "github.com/alibaba/higress/pkg/ingress/log"
"github.com/alibaba/higress/v2/pkg/ingress/kube/util"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
networking "istio.io/api/networking/v1alpha3"
"k8s.io/apimachinery/pkg/types"
)

View File

@@ -21,7 +21,7 @@ import (
networking "istio.io/api/networking/v1alpha3"
. "github.com/alibaba/higress/pkg/ingress/log"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
)
const (

View File

@@ -23,8 +23,8 @@ import (
"istio.io/istio/pkg/config/security"
"k8s.io/apimachinery/pkg/types"
"github.com/alibaba/higress/pkg/ingress/kube/util"
. "github.com/alibaba/higress/pkg/ingress/log"
"github.com/alibaba/higress/v2/pkg/ingress/kube/util"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
)
const (

View File

@@ -20,7 +20,7 @@ import (
networking "istio.io/api/networking/v1alpha3"
. "github.com/alibaba/higress/pkg/ingress/log"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
)
const (

View File

@@ -15,7 +15,7 @@
package annotations
import (
. "github.com/alibaba/higress/pkg/ingress/log"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
)
const (

View File

@@ -18,7 +18,7 @@ import (
"fmt"
"strings"
. "github.com/alibaba/higress/pkg/ingress/log"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
networking "istio.io/api/networking/v1alpha3"
)
@@ -263,6 +263,5 @@ func merge(m1 map[string]*networking.StringMatch, m2 map[string]map[string]strin
IngressLog.Errorf("unknown type: %q is not supported Match type", typ)
}
}
}
}

View File

@@ -17,8 +17,8 @@ package annotations
import (
"strings"
"github.com/alibaba/higress/pkg/ingress/kube/mcpserver"
"github.com/alibaba/higress/pkg/ingress/log"
"github.com/alibaba/higress/v2/pkg/ingress/kube/mcpserver"
"github.com/alibaba/higress/v2/pkg/ingress/log"
)
const (

View File

@@ -19,7 +19,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/alibaba/higress/pkg/ingress/kube/mcpserver"
"github.com/alibaba/higress/v2/pkg/ingress/kube/mcpserver"
)
func TestMCPServer_Parse(t *testing.T) {

View File

@@ -15,8 +15,8 @@
package annotations
import (
"github.com/alibaba/higress/pkg/ingress/kube/util"
. "github.com/alibaba/higress/pkg/ingress/log"
"github.com/alibaba/higress/v2/pkg/ingress/kube/util"
. "github.com/alibaba/higress/v2/pkg/ingress/log"
wrappers "google.golang.org/protobuf/types/known/wrapperspb"
networking "istio.io/api/networking/v1alpha3"
)

Some files were not shown because too many files have changed in this diff Show More