mirror of
https://github.com/alibaba/higress.git
synced 2026-03-15 22:30:47 +08:00
Compare commits
101 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5140372159 | ||
|
|
f277d4f6ae | ||
|
|
ae20420179 | ||
|
|
a138a037ad | ||
|
|
021387c9d3 | ||
|
|
ea0a694d81 | ||
|
|
8028fe03ca | ||
|
|
a68dde0b91 | ||
|
|
48c3db85c4 | ||
|
|
7e85065832 | ||
|
|
7967f5db70 | ||
|
|
5026973d59 | ||
|
|
7097eef6ba | ||
|
|
fae222806b | ||
|
|
c63cdb62ea | ||
|
|
e43f5d106f | ||
|
|
29c95ea557 | ||
|
|
73d5cc3f1d | ||
|
|
c1ddbcef7c | ||
|
|
dd39c87311 | ||
|
|
612c94dd8a | ||
|
|
e67ed481cf | ||
|
|
ccea33655f | ||
|
|
ad4cfdbd40 | ||
|
|
3598c21da0 | ||
|
|
a624351f84 | ||
|
|
c41264816e | ||
|
|
acd80d2528 | ||
|
|
073c10df77 | ||
|
|
90f89cf588 | ||
|
|
879192cf99 | ||
|
|
d3d000753d | ||
|
|
b8a01113e3 | ||
|
|
0bb9e6dd89 | ||
|
|
ecdd077c72 | ||
|
|
e971faeb0b | ||
|
|
77013e28b6 | ||
|
|
9faa5f37d1 | ||
|
|
665d9fa943 | ||
|
|
a71ecf41d1 | ||
|
|
b825f9176f | ||
|
|
d35d23e2d5 | ||
|
|
6d1e09c146 | ||
|
|
87c39d393f | ||
|
|
c97260c4a9 | ||
|
|
5e509e7032 | ||
|
|
c9c7df78a9 | ||
|
|
1e018770e5 | ||
|
|
53ff28c58b | ||
|
|
66f2d8980d | ||
|
|
b1e4cf9492 | ||
|
|
c250e850d5 | ||
|
|
1f7e98cef5 | ||
|
|
4273bf573a | ||
|
|
13f36856cc | ||
|
|
e84f9980a1 | ||
|
|
a2fecd59a1 | ||
|
|
89c72777e1 | ||
|
|
85df257f4e | ||
|
|
659a982496 | ||
|
|
0ae376b320 | ||
|
|
c647ab3a08 | ||
|
|
688247f4f9 | ||
|
|
10f5267b3f | ||
|
|
cec99686a0 | ||
|
|
2d5d9c095b | ||
|
|
4bd4433248 | ||
|
|
4ea85e9a35 | ||
|
|
a140f780d2 | ||
|
|
2548815667 | ||
|
|
e760b4d0ab | ||
|
|
3cc1c7877f | ||
|
|
8039b82699 | ||
|
|
f9a015e45a | ||
|
|
5fbfbe0e4a | ||
|
|
a3339a9b1c | ||
|
|
aa94412af2 | ||
|
|
817925ef39 | ||
|
|
c55a5b9bd9 | ||
|
|
518d8dfa3d | ||
|
|
d2ee6065a0 | ||
|
|
4426f18a84 | ||
|
|
17794cef2a | ||
|
|
a554ee1ceb | ||
|
|
1dbb130539 | ||
|
|
9c1684c941 | ||
|
|
bd4109e1a4 | ||
|
|
967fa3f3d1 | ||
|
|
d57ffce1dc | ||
|
|
a2d97ae98f | ||
|
|
324e0bcf91 | ||
|
|
14742705b1 | ||
|
|
b204ad4c8d | ||
|
|
34054f8c76 | ||
|
|
6803aa44ab | ||
|
|
e5cd334d5d | ||
|
|
88c0386ca3 | ||
|
|
5174397e7c | ||
|
|
cb0479510f | ||
|
|
57b8cb1d69 | ||
|
|
9f5b795a4d |
68
.github/workflows/build-and-test-plugin.yaml
vendored
Normal file
68
.github/workflows/build-and-test-plugin.yaml
vendored
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
name: "Build and Test Plugins"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
paths:
|
||||||
|
- 'plugins/**'
|
||||||
|
- 'test/**'
|
||||||
|
pull_request:
|
||||||
|
branches: ["*"]
|
||||||
|
paths:
|
||||||
|
- 'plugins/**'
|
||||||
|
- 'test/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: 1.19
|
||||||
|
# There are too many lint errors in current code bases
|
||||||
|
# uncomment when we decide what lint should be addressed or ignored.
|
||||||
|
# - run: make lint
|
||||||
|
|
||||||
|
higress-wasmplugin-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
# TODO(Xunzhuo): Enable C WASM Filters in CI
|
||||||
|
wasmPluginType: [ GO ]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: "Setup Go"
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: 1.19
|
||||||
|
|
||||||
|
- name: Setup Golang Caches
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |-
|
||||||
|
~/.cache/go-build
|
||||||
|
~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ github.run_id }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go
|
||||||
|
|
||||||
|
- name: Setup Submodule Caches
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |-
|
||||||
|
.git/modules
|
||||||
|
key: ${{ runner.os }}-submodules-cache-${{ github.run_id }}
|
||||||
|
restore-keys: ${{ runner.os }}-submodules-cache
|
||||||
|
|
||||||
|
- run: git stash # restore patch
|
||||||
|
|
||||||
|
- name: "Run Ingress WasmPlugins Tests"
|
||||||
|
run: GOPROXY="https://proxy.golang.org,direct" PLUGIN_TYPE=${{ matrix.wasmPluginType }} make higress-wasmplugin-test
|
||||||
|
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [higress-wasmplugin-test]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
60
.github/workflows/build-and-test.yaml
vendored
60
.github/workflows/build-and-test.yaml
vendored
@@ -36,11 +36,9 @@ jobs:
|
|||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |-
|
path: |-
|
||||||
envoy
|
|
||||||
istio
|
|
||||||
.git/modules
|
.git/modules
|
||||||
key: ${{ runner.os }}-submodules-new-${{ github.run_id }}
|
key: ${{ runner.os }}-submodules-cache-${{ github.run_id }}
|
||||||
restore-keys: ${{ runner.os }}-submodules-new
|
restore-keys: ${{ runner.os }}-submodules-cache
|
||||||
|
|
||||||
- run: git stash # restore patch
|
- run: git stash # restore patch
|
||||||
|
|
||||||
@@ -82,11 +80,9 @@ jobs:
|
|||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |-
|
path: |-
|
||||||
envoy
|
|
||||||
istio
|
|
||||||
.git/modules
|
.git/modules
|
||||||
key: ${{ runner.os }}-submodules-new-${{ github.run_id }}
|
key: ${{ runner.os }}-submodules-cache-${{ github.run_id }}
|
||||||
restore-keys: ${{ runner.os }}-submodules-new
|
restore-keys: ${{ runner.os }}-submodules-cache
|
||||||
|
|
||||||
- run: git stash # restore patch
|
- run: git stash # restore patch
|
||||||
|
|
||||||
@@ -130,59 +126,17 @@ jobs:
|
|||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |-
|
path: |-
|
||||||
envoy
|
|
||||||
istio
|
|
||||||
.git/modules
|
.git/modules
|
||||||
key: ${{ runner.os }}-submodules-new-${{ github.run_id }}
|
key: ${{ runner.os }}-submodules-cache-${{ github.run_id }}
|
||||||
restore-keys: ${{ runner.os }}-submodules-new
|
restore-keys: ${{ runner.os }}-submodules-cache
|
||||||
|
|
||||||
- run: git stash # restore patch
|
- run: git stash # restore patch
|
||||||
|
|
||||||
- name: "Run Higress E2E Conformance Tests"
|
- name: "Run Higress E2E Conformance Tests"
|
||||||
run: GOPROXY="https://proxy.golang.org,direct" make higress-conformance-test
|
run: GOPROXY="https://proxy.golang.org,direct" make higress-conformance-test
|
||||||
|
|
||||||
higress-wasmplugin-test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [build]
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
# TODO(Xunzhuo): Enable C WASM Filters in CI
|
|
||||||
wasmPluginType: [ GO ]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: "Setup Go"
|
|
||||||
uses: actions/setup-go@v3
|
|
||||||
with:
|
|
||||||
go-version: 1.19
|
|
||||||
|
|
||||||
- name: Setup Golang Caches
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |-
|
|
||||||
~/.cache/go-build
|
|
||||||
~/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ github.run_id }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go
|
|
||||||
|
|
||||||
- name: Setup Submodule Caches
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |-
|
|
||||||
envoy
|
|
||||||
istio
|
|
||||||
.git/modules
|
|
||||||
key: ${{ runner.os }}-submodules-new-${{ github.run_id }}
|
|
||||||
restore-keys: ${{ runner.os }}-submodules-new
|
|
||||||
|
|
||||||
- run: git stash # restore patch
|
|
||||||
|
|
||||||
- name: "Run Ingress WasmPlugins Tests"
|
|
||||||
run: GOPROXY="https://proxy.golang.org,direct" PLUGIN_TYPE=${{ matrix.wasmPluginType }} make higress-wasmplugin-test
|
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [higress-conformance-test,gateway-conformance-test,higress-wasmplugin-test]
|
needs: [higress-conformance-test,gateway-conformance-test]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|||||||
30
.github/workflows/build-image-and-push.yaml
vendored
30
.github/workflows/build-image-and-push.yaml
vendored
@@ -20,6 +20,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- 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"
|
- name: "Setup Go"
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
@@ -86,6 +96,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- 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"
|
- name: "Setup Go"
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
@@ -153,6 +173,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- 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"
|
- name: "Setup Go"
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
4
.github/workflows/latest-release.yaml
vendored
4
.github/workflows/latest-release.yaml
vendored
@@ -18,6 +18,8 @@ jobs:
|
|||||||
tar -zcvf hgctl_latest_linux_arm64.tar.gz out/linux_arm64/
|
tar -zcvf hgctl_latest_linux_arm64.tar.gz out/linux_arm64/
|
||||||
tar -zcvf hgctl_latest_darwin_amd64.tar.gz out/darwin_amd64/
|
tar -zcvf hgctl_latest_darwin_amd64.tar.gz out/darwin_amd64/
|
||||||
tar -zcvf hgctl_latest_darwin_arm64.tar.gz out/darwin_arm64/
|
tar -zcvf hgctl_latest_darwin_arm64.tar.gz out/darwin_arm64/
|
||||||
|
zip -q -r hgctl_latest_windows_amd64.zip out/windows_amd64/
|
||||||
|
zip -q -r hgctl_latest_windows_arm64.zip out/windows_arm64/
|
||||||
|
|
||||||
# Ignore the error when we delete the latest release, it might not exist.
|
# Ignore the error when we delete the latest release, it might not exist.
|
||||||
|
|
||||||
@@ -54,6 +56,8 @@ jobs:
|
|||||||
hgctl_latest_linux_arm64.tar.gz
|
hgctl_latest_linux_arm64.tar.gz
|
||||||
hgctl_latest_darwin_amd64.tar.gz
|
hgctl_latest_darwin_amd64.tar.gz
|
||||||
hgctl_latest_darwin_arm64.tar.gz
|
hgctl_latest_darwin_arm64.tar.gz
|
||||||
|
hgctl_latest_windows_amd64.zip
|
||||||
|
hgctl_latest_windows_arm64.zip
|
||||||
body: |
|
body: |
|
||||||
This is the "latest" release of **Higress**, which contains the most recent commits from the main branch.
|
This is the "latest" release of **Higress**, which contains the most recent commits from the main branch.
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ header:
|
|||||||
- 'VERSION'
|
- 'VERSION'
|
||||||
- 'tools/'
|
- 'tools/'
|
||||||
- 'test/README.md'
|
- 'test/README.md'
|
||||||
- 'pkg/cmd/hgctl/testdata/config'
|
- 'test/README_CN.md'
|
||||||
|
- 'cmd/hgctl/config/testdata/config'
|
||||||
- 'pkg/cmd/hgctl/manifests'
|
- 'pkg/cmd/hgctl/manifests'
|
||||||
|
|
||||||
comment: on-failure
|
comment: on-failure
|
||||||
|
|||||||
14
CODEOWNERS
14
CODEOWNERS
@@ -1,10 +1,10 @@
|
|||||||
/api @johnlanni
|
/api @johnlanni @CH3CHO
|
||||||
/envoy @gengleilei @johnlanni @Lynskylate
|
/envoy @gengleilei @johnlanni
|
||||||
/istio @SpecialYang @johnlanni
|
/istio @SpecialYang @johnlanni
|
||||||
/pkg @SpecialYang @johnlanni @Charlie17Li @Xunzhuo
|
/pkg @SpecialYang @johnlanni @CH3CHO
|
||||||
/plugins @johnlanni
|
/plugins @johnlanni @WeixinX
|
||||||
/registry @NameHaibinZhang @johnlanni
|
/registry @NameHaibinZhang @2456868764 @johnlanni
|
||||||
/test @Xunzhuo
|
/test @Xunzhuo @2456868764 @CH3CHO
|
||||||
/tools @johnlanni @Xunzhuo
|
/tools @johnlanni @Xunzhuo @2456868764
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@
|
|||||||
* [分支定义](#分支定义)
|
* [分支定义](#分支定义)
|
||||||
* [提交规则](#提交规则)
|
* [提交规则](#提交规则)
|
||||||
* [PR说明](#PR说明)
|
* [PR说明](#PR说明)
|
||||||
|
* [开发前准备](#开发前准备)
|
||||||
|
|
||||||
### 工作区准备
|
### 工作区准备
|
||||||
|
|
||||||
@@ -168,6 +169,12 @@ git config --get user.email
|
|||||||
|
|
||||||
PR 是更改 Higress 项目文件的唯一方法。为了帮助审查人更好地理解你的目的,PR 描述不能太详细。我们鼓励贡献者遵循 [PR 模板](./.github/PULL_REQUEST_TEMPLATE.md) 来完成拉取请求。
|
PR 是更改 Higress 项目文件的唯一方法。为了帮助审查人更好地理解你的目的,PR 描述不能太详细。我们鼓励贡献者遵循 [PR 模板](./.github/PULL_REQUEST_TEMPLATE.md) 来完成拉取请求。
|
||||||
|
|
||||||
|
### 开发前准备
|
||||||
|
|
||||||
|
```shell
|
||||||
|
make prebuild && go mod tidy
|
||||||
|
```
|
||||||
|
|
||||||
## 测试用例贡献
|
## 测试用例贡献
|
||||||
|
|
||||||
任何测试用例都会受到欢迎。目前,Higress 功能测试用例是高优先级的。
|
任何测试用例都会受到欢迎。目前,Higress 功能测试用例是高优先级的。
|
||||||
|
|||||||
@@ -169,6 +169,12 @@ No matter commit message, or commit content, we do take more emphasis on code re
|
|||||||
|
|
||||||
PR is the only way to make change to Higress project files. To help reviewers better get your purpose, PR description could not be too detailed. We encourage contributors to follow the [PR template](./.github/PULL_REQUEST_TEMPLATE.md) to finish the pull request.
|
PR is the only way to make change to Higress project files. To help reviewers better get your purpose, PR description could not be too detailed. We encourage contributors to follow the [PR template](./.github/PULL_REQUEST_TEMPLATE.md) to finish the pull request.
|
||||||
|
|
||||||
|
### Pre-development preparation
|
||||||
|
|
||||||
|
```shell
|
||||||
|
make prebuild && go mod tidy
|
||||||
|
```
|
||||||
|
|
||||||
## Test case contribution
|
## Test case contribution
|
||||||
|
|
||||||
Any test case would be welcomed. Currently, Higress function test cases are high priority.
|
Any test case would be welcomed. Currently, Higress function test cases are high priority.
|
||||||
|
|||||||
106
Makefile.core.mk
106
Makefile.core.mk
@@ -15,7 +15,7 @@ GO_LDFLAGS += -X $(VERSION_PACKAGE).higressVersion=$(shell cat VERSION) \
|
|||||||
|
|
||||||
GO ?= go
|
GO ?= go
|
||||||
|
|
||||||
export GOPROXY ?= https://proxy.golang.com.cn,direct
|
export GOPROXY ?= https://proxy.golang.org,direct
|
||||||
|
|
||||||
TARGET_ARCH ?= amd64
|
TARGET_ARCH ?= amd64
|
||||||
|
|
||||||
@@ -92,7 +92,8 @@ build-hgctl-multiarch: prebuild $(OUT)
|
|||||||
GOPROXY=$(GOPROXY) GOOS=linux GOARCH=arm64 LDFLAGS=$(RELEASE_LDFLAGS) tools/hack/gobuild.sh ./out/linux_arm64/ $(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=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=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)
|
||||||
# Create targets for OUT_LINUX/binary
|
# Create targets for OUT_LINUX/binary
|
||||||
# There are two use cases here:
|
# 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
|
# * Building all docker images (generally in CI). In this case we want to build everything at once, so they share work
|
||||||
@@ -137,11 +138,11 @@ export ENVOY_TAR_PATH:=/home/package/envoy.tar.gz
|
|||||||
|
|
||||||
external/package/envoy-amd64.tar.gz:
|
external/package/envoy-amd64.tar.gz:
|
||||||
# cd external/proxy; BUILD_WITH_CONTAINER=1 make test_release
|
# cd external/proxy; BUILD_WITH_CONTAINER=1 make test_release
|
||||||
cd external/package; wget "https://github.com/alibaba/higress/releases/download/v1.2.0/envoy-amd64.tar.gz"
|
cd external/package; wget -O envoy-amd64.tar.gz "https://github.com/alibaba/higress/releases/download/v1.3.4-rc.1/envoy-symbol-amd64.tar.gz"
|
||||||
|
|
||||||
external/package/envoy-arm64.tar.gz:
|
external/package/envoy-arm64.tar.gz:
|
||||||
# cd external/proxy; BUILD_WITH_CONTAINER=1 make test_release
|
# cd external/proxy; BUILD_WITH_CONTAINER=1 make test_release
|
||||||
cd external/package; wget "https://github.com/alibaba/higress/releases/download/v1.2.0/envoy-arm64.tar.gz"
|
cd external/package; wget -O envoy-arm64.tar.gz "https://github.com/alibaba/higress/releases/download/v1.3.4-rc.1/envoy-symbol-arm64.tar.gz"
|
||||||
|
|
||||||
build-pilot:
|
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_amd64; GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=amd64 BUILD_WITH_CONTAINER=1 make build-linux
|
||||||
@@ -153,13 +154,13 @@ build-pilot-local:
|
|||||||
build-gateway: prebuild external/package/envoy-amd64.tar.gz external/package/envoy-arm64.tar.gz build-pilot
|
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
|
cd external/istio; BUILD_WITH_CONTAINER=1 BUILDX_PLATFORM=true DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="docker.proxyv2" make docker
|
||||||
|
|
||||||
build-gateway-local: prebuild external/package/envoy-amd64.tar.gz external/package/envoy-arm64.tar.gz build-pilot
|
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
|
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-istio: prebuild build-pilot
|
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
|
cd external/istio; BUILD_WITH_CONTAINER=1 BUILDX_PLATFORM=true DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="docker.pilot" make docker
|
||||||
|
|
||||||
build-istio-local: prebuild build-pilot-local
|
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
|
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
|
||||||
|
|
||||||
build-wasmplugins:
|
build-wasmplugins:
|
||||||
@@ -176,13 +177,13 @@ install: pre-install
|
|||||||
cd helm/higress; helm dependency build
|
cd helm/higress; helm dependency build
|
||||||
helm install higress helm/higress -n higress-system --create-namespace --set 'global.local=true'
|
helm install higress helm/higress -n higress-system --create-namespace --set 'global.local=true'
|
||||||
|
|
||||||
ENVOY_LATEST_IMAGE_TAG ?= sha-6835486
|
ENVOY_LATEST_IMAGE_TAG ?= sha-a68dde0
|
||||||
ISTIO_LATEST_IMAGE_TAG ?= sha-6835486
|
ISTIO_LATEST_IMAGE_TAG ?= sha-a68dde0
|
||||||
|
|
||||||
install-dev: pre-install
|
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'
|
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'
|
||||||
install-dev-wasmplugin: build-wasmplugins pre-install
|
install-dev-wasmplugin: build-wasmplugins 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' --set 'global.volumeWasmPlugins=true'
|
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' --set 'global.volumeWasmPlugins=true' --set 'global.onlyPushRouteCluster=false'
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
helm uninstall higress -n higress-system
|
helm uninstall higress -n higress-system
|
||||||
@@ -232,14 +233,30 @@ include tools/lint.mk
|
|||||||
.PHONY: gateway-conformance-test
|
.PHONY: gateway-conformance-test
|
||||||
gateway-conformance-test:
|
gateway-conformance-test:
|
||||||
|
|
||||||
|
# higress-conformance-test-prepare prepares the environment for higress conformance tests.
|
||||||
|
.PHONY: higress-conformance-test-prepare
|
||||||
|
higress-conformance-test-prepare: $(tools/kind) delete-cluster create-cluster docker-build kube-load-image install-dev
|
||||||
|
|
||||||
# higress-conformance-test runs ingress api conformance tests.
|
# higress-conformance-test runs ingress api conformance tests.
|
||||||
.PHONY: higress-conformance-test
|
.PHONY: higress-conformance-test
|
||||||
higress-conformance-test: $(tools/kind) delete-cluster create-cluster docker-build kube-load-image install-dev run-higress-e2e-test delete-cluster
|
higress-conformance-test: $(tools/kind) delete-cluster create-cluster docker-build kube-load-image install-dev run-higress-e2e-test delete-cluster
|
||||||
|
|
||||||
|
# higress-conformance-test-clean cleans the environment for higress conformance tests.
|
||||||
|
.PHONY: higress-conformance-test-clean
|
||||||
|
higress-conformance-test-clean: $(tools/kind) delete-cluster
|
||||||
|
|
||||||
|
# higress-wasmplugin-test-prepare prepares the environment for higress wasmplugin tests.
|
||||||
|
.PHONY: higress-wasmplugin-test-prepare
|
||||||
|
higress-wasmplugin-test-prepare: $(tools/kind) delete-cluster create-cluster docker-build kube-load-image install-dev-wasmplugin
|
||||||
|
|
||||||
# higress-wasmplugin-test runs ingress wasmplugin tests.
|
# higress-wasmplugin-test runs ingress wasmplugin tests.
|
||||||
.PHONY: higress-wasmplugin-test
|
.PHONY: higress-wasmplugin-test
|
||||||
higress-wasmplugin-test: $(tools/kind) delete-cluster create-cluster docker-build kube-load-image install-dev-wasmplugin run-higress-e2e-test-wasmplugin delete-cluster
|
higress-wasmplugin-test: $(tools/kind) delete-cluster create-cluster docker-build kube-load-image install-dev-wasmplugin run-higress-e2e-test-wasmplugin delete-cluster
|
||||||
|
|
||||||
|
# higress-wasmplugin-test-clean cleans the environment for higress wasmplugin tests.
|
||||||
|
.PHONY: higress-wasmplugin-test-clean
|
||||||
|
higress-wasmplugin-test-clean: $(tools/kind) delete-cluster
|
||||||
|
|
||||||
# create-cluster creates a kube cluster with kind.
|
# create-cluster creates a kube cluster with kind.
|
||||||
.PHONY: create-cluster
|
.PHONY: create-cluster
|
||||||
create-cluster: $(tools/kind)
|
create-cluster: $(tools/kind)
|
||||||
@@ -257,18 +274,29 @@ delete-cluster: $(tools/kind) ## Delete kind cluster.
|
|||||||
.PHONY: kube-load-image
|
.PHONY: kube-load-image
|
||||||
kube-load-image: $(tools/kind) ## Install the Higress image to a kind cluster using the provided $IMAGE and $TAG.
|
kube-load-image: $(tools/kind) ## Install the Higress image to a kind cluster using the provided $IMAGE and $TAG.
|
||||||
tools/hack/kind-load-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/higress $(TAG)
|
tools/hack/kind-load-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/higress $(TAG)
|
||||||
tools/hack/docker-pull-image.sh docker.io/alihigress/dubbo-provider-demo 0.0.1
|
tools/hack/docker-pull-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/dubbo-provider-demo 0.0.3-x86
|
||||||
tools/hack/docker-pull-image.sh docker.io/alihigress/nacos-standlone-rc3 1.0.0-RC3
|
tools/hack/docker-pull-image.sh docker.io/alihigress/nacos-standlone-rc3 1.0.0-RC3
|
||||||
tools/hack/docker-pull-image.sh docker.io/hashicorp/consul 1.16.0
|
tools/hack/docker-pull-image.sh docker.io/hashicorp/consul 1.16.0
|
||||||
tools/hack/docker-pull-image.sh docker.io/charlie1380/eureka-registry-provider v0.3.0
|
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/bitinit/eureka latest
|
||||||
tools/hack/docker-pull-image.sh docker.io/alihigress/httpbin 1.0.2
|
tools/hack/docker-pull-image.sh docker.io/alihigress/httpbin 1.0.2
|
||||||
tools/hack/kind-load-image.sh docker.io/alihigress/dubbo-provider-demo 0.0.1
|
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/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/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/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/charlie1380/eureka-registry-provider v0.3.0
|
||||||
tools/hack/kind-load-image.sh docker.io/bitinit/eureka latest
|
tools/hack/kind-load-image.sh docker.io/bitinit/eureka latest
|
||||||
|
|
||||||
|
# run-higress-e2e-test-setup starts to setup ingress e2e tests.
|
||||||
|
.PHONT: run-higress-e2e-test-setup
|
||||||
|
run-higress-e2e-test-setup:
|
||||||
|
@echo -e "\n\033[36mRunning higress conformance tests...\033[0m"
|
||||||
|
@echo -e "\n\033[36mWaiting higress-controller to be ready...\033[0m\n"
|
||||||
|
kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available
|
||||||
|
@echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n"
|
||||||
|
kubectl wait --timeout=10m -n higress-system deployment/higress-gateway --for=condition=Available
|
||||||
|
go test -v -tags conformance ./test/e2e/e2e_test.go --ingress-class=higress --debug=true --test-area=setup
|
||||||
|
|
||||||
# run-higress-e2e-test starts to run ingress e2e tests.
|
# run-higress-e2e-test starts to run ingress e2e tests.
|
||||||
.PHONY: run-higress-e2e-test
|
.PHONY: run-higress-e2e-test
|
||||||
run-higress-e2e-test:
|
run-higress-e2e-test:
|
||||||
@@ -277,9 +305,39 @@ run-higress-e2e-test:
|
|||||||
kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available
|
kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available
|
||||||
@echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n"
|
@echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n"
|
||||||
kubectl wait --timeout=10m -n higress-system deployment/higress-gateway --for=condition=Available
|
kubectl wait --timeout=10m -n higress-system deployment/higress-gateway --for=condition=Available
|
||||||
go test -v -tags conformance ./test/e2e/e2e_test.go --ingress-class=higress --debug=true
|
go test -v -tags conformance ./test/e2e/e2e_test.go --ingress-class=higress --debug=true --test-area=all
|
||||||
|
|
||||||
# run-higress-e2e-test starts to run ingress e2e tests.
|
# run-higress-e2e-test-run starts to run ingress e2e conformance tests.
|
||||||
|
.PHONY: run-higress-e2e-test-run
|
||||||
|
run-higress-e2e-test-run:
|
||||||
|
@echo -e "\n\033[36mRunning higress conformance tests...\033[0m"
|
||||||
|
@echo -e "\n\033[36mWaiting higress-controller to be ready...\033[0m\n"
|
||||||
|
kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available
|
||||||
|
@echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n"
|
||||||
|
kubectl wait --timeout=10m -n higress-system deployment/higress-gateway --for=condition=Available
|
||||||
|
go test -v -tags conformance ./test/e2e/e2e_test.go --ingress-class=higress --debug=true --test-area=run
|
||||||
|
|
||||||
|
# run-higress-e2e-test-clean starts to clean ingress e2e tests.
|
||||||
|
.PHONY: run-higress-e2e-test-clean
|
||||||
|
run-higress-e2e-test-clean:
|
||||||
|
@echo -e "\n\033[36mRunning higress conformance tests...\033[0m"
|
||||||
|
@echo -e "\n\033[36mWaiting higress-controller to be ready...\033[0m\n"
|
||||||
|
kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available
|
||||||
|
@echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n"
|
||||||
|
kubectl wait --timeout=10m -n higress-system deployment/higress-gateway --for=condition=Available
|
||||||
|
go test -v -tags conformance ./test/e2e/e2e_test.go --ingress-class=higress --debug=true --test-area=clean
|
||||||
|
|
||||||
|
# run-higress-e2e-test-wasmplugin-setup starts to prepare ingress e2e tests.
|
||||||
|
.PHONY: run-higress-e2e-test-wasmplugin-setup
|
||||||
|
run-higress-e2e-test-wasmplugin-setup:
|
||||||
|
@echo -e "\n\033[36mRunning higress conformance tests...\033[0m"
|
||||||
|
@echo -e "\n\033[36mWaiting higress-controller to be ready...\033[0m\n"
|
||||||
|
kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available
|
||||||
|
@echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n"
|
||||||
|
kubectl wait --timeout=10m -n higress-system deployment/higress-gateway --for=condition=Available
|
||||||
|
go test -v -tags conformance ./test/e2e/e2e_test.go -isWasmPluginTest=true -wasmPluginType=$(PLUGIN_TYPE) -wasmPluginName=$(PLUGIN_NAME) --ingress-class=higress --debug=true --test-area=setup
|
||||||
|
|
||||||
|
# run-higress-e2e-test-wasmplugin starts to run ingress e2e tests.
|
||||||
.PHONY: run-higress-e2e-test-wasmplugin
|
.PHONY: run-higress-e2e-test-wasmplugin
|
||||||
run-higress-e2e-test-wasmplugin:
|
run-higress-e2e-test-wasmplugin:
|
||||||
@echo -e "\n\033[36mRunning higress conformance tests...\033[0m"
|
@echo -e "\n\033[36mRunning higress conformance tests...\033[0m"
|
||||||
@@ -287,4 +345,24 @@ run-higress-e2e-test-wasmplugin:
|
|||||||
kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available
|
kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available
|
||||||
@echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n"
|
@echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n"
|
||||||
kubectl wait --timeout=10m -n higress-system deployment/higress-gateway --for=condition=Available
|
kubectl wait --timeout=10m -n higress-system deployment/higress-gateway --for=condition=Available
|
||||||
go test -v -tags conformance ./test/e2e/e2e_test.go -isWasmPluginTest=true -wasmPluginType=$(PLUGIN_TYPE) -wasmPluginName=$(PLUGIN_NAME) --ingress-class=higress --debug=true
|
go test -v -tags conformance ./test/e2e/e2e_test.go -isWasmPluginTest=true -wasmPluginType=$(PLUGIN_TYPE) -wasmPluginName=$(PLUGIN_NAME) --ingress-class=higress --debug=true --test-area=all
|
||||||
|
|
||||||
|
# run-higress-e2e-test-wasmplugin-run starts to run ingress e2e conformance tests.
|
||||||
|
.PHONY: run-higress-e2e-test-wasmplugin-run
|
||||||
|
run-higress-e2e-test-wasmplugin-run:
|
||||||
|
@echo -e "\n\033[36mRunning higress conformance tests...\033[0m"
|
||||||
|
@echo -e "\n\033[36mWaiting higress-controller to be ready...\033[0m\n"
|
||||||
|
kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available
|
||||||
|
@echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n"
|
||||||
|
kubectl wait --timeout=10m -n higress-system deployment/higress-gateway --for=condition=Available
|
||||||
|
go test -v -tags conformance ./test/e2e/e2e_test.go -isWasmPluginTest=true -wasmPluginType=$(PLUGIN_TYPE) -wasmPluginName=$(PLUGIN_NAME) --ingress-class=higress --debug=true --test-area=run
|
||||||
|
|
||||||
|
# run-higress-e2e-test-wasmplugin-clean starts to clean ingress e2e tests.
|
||||||
|
.PHONY: run-higress-e2e-test-wasmplugin-clean
|
||||||
|
run-higress-e2e-test-wasmplugin-clean:
|
||||||
|
@echo -e "\n\033[36mRunning higress conformance tests...\033[0m"
|
||||||
|
@echo -e "\n\033[36mWaiting higress-controller to be ready...\033[0m\n"
|
||||||
|
kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available
|
||||||
|
@echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n"
|
||||||
|
kubectl wait --timeout=10m -n higress-system deployment/higress-gateway --for=condition=Available
|
||||||
|
go test -v -tags conformance ./test/e2e/e2e_test.go -isWasmPluginTest=true -wasmPluginType=$(PLUGIN_TYPE) -wasmPluginName=$(PLUGIN_NAME) --ingress-class=higress --debug=true --test-area=clean
|
||||||
|
|||||||
@@ -121,13 +121,7 @@ Higress 是基于阿里内部两年多的 Envoy Gateway 实践沉淀,以开源
|
|||||||
|
|
||||||
### 联系我们
|
### 联系我们
|
||||||
|
|
||||||
- Mailing list: higress@googlegroups.com
|
|
||||||
|
|
||||||
社区交流群:
|
社区交流群:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
开发者群:
|
|
||||||
|
|
||||||

|
|
||||||
|
|||||||
@@ -154,6 +154,11 @@ spec:
|
|||||||
type: array
|
type: array
|
||||||
httpPath:
|
httpPath:
|
||||||
type: string
|
type: string
|
||||||
|
paramFromEntireBody:
|
||||||
|
properties:
|
||||||
|
paramType:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
params:
|
params:
|
||||||
items:
|
items:
|
||||||
properties:
|
properties:
|
||||||
|
|||||||
@@ -200,14 +200,15 @@ func (m *DubboService) GetMethods() []*Method {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Method struct {
|
type Method struct {
|
||||||
ServiceMethod string `protobuf:"bytes,1,opt,name=service_method,json=serviceMethod,proto3" json:"service_method,omitempty"`
|
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"`
|
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"`
|
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"`
|
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"`
|
Params []*Param `protobuf:"bytes,5,rep,name=params,proto3" json:"params,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
ParamFromEntireBody *ParamFromEntireBody `protobuf:"bytes,6,opt,name=paramFromEntireBody,proto3" json:"paramFromEntireBody,omitempty"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
XXX_sizecache int32 `json:"-"`
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Method) Reset() { *m = Method{} }
|
func (m *Method) Reset() { *m = Method{} }
|
||||||
@@ -278,6 +279,13 @@ func (m *Method) GetParams() []*Param {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Method) GetParamFromEntireBody() *ParamFromEntireBody {
|
||||||
|
if m != nil {
|
||||||
|
return m.ParamFromEntireBody
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type Param struct {
|
type Param struct {
|
||||||
ParamSource string `protobuf:"bytes,1,opt,name=param_source,json=paramSource,proto3" json:"param_source,omitempty"`
|
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"`
|
ParamKey string `protobuf:"bytes,2,opt,name=param_key,json=paramKey,proto3" json:"param_key,omitempty"`
|
||||||
@@ -341,6 +349,53 @@ func (m *Param) GetParamType() string {
|
|||||||
return ""
|
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:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
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 (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)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_ParamFromEntireBody proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *ParamFromEntireBody) GetParamType() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.ParamType
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
type GrpcService struct {
|
type GrpcService struct {
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_unrecognized []byte `json:"-"`
|
||||||
@@ -351,7 +406,7 @@ func (m *GrpcService) Reset() { *m = GrpcService{} }
|
|||||||
func (m *GrpcService) String() string { return proto.CompactTextString(m) }
|
func (m *GrpcService) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GrpcService) ProtoMessage() {}
|
func (*GrpcService) ProtoMessage() {}
|
||||||
func (*GrpcService) Descriptor() ([]byte, []int) {
|
func (*GrpcService) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_dc706c3b890c1c84, []int{4}
|
return fileDescriptor_dc706c3b890c1c84, []int{5}
|
||||||
}
|
}
|
||||||
func (m *GrpcService) XXX_Unmarshal(b []byte) error {
|
func (m *GrpcService) XXX_Unmarshal(b []byte) error {
|
||||||
return m.Unmarshal(b)
|
return m.Unmarshal(b)
|
||||||
@@ -385,42 +440,46 @@ func init() {
|
|||||||
proto.RegisterType((*DubboService)(nil), "higress.networking.v1.DubboService")
|
proto.RegisterType((*DubboService)(nil), "higress.networking.v1.DubboService")
|
||||||
proto.RegisterType((*Method)(nil), "higress.networking.v1.Method")
|
proto.RegisterType((*Method)(nil), "higress.networking.v1.Method")
|
||||||
proto.RegisterType((*Param)(nil), "higress.networking.v1.Param")
|
proto.RegisterType((*Param)(nil), "higress.networking.v1.Param")
|
||||||
|
proto.RegisterType((*ParamFromEntireBody)(nil), "higress.networking.v1.ParamFromEntireBody")
|
||||||
proto.RegisterType((*GrpcService)(nil), "higress.networking.v1.GrpcService")
|
proto.RegisterType((*GrpcService)(nil), "higress.networking.v1.GrpcService")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("networking/v1/http_2_rpc.proto", fileDescriptor_dc706c3b890c1c84) }
|
func init() { proto.RegisterFile("networking/v1/http_2_rpc.proto", fileDescriptor_dc706c3b890c1c84) }
|
||||||
|
|
||||||
var fileDescriptor_dc706c3b890c1c84 = []byte{
|
var fileDescriptor_dc706c3b890c1c84 = []byte{
|
||||||
// 463 bytes of a gzipped FileDescriptorProto
|
// 506 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcf, 0x8a, 0xd3, 0x40,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xdf, 0x6e, 0xd3, 0x30,
|
||||||
0x18, 0x77, 0xba, 0x6d, 0xb7, 0xfb, 0x65, 0xeb, 0x61, 0x40, 0x08, 0x8b, 0xc6, 0x35, 0x7b, 0x70,
|
0x14, 0xc6, 0x71, 0xd7, 0x76, 0xdd, 0xc9, 0xca, 0x85, 0x27, 0xa4, 0x68, 0x82, 0x32, 0xb2, 0x0b,
|
||||||
0x41, 0x49, 0xd8, 0xea, 0x41, 0x14, 0x0f, 0x5b, 0x04, 0x17, 0x44, 0x58, 0xb2, 0x9e, 0xbc, 0x84,
|
0x26, 0x40, 0x89, 0x56, 0xb8, 0x40, 0x43, 0x5c, 0xac, 0xe2, 0xcf, 0x24, 0x84, 0x34, 0x65, 0x5c,
|
||||||
0x49, 0x32, 0x66, 0x86, 0x6d, 0x33, 0xc3, 0xcc, 0x34, 0xda, 0xb7, 0xf0, 0x35, 0x7c, 0x13, 0x8f,
|
0x71, 0x13, 0x39, 0x89, 0x49, 0xac, 0xb5, 0xb1, 0x65, 0xbb, 0x85, 0xbc, 0x05, 0xaf, 0xc1, 0x9b,
|
||||||
0x3e, 0x82, 0x14, 0x1f, 0x44, 0x32, 0x93, 0x6e, 0x13, 0xb1, 0xb7, 0xf0, 0xfb, 0x33, 0xdf, 0xef,
|
0xec, 0x92, 0x47, 0x40, 0x7d, 0x12, 0x14, 0x3b, 0x5d, 0x93, 0xa9, 0xdd, 0x5d, 0x74, 0xbe, 0xef,
|
||||||
0xc7, 0xf7, 0x05, 0x82, 0x8a, 0x9a, 0xaf, 0x42, 0xdd, 0xf2, 0xaa, 0x8c, 0xeb, 0x8b, 0x98, 0x19,
|
0x77, 0x7c, 0x3e, 0x9f, 0x18, 0x46, 0x05, 0xd5, 0x3f, 0xb9, 0xbc, 0x66, 0x45, 0x16, 0x2c, 0x4e,
|
||||||
0x23, 0xd3, 0x59, 0xaa, 0x64, 0x1e, 0x49, 0x25, 0x8c, 0xc0, 0x0f, 0x18, 0x2f, 0x15, 0xd5, 0x3a,
|
0x83, 0x5c, 0x6b, 0x11, 0x8d, 0x23, 0x29, 0x12, 0x5f, 0x48, 0xae, 0x39, 0x7e, 0x94, 0xb3, 0x4c,
|
||||||
0xda, 0xe9, 0xa2, 0xfa, 0xe2, 0xe4, 0x71, 0x29, 0x44, 0xb9, 0xa0, 0x31, 0x91, 0x3c, 0xfe, 0xc2,
|
0x52, 0xa5, 0xfc, 0xb5, 0xcf, 0x5f, 0x9c, 0x1e, 0x3e, 0xcd, 0x38, 0xcf, 0xa6, 0x34, 0x20, 0x82,
|
||||||
0xe9, 0xa2, 0x48, 0x33, 0xca, 0x48, 0xcd, 0x85, 0x72, 0xbe, 0xf0, 0x3b, 0x82, 0xc9, 0x95, 0x31,
|
0x05, 0x3f, 0x18, 0x9d, 0xa6, 0x51, 0x4c, 0x73, 0xb2, 0x60, 0x5c, 0x5a, 0xce, 0xfb, 0x8d, 0x60,
|
||||||
0x72, 0x96, 0xc8, 0x1c, 0xbf, 0x81, 0x51, 0xb1, 0xca, 0x32, 0xe1, 0xa3, 0x53, 0x74, 0xee, 0xcd,
|
0x70, 0xa1, 0xb5, 0x18, 0x87, 0x22, 0xc1, 0xef, 0xa0, 0x97, 0xce, 0xe3, 0x98, 0xbb, 0xe8, 0x08,
|
||||||
0xce, 0xa2, 0xff, 0x3e, 0x1a, 0xbd, 0x6b, 0x34, 0x37, 0x54, 0xd5, 0x3c, 0xa7, 0x57, 0xf7, 0x12,
|
0x9d, 0x38, 0xe3, 0x63, 0x7f, 0x63, 0x53, 0xff, 0x43, 0xe5, 0xb9, 0xa2, 0x72, 0xc1, 0x12, 0x7a,
|
||||||
0xe7, 0xc1, 0xaf, 0x60, 0x58, 0x2a, 0x99, 0xfb, 0x03, 0xeb, 0x0d, 0xf7, 0x78, 0xdf, 0x2b, 0x99,
|
0xf1, 0x20, 0xb4, 0x0c, 0x7e, 0x0b, 0xdd, 0x4c, 0x8a, 0xc4, 0xed, 0x18, 0xd6, 0xdb, 0xc2, 0x7e,
|
||||||
0xef, 0xac, 0xd6, 0x31, 0x9f, 0x82, 0x57, 0x50, 0x6d, 0x78, 0x45, 0x0c, 0x17, 0x55, 0xf8, 0x03,
|
0x96, 0x22, 0x59, 0xa3, 0x86, 0x98, 0x0c, 0xc1, 0x49, 0xa9, 0xd2, 0xac, 0x20, 0x9a, 0xf1, 0xc2,
|
||||||
0xc1, 0x71, 0x77, 0x04, 0x0e, 0xe0, 0x50, 0xbb, 0x4f, 0x1b, 0xec, 0x68, 0x3e, 0xdc, 0x5c, 0xa2,
|
0xfb, 0x83, 0x60, 0xbf, 0x79, 0x04, 0x1e, 0xc1, 0xae, 0xb2, 0x9f, 0x66, 0xb0, 0xbd, 0x49, 0x77,
|
||||||
0x41, 0xb2, 0x05, 0x1b, 0xbe, 0xa6, 0x4a, 0x73, 0x51, 0xd9, 0xe1, 0x77, 0x7c, 0x0b, 0xe2, 0x13,
|
0x79, 0x8e, 0x3a, 0xe1, 0xaa, 0x58, 0xe9, 0x0b, 0x2a, 0x15, 0xe3, 0x85, 0x39, 0xfc, 0x56, 0xaf,
|
||||||
0x18, 0x95, 0x4a, 0xac, 0xa4, 0x7f, 0x70, 0xc7, 0xa2, 0xc4, 0x41, 0xf8, 0x2d, 0x1c, 0x2e, 0xa9,
|
0x8b, 0xf8, 0x10, 0x7a, 0x99, 0xe4, 0x73, 0xe1, 0xee, 0xdc, 0xaa, 0x28, 0xb4, 0x25, 0xfc, 0x1e,
|
||||||
0x61, 0xa2, 0xd0, 0xfe, 0xf0, 0xf4, 0xe0, 0xdc, 0x9b, 0x3d, 0xda, 0x13, 0xfc, 0xa3, 0x55, 0x6d,
|
0x76, 0x67, 0x54, 0xe7, 0x3c, 0x55, 0x6e, 0xf7, 0x68, 0xe7, 0xc4, 0x19, 0x3f, 0xd9, 0x32, 0xf8,
|
||||||
0x9f, 0x6e, 0x3d, 0xe1, 0x1f, 0x04, 0x63, 0xc7, 0xe0, 0x67, 0x70, 0xbf, 0x0d, 0x94, 0x3a, 0xb6,
|
0x57, 0xe3, 0x5a, 0xb5, 0xae, 0x19, 0xef, 0xa6, 0x03, 0x7d, 0xab, 0xe0, 0x97, 0xf0, 0xb0, 0x1e,
|
||||||
0x17, 0x76, 0xda, 0x72, 0x3b, 0x31, 0xa3, 0xa4, 0xa0, 0x4a, 0xa7, 0xc4, 0x18, 0x92, 0xb3, 0x4e,
|
0x28, 0xb2, 0x6a, 0x6b, 0xd8, 0x61, 0xad, 0xad, 0xcd, 0x39, 0x25, 0x29, 0x95, 0x2a, 0x22, 0x5a,
|
||||||
0x72, 0x94, 0x4c, 0x5b, 0xee, 0xd2, 0x52, 0xf8, 0x09, 0x1c, 0xd9, 0x7d, 0x4b, 0x62, 0x58, 0xa7,
|
0x93, 0x24, 0x6f, 0x4c, 0x8e, 0xc2, 0x61, 0xad, 0x9d, 0x1b, 0x09, 0x3f, 0x83, 0x3d, 0xb3, 0x6f,
|
||||||
0xc3, 0x20, 0x99, 0x34, 0xf0, 0x35, 0x31, 0x0c, 0x3f, 0x85, 0x63, 0x2b, 0xe9, 0x76, 0xd9, 0xaa,
|
0x41, 0x74, 0xde, 0xc8, 0xd0, 0x09, 0x07, 0x55, 0xf9, 0x92, 0xe8, 0x1c, 0x3f, 0x87, 0x7d, 0x63,
|
||||||
0xbc, 0x86, 0x71, 0x73, 0x35, 0x7e, 0x09, 0x63, 0x49, 0x14, 0x59, 0x6a, 0x7f, 0x64, 0xeb, 0x3e,
|
0x69, 0x66, 0x59, 0xb9, 0x9c, 0x4a, 0xb1, 0xe7, 0x2a, 0xfc, 0x06, 0xfa, 0x82, 0x48, 0x32, 0x53,
|
||||||
0xdc, 0x53, 0xf7, 0xba, 0x11, 0x25, 0xad, 0x36, 0xfc, 0x06, 0x23, 0x0b, 0x34, 0x73, 0x2c, 0x94,
|
0x6e, 0xcf, 0xc4, 0x7d, 0xbc, 0x25, 0xee, 0x65, 0x65, 0x0a, 0x6b, 0x2f, 0x8e, 0xe1, 0xc0, 0x7c,
|
||||||
0x6a, 0xb1, 0x52, 0xff, 0xec, 0xc3, 0xb3, 0xcc, 0x8d, 0x25, 0x9a, 0xcc, 0x4e, 0x78, 0x4b, 0xd7,
|
0x7d, 0x92, 0x7c, 0xf6, 0xb1, 0xd0, 0x4c, 0xd2, 0x09, 0x4f, 0x4b, 0xb7, 0x6f, 0x56, 0xfd, 0xe2,
|
||||||
0xbd, 0xad, 0x4c, 0x2c, 0xfc, 0x81, 0xae, 0xf1, 0x19, 0x80, 0x93, 0x98, 0xb5, 0xa4, 0xbd, 0x5e,
|
0xbe, 0x16, 0x6d, 0xa2, 0xce, 0xb7, 0xa9, 0x99, 0xf7, 0x0b, 0x7a, 0x86, 0xa8, 0xb2, 0x18, 0x3d,
|
||||||
0xce, 0xfa, 0x69, 0x2d, 0x69, 0x38, 0x05, 0xaf, 0x73, 0x32, 0xf3, 0xd7, 0x3f, 0x37, 0x01, 0xfa,
|
0x52, 0x7c, 0x2e, 0xef, 0xec, 0xdc, 0x31, 0xca, 0x95, 0x11, 0xaa, 0x7b, 0xb1, 0xc6, 0x6b, 0x5a,
|
||||||
0xb5, 0x09, 0xd0, 0xef, 0x4d, 0x80, 0x3e, 0x3f, 0x2f, 0xb9, 0x61, 0xab, 0x2c, 0xca, 0xc5, 0x32,
|
0xb6, 0x36, 0x3f, 0x30, 0xe5, 0x2f, 0xb4, 0xc4, 0xc7, 0x00, 0xd6, 0xa2, 0x4b, 0x41, 0x5b, 0x77,
|
||||||
0x26, 0x0b, 0x9e, 0x91, 0x8c, 0xc4, 0x6d, 0x1d, 0x7b, 0xf1, 0xbd, 0x7f, 0x26, 0x1b, 0xdb, 0x8b,
|
0x67, 0xd1, 0x6f, 0xa5, 0xa0, 0xde, 0x19, 0x1c, 0x6c, 0x98, 0xf5, 0x0e, 0x8b, 0x36, 0xb3, 0x43,
|
||||||
0x7f, 0xf1, 0x37, 0x00, 0x00, 0xff, 0xff, 0x75, 0x5c, 0x9e, 0x28, 0x4b, 0x03, 0x00, 0x00,
|
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) {
|
func (m *Http2Rpc) Marshal() (dAtA []byte, err error) {
|
||||||
@@ -587,6 +646,18 @@ func (m *Method) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
i -= len(m.XXX_unrecognized)
|
i -= len(m.XXX_unrecognized)
|
||||||
copy(dAtA[i:], 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 {
|
if len(m.Params) > 0 {
|
||||||
for iNdEx := len(m.Params) - 1; iNdEx >= 0; iNdEx-- {
|
for iNdEx := len(m.Params) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
{
|
{
|
||||||
@@ -682,6 +753,40 @@ func (m *Param) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
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) {
|
func (m *GrpcService) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
@@ -819,6 +924,10 @@ func (m *Method) Size() (n int) {
|
|||||||
n += 1 + l + sovHttp_2Rpc(uint64(l))
|
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 {
|
if m.XXX_unrecognized != nil {
|
||||||
n += len(m.XXX_unrecognized)
|
n += len(m.XXX_unrecognized)
|
||||||
}
|
}
|
||||||
@@ -849,6 +958,22 @@ func (m *Param) Size() (n int) {
|
|||||||
return n
|
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) {
|
func (m *GrpcService) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
@@ -1360,6 +1485,42 @@ func (m *Method) Unmarshal(dAtA []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
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:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipHttp_2Rpc(dAtA[iNdEx:])
|
skippy, err := skipHttp_2Rpc(dAtA[iNdEx:])
|
||||||
@@ -1529,6 +1690,89 @@ func (m *Param) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
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 {
|
func (m *GrpcService) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ message Method {
|
|||||||
string http_path = 3 [(google.api.field_behavior) = REQUIRED];
|
string http_path = 3 [(google.api.field_behavior) = REQUIRED];
|
||||||
repeated string http_methods = 4 [(google.api.field_behavior) = REQUIRED];
|
repeated string http_methods = 4 [(google.api.field_behavior) = REQUIRED];
|
||||||
repeated Param params = 5;
|
repeated Param params = 5;
|
||||||
|
ParamFromEntireBody paramFromEntireBody = 6 [(google.api.field_behavior) = OPTIONAL];
|
||||||
}
|
}
|
||||||
|
|
||||||
message Param {
|
message Param {
|
||||||
@@ -70,5 +71,9 @@ message Param {
|
|||||||
string param_type = 3 [(google.api.field_behavior) = REQUIRED];
|
string param_type = 3 [(google.api.field_behavior) = REQUIRED];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message ParamFromEntireBody {
|
||||||
|
string param_type = 1 [(google.api.field_behavior) = REQUIRED];
|
||||||
|
}
|
||||||
|
|
||||||
message GrpcService {
|
message GrpcService {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,27 @@ func (in *Param) DeepCopyInterface() interface{} {
|
|||||||
return in.DeepCopy()
|
return in.DeepCopy()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto supports using ParamFromEntireBody within kubernetes types, where deepcopy-gen is used.
|
||||||
|
func (in *ParamFromEntireBody) DeepCopyInto(out *ParamFromEntireBody) {
|
||||||
|
p := proto.Clone(in).(*ParamFromEntireBody)
|
||||||
|
*out = *p
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParamFromEntireBody. Required by controller-gen.
|
||||||
|
func (in *ParamFromEntireBody) DeepCopy() *ParamFromEntireBody {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(ParamFromEntireBody)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new ParamFromEntireBody. Required by controller-gen.
|
||||||
|
func (in *ParamFromEntireBody) DeepCopyInterface() interface{} {
|
||||||
|
return in.DeepCopy()
|
||||||
|
}
|
||||||
|
|
||||||
// DeepCopyInto supports using GrpcService within kubernetes types, where deepcopy-gen is used.
|
// DeepCopyInto supports using GrpcService within kubernetes types, where deepcopy-gen is used.
|
||||||
func (in *GrpcService) DeepCopyInto(out *GrpcService) {
|
func (in *GrpcService) DeepCopyInto(out *GrpcService) {
|
||||||
p := proto.Clone(in).(*GrpcService)
|
p := proto.Clone(in).(*GrpcService)
|
||||||
|
|||||||
@@ -61,6 +61,17 @@ func (this *Param) UnmarshalJSON(b []byte) error {
|
|||||||
return Http_2RpcUnmarshaler.Unmarshal(bytes.NewReader(b), this)
|
return Http_2RpcUnmarshaler.Unmarshal(bytes.NewReader(b), this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarshalJSON is a custom marshaler for ParamFromEntireBody
|
||||||
|
func (this *ParamFromEntireBody) MarshalJSON() ([]byte, error) {
|
||||||
|
str, err := Http_2RpcMarshaler.MarshalToString(this)
|
||||||
|
return []byte(str), err
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON is a custom unmarshaler for ParamFromEntireBody
|
||||||
|
func (this *ParamFromEntireBody) UnmarshalJSON(b []byte) error {
|
||||||
|
return Http_2RpcUnmarshaler.Unmarshal(bytes.NewReader(b), this)
|
||||||
|
}
|
||||||
|
|
||||||
// MarshalJSON is a custom marshaler for GrpcService
|
// MarshalJSON is a custom marshaler for GrpcService
|
||||||
func (this *GrpcService) MarshalJSON() ([]byte, error) {
|
func (this *GrpcService) MarshalJSON() ([]byte, error) {
|
||||||
str, err := Http_2RpcMarshaler.MarshalToString(this)
|
str, err := Http_2RpcMarshaler.MarshalToString(this)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package hgctl
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
@@ -27,26 +27,61 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
output string
|
BootstrapEnvoyConfigType EnvoyConfigType = "bootstrap"
|
||||||
podName string
|
ClusterEnvoyConfigType EnvoyConfigType = "cluster"
|
||||||
podNamespace string
|
EndpointEnvoyConfigType EnvoyConfigType = "endpoint"
|
||||||
|
ListenerEnvoyConfigType EnvoyConfigType = "listener"
|
||||||
|
RouteEnvoyConfigType EnvoyConfigType = "route"
|
||||||
|
AllEnvoyConfigType EnvoyConfigType = "all"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
defaultProxyAdminPort = 15000
|
defaultProxyAdminPort = 15000
|
||||||
containerName = "envoy"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func retrieveConfigDump(args []string, includeEds bool) ([]byte, error) {
|
type EnvoyConfigType string
|
||||||
if len(args) != 0 {
|
|
||||||
podName = args[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
|
type GetEnvoyConfigOptions struct {
|
||||||
|
IncludeEds bool
|
||||||
|
PodName string
|
||||||
|
PodNamespace string
|
||||||
|
BindAddress string
|
||||||
|
Output string
|
||||||
|
EnvoyConfigType EnvoyConfigType
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDefaultGetEnvoyConfigOptions() *GetEnvoyConfigOptions {
|
||||||
|
return &GetEnvoyConfigOptions{
|
||||||
|
IncludeEds: true,
|
||||||
|
PodName: "",
|
||||||
|
PodNamespace: "higress-system",
|
||||||
|
BindAddress: "localhost",
|
||||||
|
Output: "json",
|
||||||
|
EnvoyConfigType: AllEnvoyConfigType,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetEnvoyConfig(config *GetEnvoyConfigOptions) ([]byte, error) {
|
||||||
|
configDump, err := retrieveConfigDump(config.PodName, config.PodNamespace, config.BindAddress, config.IncludeEds)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if config.EnvoyConfigType == AllEnvoyConfigType {
|
||||||
|
return configDump, nil
|
||||||
|
}
|
||||||
|
resource, err := getXDSResource(config.EnvoyConfigType, configDump)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return formatGatewayConfig(resource, config.Output)
|
||||||
|
}
|
||||||
|
|
||||||
|
func retrieveConfigDump(podName, podNamespace, bindAddress string, includeEds bool) ([]byte, error) {
|
||||||
if podNamespace == "" {
|
if podNamespace == "" {
|
||||||
return nil, fmt.Errorf("pod namespace is required")
|
return nil, fmt.Errorf("pod namespace is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
if podName == "" || len(args) == 0 {
|
if podName == "" {
|
||||||
c, err := kubernetes.NewCLIClient(options.DefaultConfigFlags.ToRawKubeConfigLoader())
|
c, err := kubernetes.NewCLIClient(options.DefaultConfigFlags.ToRawKubeConfigLoader())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to build kubernetes client: %w", err)
|
return nil, fmt.Errorf("failed to build kubernetes client: %w", err)
|
||||||
@@ -65,7 +100,7 @@ func retrieveConfigDump(args []string, includeEds bool) ([]byte, error) {
|
|||||||
fw, err := portForwarder(types.NamespacedName{
|
fw, err := portForwarder(types.NamespacedName{
|
||||||
Namespace: podNamespace,
|
Namespace: podNamespace,
|
||||||
Name: podName,
|
Name: podName,
|
||||||
})
|
}, bindAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -82,7 +117,7 @@ func retrieveConfigDump(args []string, includeEds bool) ([]byte, error) {
|
|||||||
return configDump, nil
|
return configDump, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func portForwarder(nn types.NamespacedName) (kubernetes.PortForwarder, error) {
|
func portForwarder(nn types.NamespacedName, bindAddress string) (kubernetes.PortForwarder, error) {
|
||||||
c, err := kubernetes.NewCLIClient(options.DefaultConfigFlags.ToRawKubeConfigLoader())
|
c, err := kubernetes.NewCLIClient(options.DefaultConfigFlags.ToRawKubeConfigLoader())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("build CLI client fail: %w", err)
|
return nil, fmt.Errorf("build CLI client fail: %w", err)
|
||||||
@@ -96,7 +131,7 @@ func portForwarder(nn types.NamespacedName) (kubernetes.PortForwarder, error) {
|
|||||||
return nil, fmt.Errorf("pod %s is not running", nn)
|
return nil, fmt.Errorf("pod %s is not running", nn)
|
||||||
}
|
}
|
||||||
|
|
||||||
fw, err := kubernetes.NewLocalPortForwarder(c, nn, 0, defaultProxyAdminPort)
|
fw, err := kubernetes.NewLocalPortForwarder(c, nn, 0, defaultProxyAdminPort, bindAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -149,3 +184,53 @@ func configDumpRequest(address string, includeEds bool) ([]byte, error) {
|
|||||||
|
|
||||||
return io.ReadAll(resp.Body)
|
return io.ReadAll(resp.Body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getXDSResource(resourceType EnvoyConfigType, configDump []byte) (any, error) {
|
||||||
|
cd := map[string]any{}
|
||||||
|
if err := json.Unmarshal(configDump, &cd); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if resourceType == AllEnvoyConfigType {
|
||||||
|
return cd, nil
|
||||||
|
}
|
||||||
|
configs := cd["configs"]
|
||||||
|
globalConfigs := configs.([]any)
|
||||||
|
|
||||||
|
switch resourceType {
|
||||||
|
case BootstrapEnvoyConfigType:
|
||||||
|
for _, config := range globalConfigs {
|
||||||
|
if config.(map[string]interface{})["@type"] == "type.googleapis.com/envoy.admin.v3.BootstrapConfigDump" {
|
||||||
|
return config, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case EndpointEnvoyConfigType:
|
||||||
|
for _, config := range globalConfigs {
|
||||||
|
if config.(map[string]interface{})["@type"] == "type.googleapis.com/envoy.admin.v3.EndpointsConfigDump" {
|
||||||
|
return config, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
case ClusterEnvoyConfigType:
|
||||||
|
for _, config := range globalConfigs {
|
||||||
|
if config.(map[string]interface{})["@type"] == "type.googleapis.com/envoy.admin.v3.ClustersConfigDump" {
|
||||||
|
return config, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case ListenerEnvoyConfigType:
|
||||||
|
for _, config := range globalConfigs {
|
||||||
|
if config.(map[string]interface{})["@type"] == "type.googleapis.com/envoy.admin.v3.ListenersConfigDump" {
|
||||||
|
return config, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case RouteEnvoyConfigType:
|
||||||
|
for _, config := range globalConfigs {
|
||||||
|
if config.(map[string]interface{})["@type"] == "type.googleapis.com/envoy.admin.v3.RoutesConfigDump" {
|
||||||
|
return config, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return nil, fmt.Errorf("unknown resourceType %s", resourceType)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, fmt.Errorf("unknown resourceType %s", resourceType)
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package hgctl
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -38,7 +38,7 @@ type fakePortForwarder struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newFakePortForwarder(b []byte) (kubernetes.PortForwarder, error) {
|
func newFakePortForwarder(b []byte) (kubernetes.PortForwarder, error) {
|
||||||
p, err := kubernetes.LocalAvailablePort()
|
p, err := kubernetes.LocalAvailablePort("localhost")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ func TestExtractAllConfigDump(t *testing.T) {
|
|||||||
t.Run(tc.output, func(t *testing.T) {
|
t.Run(tc.output, func(t *testing.T) {
|
||||||
configDump, err := fetchGatewayConfig(fw, true)
|
configDump, err := fetchGatewayConfig(fw, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
data, err := GetXDSResource(AllEnvoyConfigType, configDump)
|
data, err := getXDSResource(AllEnvoyConfigType, configDump)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
got, err := formatGatewayConfig(data, tc.output)
|
got, err := formatGatewayConfig(data, tc.output)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
@@ -137,7 +137,7 @@ func TestExtractSubResourcesConfigDump(t *testing.T) {
|
|||||||
cases := []struct {
|
cases := []struct {
|
||||||
output string
|
output string
|
||||||
expected string
|
expected string
|
||||||
resourceType envoyConfigType
|
resourceType EnvoyConfigType
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
output: "json",
|
output: "json",
|
||||||
@@ -192,7 +192,7 @@ func TestExtractSubResourcesConfigDump(t *testing.T) {
|
|||||||
t.Run(tc.output, func(t *testing.T) {
|
t.Run(tc.output, func(t *testing.T) {
|
||||||
configDump, err := fetchGatewayConfig(fw, false)
|
configDump, err := fetchGatewayConfig(fw, false)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
resource, err := GetXDSResource(tc.resourceType, configDump)
|
resource, err := getXDSResource(tc.resourceType, configDump)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
got, err := formatGatewayConfig(resource, tc.output)
|
got, err := formatGatewayConfig(resource, tc.output)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
@@ -2,7 +2,11 @@ codecov:
|
|||||||
require_ci_to_pass: yes
|
require_ci_to_pass: yes
|
||||||
coverage:
|
coverage:
|
||||||
status:
|
status:
|
||||||
patch: no
|
patch:
|
||||||
|
default:
|
||||||
|
target: 50%
|
||||||
|
threshold: 0%
|
||||||
|
if_ci_failed: error # success, failure, error, ignore
|
||||||
project:
|
project:
|
||||||
default:
|
default:
|
||||||
target: auto
|
target: auto
|
||||||
@@ -17,4 +21,4 @@ ignore:
|
|||||||
comment:
|
comment:
|
||||||
layout: "reach,diff,flags,tree"
|
layout: "reach,diff,flags,tree"
|
||||||
behavior: default
|
behavior: default
|
||||||
require_changes: no
|
require_changes: no
|
||||||
315
envoy/1.20/patches/envoy/20231124-rds-optimize.patch
Normal file
315
envoy/1.20/patches/envoy/20231124-rds-optimize.patch
Normal file
@@ -0,0 +1,315 @@
|
|||||||
|
diff -Naur envoy/envoy/router/rds.h envoy-new/envoy/router/rds.h
|
||||||
|
--- envoy/envoy/router/rds.h 2023-11-24 10:52:39.914235488 +0800
|
||||||
|
+++ envoy-new/envoy/router/rds.h 2023-11-24 10:47:36.293873127 +0800
|
||||||
|
@@ -51,12 +51,6 @@
|
||||||
|
virtual void onConfigUpdate() PURE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
- * Validate if the route configuration can be applied to the context of the route config provider.
|
||||||
|
- */
|
||||||
|
- virtual void
|
||||||
|
- validateConfig(const envoy::config::route::v3::RouteConfiguration& config) const PURE;
|
||||||
|
-
|
||||||
|
- /**
|
||||||
|
* Callback used to request an update to the route configuration from the management server.
|
||||||
|
* @param for_domain supplies the domain name that virtual hosts must match on
|
||||||
|
* @param thread_local_dispatcher thread-local dispatcher
|
||||||
|
diff -Naur envoy/envoy/router/route_config_update_receiver.h envoy-new/envoy/router/route_config_update_receiver.h
|
||||||
|
--- envoy/envoy/router/route_config_update_receiver.h 2023-11-24 10:52:39.918235651 +0800
|
||||||
|
+++ envoy-new/envoy/router/route_config_update_receiver.h 2023-11-24 10:47:36.293873127 +0800
|
||||||
|
@@ -27,6 +27,7 @@
|
||||||
|
* @param rc supplies the RouteConfiguration.
|
||||||
|
* @param version_info supplies RouteConfiguration version.
|
||||||
|
* @return bool whether RouteConfiguration has been updated.
|
||||||
|
+ * @throw EnvoyException if the new config can't be applied.
|
||||||
|
*/
|
||||||
|
virtual bool onRdsUpdate(const envoy::config::route::v3::RouteConfiguration& rc,
|
||||||
|
const std::string& version_info) PURE;
|
||||||
|
diff -Naur envoy/source/common/router/rds_impl.cc envoy-new/source/common/router/rds_impl.cc
|
||||||
|
--- envoy/source/common/router/rds_impl.cc 2023-11-24 10:52:40.194246888 +0800
|
||||||
|
+++ envoy-new/source/common/router/rds_impl.cc 2023-11-24 10:47:36.293873127 +0800
|
||||||
|
@@ -122,9 +122,6 @@
|
||||||
|
throw EnvoyException(fmt::format("Unexpected RDS configuration (expecting {}): {}",
|
||||||
|
route_config_name_, route_config.name()));
|
||||||
|
}
|
||||||
|
- if (route_config_provider_opt_.has_value()) {
|
||||||
|
- route_config_provider_opt_.value()->validateConfig(route_config);
|
||||||
|
- }
|
||||||
|
std::unique_ptr<Init::ManagerImpl> noop_init_manager;
|
||||||
|
std::unique_ptr<Cleanup> resume_rds;
|
||||||
|
if (config_update_info_->onRdsUpdate(route_config, version_info)) {
|
||||||
|
@@ -292,12 +289,6 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-void RdsRouteConfigProviderImpl::validateConfig(
|
||||||
|
- const envoy::config::route::v3::RouteConfiguration& config) const {
|
||||||
|
- // TODO(lizan): consider cache the config here until onConfigUpdate.
|
||||||
|
- ConfigImpl validation_config(config, optional_http_filters_, factory_context_, validator_, false);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
// Schedules a VHDS request on the main thread and queues up the callback to use when the VHDS
|
||||||
|
// response has been propagated to the worker thread that was the request origin.
|
||||||
|
void RdsRouteConfigProviderImpl::requestVirtualHostsUpdate(
|
||||||
|
diff -Naur envoy/source/common/router/rds_impl.h envoy-new/source/common/router/rds_impl.h
|
||||||
|
--- envoy/source/common/router/rds_impl.h 2023-11-24 10:52:40.194246888 +0800
|
||||||
|
+++ envoy-new/source/common/router/rds_impl.h 2023-11-24 10:47:36.293873127 +0800
|
||||||
|
@@ -81,7 +81,6 @@
|
||||||
|
}
|
||||||
|
SystemTime lastUpdated() const override { return last_updated_; }
|
||||||
|
void onConfigUpdate() override {}
|
||||||
|
- void validateConfig(const envoy::config::route::v3::RouteConfiguration&) const override {}
|
||||||
|
void requestVirtualHostsUpdate(const std::string&, Event::Dispatcher&,
|
||||||
|
std::weak_ptr<Http::RouteConfigUpdatedCallback>) override {
|
||||||
|
NOT_IMPLEMENTED_GCOVR_EXCL_LINE;
|
||||||
|
@@ -209,7 +208,6 @@
|
||||||
|
void requestVirtualHostsUpdate(
|
||||||
|
const std::string& for_domain, Event::Dispatcher& thread_local_dispatcher,
|
||||||
|
std::weak_ptr<Http::RouteConfigUpdatedCallback> route_config_updated_cb) override;
|
||||||
|
- void validateConfig(const envoy::config::route::v3::RouteConfiguration& config) const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
struct ThreadLocalConfig : public ThreadLocal::ThreadLocalObject {
|
||||||
|
diff -Naur envoy/source/common/router/route_config_update_receiver_impl.cc envoy-new/source/common/router/route_config_update_receiver_impl.cc
|
||||||
|
--- envoy/source/common/router/route_config_update_receiver_impl.cc 2023-11-24 10:52:40.194246888 +0800
|
||||||
|
+++ envoy-new/source/common/router/route_config_update_receiver_impl.cc 2023-11-24 10:47:36.297873290 +0800
|
||||||
|
@@ -1,6 +1,7 @@
|
||||||
|
#include "source/common/router/route_config_update_receiver_impl.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
+#include <utility>
|
||||||
|
|
||||||
|
#include "envoy/config/route/v3/route.pb.h"
|
||||||
|
#include "envoy/service/discovery/v3/discovery.pb.h"
|
||||||
|
@@ -14,23 +15,49 @@
|
||||||
|
namespace Envoy {
|
||||||
|
namespace Router {
|
||||||
|
|
||||||
|
+namespace {
|
||||||
|
+
|
||||||
|
+// Resets 'route_config::virtual_hosts' by merging VirtualHost contained in
|
||||||
|
+// 'rds_vhosts' and 'vhds_vhosts'.
|
||||||
|
+void rebuildRouteConfigVirtualHosts(
|
||||||
|
+ const std::map<std::string, envoy::config::route::v3::VirtualHost>& rds_vhosts,
|
||||||
|
+ const std::map<std::string, envoy::config::route::v3::VirtualHost>& vhds_vhosts,
|
||||||
|
+ envoy::config::route::v3::RouteConfiguration& route_config) {
|
||||||
|
+ route_config.clear_virtual_hosts();
|
||||||
|
+ for (const auto& vhost : rds_vhosts) {
|
||||||
|
+ route_config.mutable_virtual_hosts()->Add()->CopyFrom(vhost.second);
|
||||||
|
+ }
|
||||||
|
+ for (const auto& vhost : vhds_vhosts) {
|
||||||
|
+ route_config.mutable_virtual_hosts()->Add()->CopyFrom(vhost.second);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+} // namespace
|
||||||
|
+
|
||||||
|
bool RouteConfigUpdateReceiverImpl::onRdsUpdate(
|
||||||
|
const envoy::config::route::v3::RouteConfiguration& rc, const std::string& version_info) {
|
||||||
|
const uint64_t new_hash = MessageUtil::hash(rc);
|
||||||
|
if (new_hash == last_config_hash_) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
- route_config_proto_ = std::make_unique<envoy::config::route::v3::RouteConfiguration>(rc);
|
||||||
|
- last_config_hash_ = new_hash;
|
||||||
|
const uint64_t new_vhds_config_hash = rc.has_vhds() ? MessageUtil::hash(rc.vhds()) : 0ul;
|
||||||
|
+ std::map<std::string, envoy::config::route::v3::VirtualHost> rds_virtual_hosts;
|
||||||
|
+ for (const auto& vhost : rc.virtual_hosts()) {
|
||||||
|
+ rds_virtual_hosts.emplace(vhost.name(), vhost);
|
||||||
|
+ }
|
||||||
|
+ envoy::config::route::v3::RouteConfiguration new_route_config = rc;
|
||||||
|
+ rebuildRouteConfigVirtualHosts(rds_virtual_hosts, *vhds_virtual_hosts_, new_route_config);
|
||||||
|
+ auto new_config = std::make_shared<ConfigImpl>(
|
||||||
|
+ new_route_config, optional_http_filters_, factory_context_,
|
||||||
|
+ factory_context_.messageValidationContext().dynamicValidationVisitor(), false);
|
||||||
|
+ // If the above validation/validation doesn't raise exception, update the
|
||||||
|
+ // other cached config entries.
|
||||||
|
+ config_ = new_config;
|
||||||
|
+ rds_virtual_hosts_ = std::move(rds_virtual_hosts);
|
||||||
|
+ last_config_hash_ = new_hash;
|
||||||
|
+ *route_config_proto_ = std::move(new_route_config);
|
||||||
|
vhds_configuration_changed_ = new_vhds_config_hash != last_vhds_config_hash_;
|
||||||
|
last_vhds_config_hash_ = new_vhds_config_hash;
|
||||||
|
- initializeRdsVhosts(*route_config_proto_);
|
||||||
|
-
|
||||||
|
- rebuildRouteConfig(rds_virtual_hosts_, *vhds_virtual_hosts_, *route_config_proto_);
|
||||||
|
- config_ = std::make_shared<ConfigImpl>(
|
||||||
|
- *route_config_proto_, optional_http_filters_, factory_context_,
|
||||||
|
- factory_context_.messageValidationContext().dynamicValidationVisitor(), false);
|
||||||
|
|
||||||
|
onUpdateCommon(version_info);
|
||||||
|
return true;
|
||||||
|
@@ -50,8 +77,8 @@
|
||||||
|
auto route_config_after_this_update =
|
||||||
|
std::make_unique<envoy::config::route::v3::RouteConfiguration>();
|
||||||
|
route_config_after_this_update->CopyFrom(*route_config_proto_);
|
||||||
|
- rebuildRouteConfig(rds_virtual_hosts_, *vhosts_after_this_update,
|
||||||
|
- *route_config_after_this_update);
|
||||||
|
+ rebuildRouteConfigVirtualHosts(rds_virtual_hosts_, *vhosts_after_this_update,
|
||||||
|
+ *route_config_after_this_update);
|
||||||
|
|
||||||
|
auto new_config = std::make_shared<ConfigImpl>(
|
||||||
|
*route_config_after_this_update, optional_http_filters_, factory_context_,
|
||||||
|
@@ -73,14 +100,6 @@
|
||||||
|
config_info_.emplace(RouteConfigProvider::ConfigInfo{*route_config_proto_, last_config_version_});
|
||||||
|
}
|
||||||
|
|
||||||
|
-void RouteConfigUpdateReceiverImpl::initializeRdsVhosts(
|
||||||
|
- const envoy::config::route::v3::RouteConfiguration& route_configuration) {
|
||||||
|
- rds_virtual_hosts_.clear();
|
||||||
|
- for (const auto& vhost : route_configuration.virtual_hosts()) {
|
||||||
|
- rds_virtual_hosts_.emplace(vhost.name(), vhost);
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
bool RouteConfigUpdateReceiverImpl::removeVhosts(
|
||||||
|
std::map<std::string, envoy::config::route::v3::VirtualHost>& vhosts,
|
||||||
|
const Protobuf::RepeatedPtrField<std::string>& removed_vhost_names) {
|
||||||
|
@@ -110,18 +129,5 @@
|
||||||
|
return vhosts_added;
|
||||||
|
}
|
||||||
|
|
||||||
|
-void RouteConfigUpdateReceiverImpl::rebuildRouteConfig(
|
||||||
|
- const std::map<std::string, envoy::config::route::v3::VirtualHost>& rds_vhosts,
|
||||||
|
- const std::map<std::string, envoy::config::route::v3::VirtualHost>& vhds_vhosts,
|
||||||
|
- envoy::config::route::v3::RouteConfiguration& route_config) {
|
||||||
|
- route_config.clear_virtual_hosts();
|
||||||
|
- for (const auto& vhost : rds_vhosts) {
|
||||||
|
- route_config.mutable_virtual_hosts()->Add()->CopyFrom(vhost.second);
|
||||||
|
- }
|
||||||
|
- for (const auto& vhost : vhds_vhosts) {
|
||||||
|
- route_config.mutable_virtual_hosts()->Add()->CopyFrom(vhost.second);
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
} // namespace Router
|
||||||
|
} // namespace Envoy
|
||||||
|
diff -Naur envoy/source/common/router/route_config_update_receiver_impl.h envoy-new/source/common/router/route_config_update_receiver_impl.h
|
||||||
|
--- envoy/source/common/router/route_config_update_receiver_impl.h 2023-11-24 10:52:40.194246888 +0800
|
||||||
|
+++ envoy-new/source/common/router/route_config_update_receiver_impl.h 2023-11-24 10:47:36.297873290 +0800
|
||||||
|
@@ -27,15 +27,10 @@
|
||||||
|
std::make_unique<std::map<std::string, envoy::config::route::v3::VirtualHost>>()),
|
||||||
|
vhds_configuration_changed_(true), optional_http_filters_(optional_http_filters) {}
|
||||||
|
|
||||||
|
- void initializeRdsVhosts(const envoy::config::route::v3::RouteConfiguration& route_configuration);
|
||||||
|
bool removeVhosts(std::map<std::string, envoy::config::route::v3::VirtualHost>& vhosts,
|
||||||
|
const Protobuf::RepeatedPtrField<std::string>& removed_vhost_names);
|
||||||
|
bool updateVhosts(std::map<std::string, envoy::config::route::v3::VirtualHost>& vhosts,
|
||||||
|
const VirtualHostRefVector& added_vhosts);
|
||||||
|
- void rebuildRouteConfig(
|
||||||
|
- const std::map<std::string, envoy::config::route::v3::VirtualHost>& rds_vhosts,
|
||||||
|
- const std::map<std::string, envoy::config::route::v3::VirtualHost>& vhds_vhosts,
|
||||||
|
- envoy::config::route::v3::RouteConfiguration& route_config);
|
||||||
|
bool onDemandFetchFailed(const envoy::service::discovery::v3::Resource& resource) const;
|
||||||
|
void onUpdateCommon(const std::string& version_info);
|
||||||
|
|
||||||
|
diff -Naur envoy/source/server/admin/admin.h envoy-new/source/server/admin/admin.h
|
||||||
|
--- envoy/source/server/admin/admin.h 2023-11-24 10:52:41.358294284 +0800
|
||||||
|
+++ envoy-new/source/server/admin/admin.h 2023-11-24 10:47:36.297873290 +0800
|
||||||
|
@@ -234,7 +234,6 @@
|
||||||
|
absl::optional<ConfigInfo> configInfo() const override { return {}; }
|
||||||
|
SystemTime lastUpdated() const override { return time_source_.systemTime(); }
|
||||||
|
void onConfigUpdate() override {}
|
||||||
|
- void validateConfig(const envoy::config::route::v3::RouteConfiguration&) const override {}
|
||||||
|
void requestVirtualHostsUpdate(const std::string&, Event::Dispatcher&,
|
||||||
|
std::weak_ptr<Http::RouteConfigUpdatedCallback>) override {
|
||||||
|
NOT_IMPLEMENTED_GCOVR_EXCL_LINE;
|
||||||
|
diff -Naur envoy/test/common/router/rds_impl_test.cc envoy-new/test/common/router/rds_impl_test.cc
|
||||||
|
--- envoy/test/common/router/rds_impl_test.cc 2023-11-24 10:52:40.714268062 +0800
|
||||||
|
+++ envoy-new/test/common/router/rds_impl_test.cc 2023-11-24 10:47:36.297873290 +0800
|
||||||
|
@@ -528,34 +528,66 @@
|
||||||
|
rds_callbacks_->onConfigUpdate(decoded_resources.refvec_, response1.version_info());
|
||||||
|
}
|
||||||
|
|
||||||
|
-// Validate behavior when the config is delivered but it fails PGV validation.
|
||||||
|
+// Validates behavior when the config is delivered but it fails PGV validation.
|
||||||
|
+// The invalid config won't affect existing valid config.
|
||||||
|
TEST_F(RdsImplTest, FailureInvalidConfig) {
|
||||||
|
InSequence s;
|
||||||
|
|
||||||
|
setup();
|
||||||
|
+ EXPECT_CALL(init_watcher_, ready());
|
||||||
|
|
||||||
|
- const std::string response1_json = R"EOF(
|
||||||
|
+ const std::string valid_json = R"EOF(
|
||||||
|
{
|
||||||
|
"version_info": "1",
|
||||||
|
"resources": [
|
||||||
|
{
|
||||||
|
"@type": "type.googleapis.com/envoy.config.route.v3.RouteConfiguration",
|
||||||
|
- "name": "INVALID_NAME_FOR_route_config",
|
||||||
|
+ "name": "foo_route_config",
|
||||||
|
"virtual_hosts": null
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
)EOF";
|
||||||
|
+
|
||||||
|
auto response1 =
|
||||||
|
- TestUtility::parseYaml<envoy::service::discovery::v3::DiscoveryResponse>(response1_json);
|
||||||
|
+ TestUtility::parseYaml<envoy::service::discovery::v3::DiscoveryResponse>(valid_json);
|
||||||
|
const auto decoded_resources =
|
||||||
|
TestUtility::decodeResources<envoy::config::route::v3::RouteConfiguration>(response1);
|
||||||
|
+ EXPECT_NO_THROW(
|
||||||
|
+ rds_callbacks_->onConfigUpdate(decoded_resources.refvec_, response1.version_info()));
|
||||||
|
+ // Sadly the RdsRouteConfigSubscription privately inherited from
|
||||||
|
+ // SubscriptionCallbacks, so we has to use reinterpret_cast here.
|
||||||
|
+ RdsRouteConfigSubscription* rds_subscription =
|
||||||
|
+ reinterpret_cast<RdsRouteConfigSubscription*>(rds_callbacks_);
|
||||||
|
+ auto config_impl_pointer = rds_subscription->routeConfigProvider().value()->config();
|
||||||
|
+ // Now send an invalid config update.
|
||||||
|
+ const std::string invalid_json =
|
||||||
|
+ R"EOF(
|
||||||
|
+{
|
||||||
|
+ "version_info": "1",
|
||||||
|
+ "resources": [
|
||||||
|
+ {
|
||||||
|
+ "@type": "type.googleapis.com/envoy.config.route.v3.RouteConfiguration",
|
||||||
|
+ "name": "INVALID_NAME_FOR_route_config",
|
||||||
|
+ "virtual_hosts": null
|
||||||
|
+ }
|
||||||
|
+ ]
|
||||||
|
+}
|
||||||
|
+)EOF";
|
||||||
|
+
|
||||||
|
+ auto response2 =
|
||||||
|
+ TestUtility::parseYaml<envoy::service::discovery::v3::DiscoveryResponse>(invalid_json);
|
||||||
|
+ const auto decoded_resources_2 =
|
||||||
|
+ TestUtility::decodeResources<envoy::config::route::v3::RouteConfiguration>(response2);
|
||||||
|
|
||||||
|
- EXPECT_CALL(init_watcher_, ready());
|
||||||
|
EXPECT_THROW_WITH_MESSAGE(
|
||||||
|
- rds_callbacks_->onConfigUpdate(decoded_resources.refvec_, response1.version_info()),
|
||||||
|
+ rds_callbacks_->onConfigUpdate(decoded_resources_2.refvec_, response2.version_info()),
|
||||||
|
EnvoyException,
|
||||||
|
- "Unexpected RDS configuration (expecting foo_route_config): INVALID_NAME_FOR_route_config");
|
||||||
|
+ "Unexpected RDS configuration (expecting foo_route_config): "
|
||||||
|
+ "INVALID_NAME_FOR_route_config");
|
||||||
|
+
|
||||||
|
+ // Verify that the config is still the old value.
|
||||||
|
+ ASSERT_EQ(config_impl_pointer, rds_subscription->routeConfigProvider().value()->config());
|
||||||
|
}
|
||||||
|
|
||||||
|
// rds and vhds configurations change together
|
||||||
|
diff -Naur envoy/test/mocks/router/mocks.h envoy-new/test/mocks/router/mocks.h
|
||||||
|
--- envoy/test/mocks/router/mocks.h 2023-11-24 10:52:41.370294773 +0800
|
||||||
|
+++ envoy-new/test/mocks/router/mocks.h 2023-11-24 10:47:36.301873453 +0800
|
||||||
|
@@ -538,7 +538,6 @@
|
||||||
|
MOCK_METHOD(absl::optional<ConfigInfo>, configInfo, (), (const));
|
||||||
|
MOCK_METHOD(SystemTime, lastUpdated, (), (const));
|
||||||
|
MOCK_METHOD(void, onConfigUpdate, ());
|
||||||
|
- MOCK_METHOD(void, validateConfig, (const envoy::config::route::v3::RouteConfiguration&), (const));
|
||||||
|
MOCK_METHOD(void, requestVirtualHostsUpdate,
|
||||||
|
(const std::string&, Event::Dispatcher&,
|
||||||
|
std::weak_ptr<Http::RouteConfigUpdatedCallback> route_config_updated_cb));
|
||||||
|
diff -Naur envoy/tools/spelling/spelling_dictionary.txt envoy-new/tools/spelling/spelling_dictionary.txt
|
||||||
|
--- envoy/tools/spelling/spelling_dictionary.txt 2023-11-24 10:52:41.370294773 +0800
|
||||||
|
+++ envoy-new/tools/spelling/spelling_dictionary.txt 2023-11-24 10:48:54.969076506 +0800
|
||||||
|
@@ -1303,6 +1303,7 @@
|
||||||
|
ep
|
||||||
|
suri
|
||||||
|
transid
|
||||||
|
+vhosts
|
||||||
|
WAF
|
||||||
|
TRI
|
||||||
|
tmd
|
||||||
1502
envoy/1.20/patches/envoy/20231218-dubbo-optimize.patch
Normal file
1502
envoy/1.20/patches/envoy/20231218-dubbo-optimize.patch
Normal file
File diff suppressed because one or more lines are too long
483
envoy/1.20/patches/envoy/20240104-enhance-srds.patch
Normal file
483
envoy/1.20/patches/envoy/20240104-enhance-srds.patch
Normal file
@@ -0,0 +1,483 @@
|
|||||||
|
diff -Naur envoy/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto envoy-new/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
|
||||||
|
--- envoy/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto 2024-01-04 21:07:40.000000000 +0800
|
||||||
|
+++ envoy-new/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto 2024-01-04 21:09:13.000000000 +0800
|
||||||
|
@@ -888,11 +888,31 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ message HostValueExtractor {
|
||||||
|
+ option (udpa.annotations.versioning).previous_message_type =
|
||||||
|
+ "envoy.config.filter.network.http_connection_manager.v2.ScopedRoutes.ScopeKeyBuilder."
|
||||||
|
+ "FragmentBuilder.HostValueExtractor";
|
||||||
|
+
|
||||||
|
+ // The maximum number of host superset recomputes. If not specified, defaults to 100.
|
||||||
|
+ google.protobuf.UInt32Value max_recompute_num = 1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ message LocalPortValueExtractor {
|
||||||
|
+ option (udpa.annotations.versioning).previous_message_type =
|
||||||
|
+ "envoy.config.filter.network.http_connection_manager.v2.ScopedRoutes.ScopeKeyBuilder."
|
||||||
|
+ "FragmentBuilder.LocalPortValueExtractor";
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+
|
||||||
|
oneof type {
|
||||||
|
option (validate.required) = true;
|
||||||
|
|
||||||
|
// Specifies how a header field's value should be extracted.
|
||||||
|
HeaderValueExtractor header_value_extractor = 1;
|
||||||
|
+
|
||||||
|
+ HostValueExtractor host_value_extractor = 101;
|
||||||
|
+
|
||||||
|
+ LocalPortValueExtractor local_port_value_extractor = 102;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
diff -Naur envoy/envoy/router/scopes.h envoy-new/envoy/router/scopes.h
|
||||||
|
--- envoy/envoy/router/scopes.h 2024-01-04 21:07:38.000000000 +0800
|
||||||
|
+++ envoy-new/envoy/router/scopes.h 2024-01-04 21:09:13.000000000 +0800
|
||||||
|
@@ -92,7 +92,12 @@
|
||||||
|
* @param headers the request headers to match the scoped routing configuration against.
|
||||||
|
* @return ConfigConstSharedPtr the router's Config matching the request headers.
|
||||||
|
*/
|
||||||
|
+#if defined ALIMESH
|
||||||
|
+ virtual ConfigConstSharedPtr getRouteConfig(const Http::HeaderMap& headers,
|
||||||
|
+ const StreamInfo::StreamInfo& info) const PURE;
|
||||||
|
+#else
|
||||||
|
virtual ConfigConstSharedPtr getRouteConfig(const Http::HeaderMap& headers) const PURE;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Based on the incoming HTTP request headers, returns the hash value of its scope key.
|
||||||
|
@@ -100,6 +105,12 @@
|
||||||
|
* @return unique_ptr of the scope key computed from header.
|
||||||
|
*/
|
||||||
|
virtual ScopeKeyPtr computeScopeKey(const Http::HeaderMap&) const { return {}; }
|
||||||
|
+
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+ virtual ScopeKeyPtr computeScopeKey(const Http::HeaderMap&, const StreamInfo::StreamInfo&) const {
|
||||||
|
+ return {};
|
||||||
|
+ };
|
||||||
|
+#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
using ScopedConfigConstSharedPtr = std::shared_ptr<const ScopedConfig>;
|
||||||
|
diff -Naur envoy/source/common/http/conn_manager_impl.cc envoy-new/source/common/http/conn_manager_impl.cc
|
||||||
|
--- envoy/source/common/http/conn_manager_impl.cc 2024-01-04 21:07:41.000000000 +0800
|
||||||
|
+++ envoy-new/source/common/http/conn_manager_impl.cc 2024-01-04 21:09:13.000000000 +0800
|
||||||
|
@@ -577,8 +577,13 @@
|
||||||
|
requestVhdsUpdate(host_header, thread_local_dispatcher, std::move(route_config_updated_cb));
|
||||||
|
return;
|
||||||
|
} else if (parent_.snapped_scoped_routes_config_ != nullptr) {
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+ Router::ScopeKeyPtr scope_key = parent_.snapped_scoped_routes_config_->computeScopeKey(
|
||||||
|
+ *parent_.request_headers_, parent_.connection()->streamInfo());
|
||||||
|
+#else
|
||||||
|
Router::ScopeKeyPtr scope_key =
|
||||||
|
parent_.snapped_scoped_routes_config_->computeScopeKey(*parent_.request_headers_);
|
||||||
|
+#endif
|
||||||
|
// If scope_key is not null, the scope exists but RouteConfiguration is not initialized.
|
||||||
|
if (scope_key != nullptr) {
|
||||||
|
requestSrdsUpdate(std::move(scope_key), thread_local_dispatcher,
|
||||||
|
@@ -1197,7 +1202,13 @@
|
||||||
|
void ConnectionManagerImpl::ActiveStream::snapScopedRouteConfig() {
|
||||||
|
// NOTE: if a RDS subscription hasn't got a RouteConfiguration back, a Router::NullConfigImpl is
|
||||||
|
// returned, in that case we let it pass.
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+ snapped_route_config_ =
|
||||||
|
+ snapped_scoped_routes_config_->getRouteConfig(*request_headers_, connection()->streamInfo());
|
||||||
|
+#else
|
||||||
|
snapped_route_config_ = snapped_scoped_routes_config_->getRouteConfig(*request_headers_);
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
if (snapped_route_config_ == nullptr) {
|
||||||
|
ENVOY_STREAM_LOG(trace, "can't find SRDS scope.", *this);
|
||||||
|
// TODO(stevenzzzz): Consider to pass an error message to router filter, so that it can
|
||||||
|
diff -Naur envoy/source/common/router/scoped_config_impl.cc envoy-new/source/common/router/scoped_config_impl.cc
|
||||||
|
--- envoy/source/common/router/scoped_config_impl.cc 2024-01-04 21:07:36.000000000 +0800
|
||||||
|
+++ envoy-new/source/common/router/scoped_config_impl.cc 2024-01-04 21:09:13.000000000 +0800
|
||||||
|
@@ -6,6 +6,160 @@
|
||||||
|
namespace Envoy {
|
||||||
|
namespace Router {
|
||||||
|
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+namespace {
|
||||||
|
+
|
||||||
|
+std::string maskFirstDNSLabel(absl::string_view host) {
|
||||||
|
+ if (host == "*") {
|
||||||
|
+ return std::string(host);
|
||||||
|
+ }
|
||||||
|
+ if (host.size() < 2) {
|
||||||
|
+ return "*";
|
||||||
|
+ }
|
||||||
|
+ size_t start_pos = (host[0] == '*' && host[1] == '.') ? 2 : 0;
|
||||||
|
+ size_t dot_pos = host.find('.', start_pos);
|
||||||
|
+ if (dot_pos != absl::string_view::npos) {
|
||||||
|
+ return absl::StrCat("*", absl::string_view(host.data() + dot_pos, host.size() - dot_pos));
|
||||||
|
+ }
|
||||||
|
+ return "*";
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+} // namespace
|
||||||
|
+
|
||||||
|
+LocalPortValueExtractorImpl::LocalPortValueExtractorImpl(
|
||||||
|
+ ScopedRoutes::ScopeKeyBuilder::FragmentBuilder&& config)
|
||||||
|
+ : FragmentBuilderBase(std::move(config)) {
|
||||||
|
+ ASSERT(config_.type_case() ==
|
||||||
|
+ ScopedRoutes::ScopeKeyBuilder::FragmentBuilder::kLocalPortValueExtractor,
|
||||||
|
+ "local_port_value_extractor is not set.");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+std::unique_ptr<ScopeKeyFragmentBase> LocalPortValueExtractorImpl::computeFragment(
|
||||||
|
+ const Http::HeaderMap&, const StreamInfo::StreamInfo& info, ReComputeCbPtr&) const {
|
||||||
|
+ auto port = info.downstreamAddressProvider().localAddress()->ip()->port();
|
||||||
|
+ return std::make_unique<StringKeyFragment>(std::to_string(long(port)));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+HostValueExtractorImpl::HostValueExtractorImpl(
|
||||||
|
+ ScopedRoutes::ScopeKeyBuilder::FragmentBuilder&& config)
|
||||||
|
+ : FragmentBuilderBase(std::move(config)),
|
||||||
|
+ host_value_extractor_config_(config_.host_value_extractor()),
|
||||||
|
+ max_recompute_num_(PROTOBUF_GET_WRAPPED_OR_DEFAULT(
|
||||||
|
+ host_value_extractor_config_, max_recompute_num, DefaultMaxRecomputeNum)) {
|
||||||
|
+ ASSERT(config_.type_case() == ScopedRoutes::ScopeKeyBuilder::FragmentBuilder::kHostValueExtractor,
|
||||||
|
+ "host_value_extractor is not set.");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+std::unique_ptr<ScopeKeyFragmentBase>
|
||||||
|
+HostValueExtractorImpl::reComputeHelper(const std::string& host, ReComputeCbPtr& next_recompute,
|
||||||
|
+ uint32_t recompute_seq) const {
|
||||||
|
+ if (recompute_seq == max_recompute_num_) {
|
||||||
|
+ ENVOY_LOG_MISC(warn,
|
||||||
|
+ "recompute host fragment failed, maximum number of recalculations exceeded");
|
||||||
|
+ return nullptr;
|
||||||
|
+ }
|
||||||
|
+ if (host == "*") {
|
||||||
|
+ *next_recompute = nullptr;
|
||||||
|
+ return nullptr;
|
||||||
|
+ }
|
||||||
|
+ auto masked_host = maskFirstDNSLabel(host);
|
||||||
|
+ *next_recompute = [this, masked_host, recompute_seq,
|
||||||
|
+ next_recompute]() mutable -> std::unique_ptr<ScopeKeyFragmentBase> {
|
||||||
|
+ return reComputeHelper(masked_host, next_recompute, recompute_seq + 1);
|
||||||
|
+ };
|
||||||
|
+ return std::make_unique<StringKeyFragment>(masked_host);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+std::unique_ptr<ScopeKeyFragmentBase>
|
||||||
|
+HostValueExtractorImpl::computeFragment(const Http::HeaderMap& headers,
|
||||||
|
+ const StreamInfo::StreamInfo&,
|
||||||
|
+ ReComputeCbPtr& recompute) const {
|
||||||
|
+ auto fragment = computeFragment(headers);
|
||||||
|
+ auto host = static_cast<const Http::RequestHeaderMap&>(headers).getHostValue();
|
||||||
|
+ *recompute = [this, host, recompute]() mutable -> std::unique_ptr<ScopeKeyFragmentBase> {
|
||||||
|
+ return reComputeHelper(std::string(host), recompute, 0);
|
||||||
|
+ };
|
||||||
|
+ return fragment;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+std::unique_ptr<ScopeKeyFragmentBase>
|
||||||
|
+HostValueExtractorImpl::computeFragment(const Http::HeaderMap& headers) const {
|
||||||
|
+ return std::make_unique<StringKeyFragment>(
|
||||||
|
+ static_cast<const Http::RequestHeaderMap&>(headers).getHostValue());
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+std::unique_ptr<ScopeKeyFragmentBase>
|
||||||
|
+HeaderValueExtractorImpl::computeFragment(const Http::HeaderMap& headers,
|
||||||
|
+ const StreamInfo::StreamInfo&, ReComputeCbPtr&) const {
|
||||||
|
+ return computeFragment(headers);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+ScopeKeyPtr ScopeKeyBuilderImpl::computeScopeKey(const Http::HeaderMap& headers,
|
||||||
|
+ const StreamInfo::StreamInfo& info,
|
||||||
|
+ std::function<ScopeKeyPtr()>& recompute) const {
|
||||||
|
+ ScopeKey key;
|
||||||
|
+ bool recomputeable = false;
|
||||||
|
+ auto recompute_cbs = std::make_shared<std::vector<ReComputeCbPtr>>();
|
||||||
|
+ for (const auto& builder : fragment_builders_) {
|
||||||
|
+ // returns nullopt if a null fragment is found.
|
||||||
|
+ ReComputeCbPtr recompute_fragment_cb = std::make_shared<ReComputeCb>();
|
||||||
|
+ std::unique_ptr<ScopeKeyFragmentBase> fragment =
|
||||||
|
+ builder->computeFragment(headers, info, recompute_fragment_cb);
|
||||||
|
+ if (fragment == nullptr) {
|
||||||
|
+ return nullptr;
|
||||||
|
+ }
|
||||||
|
+ if (*recompute_fragment_cb == nullptr) {
|
||||||
|
+ auto key_fragment = static_cast<StringKeyFragment*>(fragment.get());
|
||||||
|
+ auto copied_fragment = std::make_shared<StringKeyFragment>(*key_fragment);
|
||||||
|
+ auto recompute_cb =
|
||||||
|
+ std::make_shared<ReComputeCb>([copied_fragment]() -> std::unique_ptr<StringKeyFragment> {
|
||||||
|
+ return std::make_unique<StringKeyFragment>(*copied_fragment);
|
||||||
|
+ });
|
||||||
|
+ recompute_cbs->push_back(recompute_cb);
|
||||||
|
+ } else {
|
||||||
|
+ recomputeable = true;
|
||||||
|
+ recompute_cbs->push_back(recompute_fragment_cb);
|
||||||
|
+ }
|
||||||
|
+ key.addFragment(std::move(fragment));
|
||||||
|
+ }
|
||||||
|
+ if (recomputeable) {
|
||||||
|
+ recompute = [&recompute, recompute_cbs]() mutable -> ScopeKeyPtr {
|
||||||
|
+ ScopeKey new_key;
|
||||||
|
+ for (auto& cb : *recompute_cbs) {
|
||||||
|
+ auto new_fragment = (*cb)();
|
||||||
|
+ if (new_fragment == nullptr) {
|
||||||
|
+ return nullptr;
|
||||||
|
+ }
|
||||||
|
+ if (*cb == nullptr) {
|
||||||
|
+ recompute = nullptr;
|
||||||
|
+ }
|
||||||
|
+ new_key.addFragment(std::move(new_fragment));
|
||||||
|
+ }
|
||||||
|
+ return std::make_unique<ScopeKey>(std::move(new_key));
|
||||||
|
+ };
|
||||||
|
+ }
|
||||||
|
+ return std::make_unique<ScopeKey>(std::move(key));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+ScopeKeyPtr ScopedConfigImpl::computeScopeKey(const Http::HeaderMap& headers,
|
||||||
|
+ const StreamInfo::StreamInfo& info) const {
|
||||||
|
+ std::function<Router::ScopeKeyPtr()> recompute;
|
||||||
|
+ ScopeKeyPtr scope_key = scope_key_builder_.computeScopeKey(headers, info, recompute);
|
||||||
|
+ if (scope_key == nullptr) {
|
||||||
|
+ return nullptr;
|
||||||
|
+ }
|
||||||
|
+ decltype(scoped_route_info_by_key_.begin()) iter;
|
||||||
|
+ do {
|
||||||
|
+ iter = scoped_route_info_by_key_.find(scope_key->hash());
|
||||||
|
+ if (iter != scoped_route_info_by_key_.end()) {
|
||||||
|
+ return scope_key;
|
||||||
|
+ }
|
||||||
|
+ } while (recompute != nullptr && (scope_key = recompute()));
|
||||||
|
+ return nullptr;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
bool ScopeKey::operator!=(const ScopeKey& other) const { return !(*this == other); }
|
||||||
|
|
||||||
|
bool ScopeKey::operator==(const ScopeKey& other) const {
|
||||||
|
@@ -95,6 +249,16 @@
|
||||||
|
: ScopeKeyBuilderBase(std::move(config)) {
|
||||||
|
for (const auto& fragment_builder : config_.fragments()) {
|
||||||
|
switch (fragment_builder.type_case()) {
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+ case ScopedRoutes::ScopeKeyBuilder::FragmentBuilder::kHostValueExtractor:
|
||||||
|
+ fragment_builders_.emplace_back(std::make_unique<HostValueExtractorImpl>(
|
||||||
|
+ ScopedRoutes::ScopeKeyBuilder::FragmentBuilder(fragment_builder)));
|
||||||
|
+ break;
|
||||||
|
+ case ScopedRoutes::ScopeKeyBuilder::FragmentBuilder::kLocalPortValueExtractor:
|
||||||
|
+ fragment_builders_.emplace_back(std::make_unique<LocalPortValueExtractorImpl>(
|
||||||
|
+ ScopedRoutes::ScopeKeyBuilder::FragmentBuilder(fragment_builder)));
|
||||||
|
+ break;
|
||||||
|
+#endif
|
||||||
|
case ScopedRoutes::ScopeKeyBuilder::FragmentBuilder::kHeaderValueExtractor:
|
||||||
|
fragment_builders_.emplace_back(std::make_unique<HeaderValueExtractorImpl>(
|
||||||
|
ScopedRoutes::ScopeKeyBuilder::FragmentBuilder(fragment_builder)));
|
||||||
|
@@ -143,6 +307,22 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
Router::ConfigConstSharedPtr
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+ScopedConfigImpl::getRouteConfig(const Http::HeaderMap& headers,
|
||||||
|
+ const StreamInfo::StreamInfo& info) const {
|
||||||
|
+ std::function<ScopeKeyPtr()> recompute;
|
||||||
|
+ ScopeKeyPtr scope_key = scope_key_builder_.computeScopeKey(headers, info, recompute);
|
||||||
|
+ if (scope_key == nullptr) {
|
||||||
|
+ return nullptr;
|
||||||
|
+ }
|
||||||
|
+ decltype(scoped_route_info_by_key_.begin()) iter;
|
||||||
|
+ do {
|
||||||
|
+ iter = scoped_route_info_by_key_.find(scope_key->hash());
|
||||||
|
+ if (iter != scoped_route_info_by_key_.end()) {
|
||||||
|
+ return iter->second->routeConfig();
|
||||||
|
+ }
|
||||||
|
+ } while (recompute != nullptr && (scope_key = recompute()));
|
||||||
|
+#else
|
||||||
|
ScopedConfigImpl::getRouteConfig(const Http::HeaderMap& headers) const {
|
||||||
|
ScopeKeyPtr scope_key = scope_key_builder_.computeScopeKey(headers);
|
||||||
|
if (scope_key == nullptr) {
|
||||||
|
@@ -152,6 +332,7 @@
|
||||||
|
if (iter != scoped_route_info_by_key_.end()) {
|
||||||
|
return iter->second->routeConfig();
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff -Naur envoy/source/common/router/scoped_config_impl.h envoy-new/source/common/router/scoped_config_impl.h
|
||||||
|
--- envoy/source/common/router/scoped_config_impl.h 2024-01-04 21:07:36.000000000 +0800
|
||||||
|
+++ envoy-new/source/common/router/scoped_config_impl.h 2024-01-04 21:09:13.000000000 +0800
|
||||||
|
@@ -22,6 +22,11 @@
|
||||||
|
|
||||||
|
using envoy::extensions::filters::network::http_connection_manager::v3::ScopedRoutes;
|
||||||
|
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+using ReComputeCb = std::function<std::unique_ptr<ScopeKeyFragmentBase>()>;
|
||||||
|
+using ReComputeCbPtr = std::shared_ptr<ReComputeCb>;
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* Base class for fragment builders.
|
||||||
|
*/
|
||||||
|
@@ -36,6 +41,12 @@
|
||||||
|
virtual std::unique_ptr<ScopeKeyFragmentBase>
|
||||||
|
computeFragment(const Http::HeaderMap& headers) const PURE;
|
||||||
|
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+ virtual std::unique_ptr<ScopeKeyFragmentBase>
|
||||||
|
+ computeFragment(const Http::HeaderMap& headers, const StreamInfo::StreamInfo& info,
|
||||||
|
+ ReComputeCbPtr& recompute) const PURE;
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
protected:
|
||||||
|
const ScopedRoutes::ScopeKeyBuilder::FragmentBuilder config_;
|
||||||
|
};
|
||||||
|
@@ -47,11 +58,54 @@
|
||||||
|
std::unique_ptr<ScopeKeyFragmentBase>
|
||||||
|
computeFragment(const Http::HeaderMap& headers) const override;
|
||||||
|
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+ std::unique_ptr<ScopeKeyFragmentBase> computeFragment(const Http::HeaderMap& headers,
|
||||||
|
+ const StreamInfo::StreamInfo& info,
|
||||||
|
+ ReComputeCbPtr& recompute) const override;
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
private:
|
||||||
|
const ScopedRoutes::ScopeKeyBuilder::FragmentBuilder::HeaderValueExtractor&
|
||||||
|
header_value_extractor_config_;
|
||||||
|
};
|
||||||
|
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+class HostValueExtractorImpl : public FragmentBuilderBase {
|
||||||
|
+public:
|
||||||
|
+ explicit HostValueExtractorImpl(ScopedRoutes::ScopeKeyBuilder::FragmentBuilder&& config);
|
||||||
|
+
|
||||||
|
+ std::unique_ptr<ScopeKeyFragmentBase>
|
||||||
|
+ computeFragment(const Http::HeaderMap& headers) const override;
|
||||||
|
+
|
||||||
|
+ std::unique_ptr<ScopeKeyFragmentBase> computeFragment(const Http::HeaderMap& headers,
|
||||||
|
+ const StreamInfo::StreamInfo& info,
|
||||||
|
+ ReComputeCbPtr& recompute) const override;
|
||||||
|
+
|
||||||
|
+private:
|
||||||
|
+ std::unique_ptr<ScopeKeyFragmentBase> reComputeHelper(const std::string& host,
|
||||||
|
+ ReComputeCbPtr& next_recompute,
|
||||||
|
+ uint32_t recompute_seq) const;
|
||||||
|
+
|
||||||
|
+ static constexpr uint32_t DefaultMaxRecomputeNum = 100;
|
||||||
|
+
|
||||||
|
+ const ScopedRoutes::ScopeKeyBuilder::FragmentBuilder::HostValueExtractor&
|
||||||
|
+ host_value_extractor_config_;
|
||||||
|
+ const uint32_t max_recompute_num_;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+class LocalPortValueExtractorImpl : public FragmentBuilderBase {
|
||||||
|
+public:
|
||||||
|
+ explicit LocalPortValueExtractorImpl(ScopedRoutes::ScopeKeyBuilder::FragmentBuilder&& config);
|
||||||
|
+
|
||||||
|
+ std::unique_ptr<ScopeKeyFragmentBase> computeFragment(const Http::HeaderMap&) const override {
|
||||||
|
+ return nullptr;
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ std::unique_ptr<ScopeKeyFragmentBase> computeFragment(const Http::HeaderMap& headers,
|
||||||
|
+ const StreamInfo::StreamInfo& info,
|
||||||
|
+ ReComputeCbPtr& recompute) const override;
|
||||||
|
+};
|
||||||
|
+#endif
|
||||||
|
/**
|
||||||
|
* Base class for ScopeKeyBuilder implementations.
|
||||||
|
*/
|
||||||
|
@@ -64,6 +118,12 @@
|
||||||
|
// Computes scope key for given headers, returns nullptr if a key can't be computed.
|
||||||
|
virtual ScopeKeyPtr computeScopeKey(const Http::HeaderMap& headers) const PURE;
|
||||||
|
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+ virtual ScopeKeyPtr computeScopeKey(const Http::HeaderMap& headers,
|
||||||
|
+ const StreamInfo::StreamInfo& info,
|
||||||
|
+ std::function<ScopeKeyPtr()>& recompute) const PURE;
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
protected:
|
||||||
|
const ScopedRoutes::ScopeKeyBuilder config_;
|
||||||
|
};
|
||||||
|
@@ -74,6 +134,11 @@
|
||||||
|
|
||||||
|
ScopeKeyPtr computeScopeKey(const Http::HeaderMap& headers) const override;
|
||||||
|
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+ ScopeKeyPtr computeScopeKey(const Http::HeaderMap& headers, const StreamInfo::StreamInfo& info,
|
||||||
|
+ std::function<ScopeKeyPtr()>& recompute) const override;
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
private:
|
||||||
|
std::vector<std::unique_ptr<FragmentBuilderBase>> fragment_builders_;
|
||||||
|
};
|
||||||
|
@@ -118,10 +183,20 @@
|
||||||
|
void removeRoutingScopes(const std::vector<std::string>& scope_names);
|
||||||
|
|
||||||
|
// Envoy::Router::ScopedConfig
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+ Router::ConfigConstSharedPtr getRouteConfig(const Http::HeaderMap& headers,
|
||||||
|
+ const StreamInfo::StreamInfo& info) const override;
|
||||||
|
+#else
|
||||||
|
Router::ConfigConstSharedPtr getRouteConfig(const Http::HeaderMap& headers) const override;
|
||||||
|
+#endif
|
||||||
|
// The return value is not null only if the scope corresponding to the header exists.
|
||||||
|
ScopeKeyPtr computeScopeKey(const Http::HeaderMap& headers) const override;
|
||||||
|
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+ ScopeKeyPtr computeScopeKey(const Http::HeaderMap& headers,
|
||||||
|
+ const StreamInfo::StreamInfo& info) const override;
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
private:
|
||||||
|
ScopeKeyBuilderImpl scope_key_builder_;
|
||||||
|
// From scope name to cached ScopedRouteInfo.
|
||||||
|
@@ -135,9 +210,16 @@
|
||||||
|
*/
|
||||||
|
class NullScopedConfigImpl : public ScopedConfig {
|
||||||
|
public:
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+ Router::ConfigConstSharedPtr getRouteConfig(const Http::HeaderMap&,
|
||||||
|
+ const StreamInfo::StreamInfo&) const override {
|
||||||
|
+ return std::make_shared<const NullConfigImpl>();
|
||||||
|
+ }
|
||||||
|
+#else
|
||||||
|
Router::ConfigConstSharedPtr getRouteConfig(const Http::HeaderMap&) const override {
|
||||||
|
return std::make_shared<const NullConfigImpl>();
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Router
|
||||||
|
diff -Naur envoy/source/extensions/filters/http/on_demand/on_demand_update.cc envoy-new/source/extensions/filters/http/on_demand/on_demand_update.cc
|
||||||
|
--- envoy/source/extensions/filters/http/on_demand/on_demand_update.cc 2024-01-04 21:07:33.000000000 +0800
|
||||||
|
+++ envoy-new/source/extensions/filters/http/on_demand/on_demand_update.cc 2024-01-04 21:09:13.000000000 +0800
|
||||||
|
@@ -50,7 +50,11 @@
|
||||||
|
// This is the callback which is called when an update requested in requestRouteConfigUpdate()
|
||||||
|
// has been propagated to workers, at which point the request processing is restarted from the
|
||||||
|
// beginning.
|
||||||
|
+#if defined(ALIMESH)
|
||||||
|
+void OnDemandRouteUpdate::onRouteConfigUpdateCompletion(bool) {
|
||||||
|
+#else
|
||||||
|
void OnDemandRouteUpdate::onRouteConfigUpdateCompletion(bool route_exists) {
|
||||||
|
+#endif
|
||||||
|
filter_iteration_state_ = Http::FilterHeadersStatus::Continue;
|
||||||
|
|
||||||
|
// Don't call continueDecoding in the middle of decodeHeaders()
|
||||||
|
@@ -58,12 +62,14 @@
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
+#if !defined(ALIMESH)
|
||||||
|
if (route_exists && // route can be resolved after an on-demand
|
||||||
|
// VHDS update
|
||||||
|
!callbacks_->decodingBuffer() && // Redirects with body not yet supported.
|
||||||
|
callbacks_->recreateStream(/*headers=*/nullptr)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
// route cannot be resolved after an on-demand VHDS update or
|
||||||
|
// recreating stream failed, continue the filter-chain
|
||||||
49
envoy/1.20/patches/envoy/20240110-fix-srds.patch
Normal file
49
envoy/1.20/patches/envoy/20240110-fix-srds.patch
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
diff -Naur envoy/source/common/router/BUILD envoy-new/source/common/router/BUILD
|
||||||
|
--- envoy/source/common/router/BUILD 2024-01-10 20:10:14.505600746 +0800
|
||||||
|
+++ envoy-new/source/common/router/BUILD 2024-01-10 20:07:25.960379955 +0800
|
||||||
|
@@ -212,6 +212,7 @@
|
||||||
|
"//envoy/router:rds_interface",
|
||||||
|
"//envoy/router:scopes_interface",
|
||||||
|
"//envoy/thread_local:thread_local_interface",
|
||||||
|
+ "//source/common/http:header_utility_lib",
|
||||||
|
"@envoy_api//envoy/config/route/v3:pkg_cc_proto",
|
||||||
|
"@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg_cc_proto",
|
||||||
|
],
|
||||||
|
diff -Naur envoy/source/common/router/scoped_config_impl.cc envoy-new/source/common/router/scoped_config_impl.cc
|
||||||
|
--- envoy/source/common/router/scoped_config_impl.cc 2024-01-10 20:10:14.529600924 +0800
|
||||||
|
+++ envoy-new/source/common/router/scoped_config_impl.cc 2024-01-10 20:09:50.161422411 +0800
|
||||||
|
@@ -3,6 +3,8 @@
|
||||||
|
#include "envoy/config/route/v3/scoped_route.pb.h"
|
||||||
|
#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.h"
|
||||||
|
|
||||||
|
+#include "source/common/http/header_utility.h"
|
||||||
|
+
|
||||||
|
namespace Envoy {
|
||||||
|
namespace Router {
|
||||||
|
|
||||||
|
@@ -74,18 +76,20 @@
|
||||||
|
HostValueExtractorImpl::computeFragment(const Http::HeaderMap& headers,
|
||||||
|
const StreamInfo::StreamInfo&,
|
||||||
|
ReComputeCbPtr& recompute) const {
|
||||||
|
- auto fragment = computeFragment(headers);
|
||||||
|
auto host = static_cast<const Http::RequestHeaderMap&>(headers).getHostValue();
|
||||||
|
+ auto port_start = Http::HeaderUtility::getPortStart(host);
|
||||||
|
+ if (port_start != absl::string_view::npos) {
|
||||||
|
+ host = host.substr(0, port_start);
|
||||||
|
+ }
|
||||||
|
*recompute = [this, host, recompute]() mutable -> std::unique_ptr<ScopeKeyFragmentBase> {
|
||||||
|
return reComputeHelper(std::string(host), recompute, 0);
|
||||||
|
};
|
||||||
|
- return fragment;
|
||||||
|
+ return std::make_unique<StringKeyFragment>(host);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<ScopeKeyFragmentBase>
|
||||||
|
-HostValueExtractorImpl::computeFragment(const Http::HeaderMap& headers) const {
|
||||||
|
- return std::make_unique<StringKeyFragment>(
|
||||||
|
- static_cast<const Http::RequestHeaderMap&>(headers).getHostValue());
|
||||||
|
+HostValueExtractorImpl::computeFragment(const Http::HeaderMap&) const {
|
||||||
|
+ return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<ScopeKeyFragmentBase>
|
||||||
65
envoy/1.20/patches/envoy/20240111-fix-srds-compute.patch
Normal file
65
envoy/1.20/patches/envoy/20240111-fix-srds-compute.patch
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
diff -Naur envoy/source/common/router/scoped_config_impl.cc envoy-new/source/common/router/scoped_config_impl.cc
|
||||||
|
--- envoy/source/common/router/scoped_config_impl.cc 2024-01-11 16:23:55.407881263 +0800
|
||||||
|
+++ envoy-new/source/common/router/scoped_config_impl.cc 2024-01-11 16:23:42.311786814 +0800
|
||||||
|
@@ -53,21 +53,26 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<ScopeKeyFragmentBase>
|
||||||
|
-HostValueExtractorImpl::reComputeHelper(const std::string& host, ReComputeCbPtr& next_recompute,
|
||||||
|
+HostValueExtractorImpl::reComputeHelper(const std::string& host,
|
||||||
|
+ ReComputeCbWeakPtr& weak_next_recompute,
|
||||||
|
uint32_t recompute_seq) const {
|
||||||
|
if (recompute_seq == max_recompute_num_) {
|
||||||
|
ENVOY_LOG_MISC(warn,
|
||||||
|
"recompute host fragment failed, maximum number of recalculations exceeded");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
+ auto next_recompute = weak_next_recompute.lock();
|
||||||
|
+ if (!next_recompute) {
|
||||||
|
+ return nullptr;
|
||||||
|
+ }
|
||||||
|
if (host == "*") {
|
||||||
|
*next_recompute = nullptr;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
auto masked_host = maskFirstDNSLabel(host);
|
||||||
|
*next_recompute = [this, masked_host, recompute_seq,
|
||||||
|
- next_recompute]() mutable -> std::unique_ptr<ScopeKeyFragmentBase> {
|
||||||
|
- return reComputeHelper(masked_host, next_recompute, recompute_seq + 1);
|
||||||
|
+ weak_next_recompute]() mutable -> std::unique_ptr<ScopeKeyFragmentBase> {
|
||||||
|
+ return reComputeHelper(masked_host, weak_next_recompute, recompute_seq + 1);
|
||||||
|
};
|
||||||
|
return std::make_unique<StringKeyFragment>(masked_host);
|
||||||
|
}
|
||||||
|
@@ -81,8 +86,9 @@
|
||||||
|
if (port_start != absl::string_view::npos) {
|
||||||
|
host = host.substr(0, port_start);
|
||||||
|
}
|
||||||
|
- *recompute = [this, host, recompute]() mutable -> std::unique_ptr<ScopeKeyFragmentBase> {
|
||||||
|
- return reComputeHelper(std::string(host), recompute, 0);
|
||||||
|
+ *recompute = [this, host, weak_recompute = ReComputeCbWeakPtr(recompute)]() mutable
|
||||||
|
+ -> std::unique_ptr<ScopeKeyFragmentBase> {
|
||||||
|
+ return reComputeHelper(std::string(host), weak_recompute, 0);
|
||||||
|
};
|
||||||
|
return std::make_unique<StringKeyFragment>(host);
|
||||||
|
}
|
||||||
|
diff -Naur envoy/source/common/router/scoped_config_impl.h envoy-new/source/common/router/scoped_config_impl.h
|
||||||
|
--- envoy/source/common/router/scoped_config_impl.h 2024-01-11 16:23:55.407881263 +0800
|
||||||
|
+++ envoy-new/source/common/router/scoped_config_impl.h 2024-01-11 16:23:42.311786814 +0800
|
||||||
|
@@ -25,6 +25,7 @@
|
||||||
|
#if defined(ALIMESH)
|
||||||
|
using ReComputeCb = std::function<std::unique_ptr<ScopeKeyFragmentBase>()>;
|
||||||
|
using ReComputeCbPtr = std::shared_ptr<ReComputeCb>;
|
||||||
|
+using ReComputeCbWeakPtr = std::weak_ptr<ReComputeCb>;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -83,7 +84,7 @@
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<ScopeKeyFragmentBase> reComputeHelper(const std::string& host,
|
||||||
|
- ReComputeCbPtr& next_recompute,
|
||||||
|
+ ReComputeCbWeakPtr& weak_next_recompute,
|
||||||
|
uint32_t recompute_seq) const;
|
||||||
|
|
||||||
|
static constexpr uint32_t DefaultMaxRecomputeNum = 100;
|
||||||
1445
envoy/1.20/patches/envoy/20240116-fix-cve.patch
Normal file
1445
envoy/1.20/patches/envoy/20240116-fix-cve.patch
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
931
envoy/1.20/patches/go-control-plane/20240104-enhance-srds.patch
Normal file
931
envoy/1.20/patches/go-control-plane/20240104-enhance-srds.patch
Normal file
@@ -0,0 +1,931 @@
|
|||||||
|
diff -Naur go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.go go-control-plane-new/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.go
|
||||||
|
--- go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.go 2024-01-04 21:07:22.000000000 +0800
|
||||||
|
+++ go-control-plane-new/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.go 2024-01-04 21:02:10.000000000 +0800
|
||||||
|
@@ -2286,6 +2286,8 @@
|
||||||
|
|
||||||
|
// Types that are assignable to Type:
|
||||||
|
// *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_
|
||||||
|
+ // *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor_
|
||||||
|
+ // *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor_
|
||||||
|
Type isScopedRoutes_ScopeKeyBuilder_FragmentBuilder_Type `protobuf_oneof:"type"`
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2335,6 +2337,20 @@
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
+func (x *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder) GetHostValueExtractor() *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor {
|
||||||
|
+ if x, ok := x.GetType().(*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor_); ok {
|
||||||
|
+ return x.HostValueExtractor
|
||||||
|
+ }
|
||||||
|
+ return nil
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+func (x *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder) GetLocalPortValueExtractor() *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor {
|
||||||
|
+ if x, ok := x.GetType().(*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor_); ok {
|
||||||
|
+ return x.LocalPortValueExtractor
|
||||||
|
+ }
|
||||||
|
+ return nil
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
type isScopedRoutes_ScopeKeyBuilder_FragmentBuilder_Type interface {
|
||||||
|
isScopedRoutes_ScopeKeyBuilder_FragmentBuilder_Type()
|
||||||
|
}
|
||||||
|
@@ -2344,9 +2360,23 @@
|
||||||
|
HeaderValueExtractor *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor `protobuf:"bytes,1,opt,name=header_value_extractor,json=headerValueExtractor,proto3,oneof"`
|
||||||
|
}
|
||||||
|
|
||||||
|
+type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor_ struct {
|
||||||
|
+ HostValueExtractor *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor `protobuf:"bytes,101,opt,name=host_value_extractor,json=hostValueExtractor,proto3,oneof"`
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor_ struct {
|
||||||
|
+ LocalPortValueExtractor *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor `protobuf:"bytes,102,opt,name=local_port_value_extractor,json=localPortValueExtractor,proto3,oneof"`
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
func (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_) isScopedRoutes_ScopeKeyBuilder_FragmentBuilder_Type() {
|
||||||
|
}
|
||||||
|
|
||||||
|
+func (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor_) isScopedRoutes_ScopeKeyBuilder_FragmentBuilder_Type() {
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+func (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor_) isScopedRoutes_ScopeKeyBuilder_FragmentBuilder_Type() {
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
// Specifies how the value of a header should be extracted.
|
||||||
|
// The following example maps the structure of a header to the fields in this message.
|
||||||
|
//
|
||||||
|
@@ -2475,6 +2505,92 @@
|
||||||
|
func (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_Element) isScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_ExtractType() {
|
||||||
|
}
|
||||||
|
|
||||||
|
+type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor struct {
|
||||||
|
+ state protoimpl.MessageState
|
||||||
|
+ sizeCache protoimpl.SizeCache
|
||||||
|
+ unknownFields protoimpl.UnknownFields
|
||||||
|
+
|
||||||
|
+ // The maximum number of host superset recomputes. If not specified, defaults to 100.
|
||||||
|
+ MaxRecomputeNum *wrappers.UInt32Value `protobuf:"bytes,1,opt,name=max_recompute_num,json=maxRecomputeNum,proto3" json:"max_recompute_num,omitempty"`
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+func (x *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor) Reset() {
|
||||||
|
+ *x = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor{}
|
||||||
|
+ if protoimpl.UnsafeEnabled {
|
||||||
|
+ mi := &file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[18]
|
||||||
|
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
+ ms.StoreMessageInfo(mi)
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+func (x *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor) String() string {
|
||||||
|
+ return protoimpl.X.MessageStringOf(x)
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+func (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor) ProtoMessage() {}
|
||||||
|
+
|
||||||
|
+func (x *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor) ProtoReflect() protoreflect.Message {
|
||||||
|
+ mi := &file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[18]
|
||||||
|
+ 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 ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor.ProtoReflect.Descriptor instead.
|
||||||
|
+func (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor) Descriptor() ([]byte, []int) {
|
||||||
|
+ return file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_rawDescGZIP(), []int{5, 0, 0, 1}
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+func (x *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor) GetMaxRecomputeNum() *wrappers.UInt32Value {
|
||||||
|
+ if x != nil {
|
||||||
|
+ return x.MaxRecomputeNum
|
||||||
|
+ }
|
||||||
|
+ return nil
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor struct {
|
||||||
|
+ state protoimpl.MessageState
|
||||||
|
+ sizeCache protoimpl.SizeCache
|
||||||
|
+ unknownFields protoimpl.UnknownFields
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+func (x *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor) Reset() {
|
||||||
|
+ *x = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor{}
|
||||||
|
+ if protoimpl.UnsafeEnabled {
|
||||||
|
+ mi := &file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[19]
|
||||||
|
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
+ ms.StoreMessageInfo(mi)
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+func (x *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor) String() string {
|
||||||
|
+ return protoimpl.X.MessageStringOf(x)
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+func (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor) ProtoMessage() {}
|
||||||
|
+
|
||||||
|
+func (x *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor) ProtoReflect() protoreflect.Message {
|
||||||
|
+ mi := &file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[19]
|
||||||
|
+ 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 ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor.ProtoReflect.Descriptor instead.
|
||||||
|
+func (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor) Descriptor() ([]byte, []int) {
|
||||||
|
+ return file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_rawDescGZIP(), []int{5, 0, 0, 2}
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
// Specifies a header field's key value pair to match on.
|
||||||
|
type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
@@ -2494,7 +2610,7 @@
|
||||||
|
func (x *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement) Reset() {
|
||||||
|
*x = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
- mi := &file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[18]
|
||||||
|
+ mi := &file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[20]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
@@ -2507,7 +2623,7 @@
|
||||||
|
func (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement) ProtoReflect() protoreflect.Message {
|
||||||
|
- mi := &file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[18]
|
||||||
|
+ mi := &file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[20]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
@@ -3079,7 +3195,7 @@
|
||||||
|
0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61,
|
||||||
|
0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52,
|
||||||
|
0x6f, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
|
||||||
|
- 0x6e, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xe9, 0x0e, 0x0a, 0x0c, 0x53, 0x63, 0x6f, 0x70, 0x65,
|
||||||
|
+ 0x6e, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xe1, 0x14, 0x0a, 0x0c, 0x53, 0x63, 0x6f, 0x70, 0x65,
|
||||||
|
0x64, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
|
||||||
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04,
|
||||||
|
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x11, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x6b,
|
||||||
|
@@ -3114,7 +3230,7 @@
|
||||||
|
0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
|
||||||
|
0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65,
|
||||||
|
0x64, 0x52, 0x64, 0x73, 0x48, 0x00, 0x52, 0x09, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x64,
|
||||||
|
- 0x73, 0x1a, 0xd9, 0x09, 0x0a, 0x0f, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75,
|
||||||
|
+ 0x73, 0x1a, 0xd1, 0x0f, 0x0a, 0x0f, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75,
|
||||||
|
0x69, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x91, 0x01, 0x0a, 0x09, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65,
|
||||||
|
0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x69, 0x2e, 0x65, 0x6e, 0x76, 0x6f,
|
||||||
|
0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c,
|
||||||
|
@@ -3124,7 +3240,7 @@
|
||||||
|
0x75, 0x74, 0x65, 0x73, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x69,
|
||||||
|
0x6c, 0x64, 0x65, 0x72, 0x2e, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x69,
|
||||||
|
0x6c, 0x64, 0x65, 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x09,
|
||||||
|
- 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0xd5, 0x07, 0x0a, 0x0f, 0x46, 0x72,
|
||||||
|
+ 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0xcd, 0x0d, 0x0a, 0x0f, 0x46, 0x72,
|
||||||
|
0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x12, 0xb6, 0x01,
|
||||||
|
0x0a, 0x16, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x65,
|
||||||
|
0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x7e,
|
||||||
|
@@ -3137,131 +3253,178 @@
|
||||||
|
0x6e, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
|
||||||
|
0x56, 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x48, 0x00,
|
||||||
|
0x52, 0x14, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74,
|
||||||
|
- 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x1a, 0x8f, 0x05, 0x0a, 0x14, 0x48, 0x65, 0x61, 0x64, 0x65,
|
||||||
|
- 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12,
|
||||||
|
- 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa,
|
||||||
|
- 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x11,
|
||||||
|
- 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f,
|
||||||
|
- 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
|
||||||
|
- 0x53, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x05, 0x69, 0x6e, 0x64,
|
||||||
|
- 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65,
|
||||||
|
- 0x78, 0x12, 0xa5, 0x01, 0x0a, 0x07, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20,
|
||||||
|
- 0x01, 0x28, 0x0b, 0x32, 0x88, 0x01, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74,
|
||||||
|
- 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e,
|
||||||
|
+ 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0xb0, 0x01, 0x0a, 0x14, 0x68, 0x6f, 0x73, 0x74, 0x5f,
|
||||||
|
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18,
|
||||||
|
+ 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x7c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78,
|
||||||
|
+ 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73,
|
||||||
|
+ 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f,
|
||||||
|
+ 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72,
|
||||||
|
+ 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73,
|
||||||
|
+ 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72,
|
||||||
|
+ 0x2e, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72,
|
||||||
|
+ 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63,
|
||||||
|
+ 0x74, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x12, 0x68, 0x6f, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65,
|
||||||
|
+ 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0xc1, 0x01, 0x0a, 0x1a, 0x6c, 0x6f,
|
||||||
|
+ 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x65,
|
||||||
|
+ 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x81,
|
||||||
|
+ 0x01, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
|
||||||
|
+ 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f,
|
||||||
|
+ 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,
|
||||||
|
+ 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x63,
|
||||||
|
+ 0x6f, 0x70, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65,
|
||||||
|
+ 0x4b, 0x65, 0x79, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x46, 0x72, 0x61, 0x67, 0x6d,
|
||||||
|
+ 0x65, 0x6e, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c,
|
||||||
|
+ 0x50, 0x6f, 0x72, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74,
|
||||||
|
+ 0x6f, 0x72, 0x48, 0x00, 0x52, 0x17, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x56,
|
||||||
|
+ 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x1a, 0x8f, 0x05,
|
||||||
|
+ 0x0a, 0x14, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74,
|
||||||
|
+ 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
|
||||||
|
+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e,
|
||||||
|
+ 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73,
|
||||||
|
+ 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10,
|
||||||
|
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72,
|
||||||
|
+ 0x12, 0x16, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x48,
|
||||||
|
+ 0x00, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0xa5, 0x01, 0x0a, 0x07, 0x65, 0x6c, 0x65,
|
||||||
|
+ 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x88, 0x01, 0x2e, 0x65, 0x6e,
|
||||||
|
+ 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66,
|
||||||
|
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68,
|
||||||
|
+ 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d,
|
||||||
|
+ 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64,
|
||||||
|
+ 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4b, 0x65, 0x79, 0x42,
|
||||||
|
+ 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x42,
|
||||||
|
+ 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c,
|
||||||
|
+ 0x75, 0x65, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4b, 0x76, 0x45, 0x6c,
|
||||||
|
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
|
||||||
|
+ 0x1a, 0xdb, 0x01, 0x0a, 0x09, 0x4b, 0x76, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x25,
|
||||||
|
+ 0x0a, 0x09, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
|
+ 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x73, 0x65, 0x70, 0x61,
|
||||||
|
+ 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01,
|
||||||
|
+ 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x6b, 0x65, 0x79,
|
||||||
|
+ 0x3a, 0x8b, 0x01, 0x9a, 0xc5, 0x88, 0x1e, 0x85, 0x01, 0x0a, 0x82, 0x01, 0x65, 0x6e, 0x76, 0x6f,
|
||||||
|
+ 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e,
|
||||||
|
0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e,
|
||||||
|
0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e,
|
||||||
|
- 0x76, 0x33, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x2e,
|
||||||
|
+ 0x76, 0x32, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x2e,
|
||||||
|
0x53, 0x63, 0x6f, 0x70, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e,
|
||||||
|
0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e,
|
||||||
|
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74, 0x72, 0x61,
|
||||||
|
- 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4b, 0x76, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00,
|
||||||
|
- 0x52, 0x07, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0xdb, 0x01, 0x0a, 0x09, 0x4b, 0x76,
|
||||||
|
- 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x09, 0x73, 0x65, 0x70, 0x61, 0x72,
|
||||||
|
- 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72,
|
||||||
|
- 0x02, 0x10, 0x01, 0x52, 0x09, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x19,
|
||||||
|
- 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04,
|
||||||
|
- 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x3a, 0x8b, 0x01, 0x9a, 0xc5, 0x88, 0x1e,
|
||||||
|
- 0x85, 0x01, 0x0a, 0x82, 0x01, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
|
+ 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4b, 0x76, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x7f,
|
||||||
|
+ 0x9a, 0xc5, 0x88, 0x1e, 0x7a, 0x0a, 0x78, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e,
|
||||||
|
+ 0x66, 0x69, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f,
|
||||||
|
+ 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,
|
||||||
|
+ 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63,
|
||||||
|
+ 0x6f, 0x70, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65,
|
||||||
|
+ 0x4b, 0x65, 0x79, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x46, 0x72, 0x61, 0x67, 0x6d,
|
||||||
|
+ 0x65, 0x6e, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65,
|
||||||
|
+ 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x42,
|
||||||
|
+ 0x0e, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x1a,
|
||||||
|
+ 0xdd, 0x01, 0x0a, 0x12, 0x48, 0x6f, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74,
|
||||||
|
+ 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x48, 0x0a, 0x11, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65,
|
||||||
|
+ 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
|
+ 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
|
+ 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52,
|
||||||
|
+ 0x0f, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x4e, 0x75, 0x6d,
|
||||||
|
+ 0x3a, 0x7d, 0x9a, 0xc5, 0x88, 0x1e, 0x78, 0x0a, 0x76, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63,
|
||||||
|
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65, 0x74,
|
||||||
|
+ 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
|
||||||
|
+ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e,
|
||||||
|
+ 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x53, 0x63, 0x6f,
|
||||||
|
+ 0x70, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x46, 0x72, 0x61,
|
||||||
|
+ 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x48, 0x6f, 0x73,
|
||||||
|
+ 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x1a,
|
||||||
|
+ 0x9e, 0x01, 0x0a, 0x17, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x56, 0x61, 0x6c,
|
||||||
|
+ 0x75, 0x65, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x3a, 0x82, 0x01, 0x9a, 0xc5,
|
||||||
|
+ 0x88, 0x1e, 0x7d, 0x0a, 0x7b, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
|
0x67, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b,
|
||||||
|
0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
|
0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x6f, 0x70,
|
||||||
|
0x65, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4b, 0x65,
|
||||||
|
0x79, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e,
|
||||||
|
- 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56,
|
||||||
|
- 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4b, 0x76,
|
||||||
|
- 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x7f, 0x9a, 0xc5, 0x88, 0x1e, 0x7a, 0x0a, 0x78,
|
||||||
|
- 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x69, 0x6c,
|
||||||
|
- 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70,
|
||||||
|
- 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61,
|
||||||
|
- 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x6f, 0x75,
|
||||||
|
- 0x74, 0x65, 0x73, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x69, 0x6c,
|
||||||
|
- 0x64, 0x65, 0x72, 0x2e, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x69, 0x6c,
|
||||||
|
- 0x64, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x45,
|
||||||
|
- 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x42, 0x0e, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x72,
|
||||||
|
- 0x61, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x6a, 0x9a, 0xc5, 0x88, 0x1e, 0x65, 0x0a,
|
||||||
|
- 0x63, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x69,
|
||||||
|
- 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74,
|
||||||
|
- 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e,
|
||||||
|
- 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x6f,
|
||||||
|
- 0x75, 0x74, 0x65, 0x73, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x69,
|
||||||
|
- 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x69,
|
||||||
|
- 0x6c, 0x64, 0x65, 0x72, 0x42, 0x0b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x03, 0xf8, 0x42,
|
||||||
|
- 0x01, 0x3a, 0x5a, 0x9a, 0xc5, 0x88, 0x1e, 0x55, 0x0a, 0x53, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e,
|
||||||
|
- 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65,
|
||||||
|
- 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65,
|
||||||
|
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32,
|
||||||
|
- 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x53, 0x63,
|
||||||
|
- 0x6f, 0x70, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x3a, 0x4a, 0x9a,
|
||||||
|
- 0xc5, 0x88, 0x1e, 0x45, 0x0a, 0x43, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
|
||||||
|
- 0x69, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72,
|
||||||
|
- 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
|
||||||
|
- 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x6f,
|
||||||
|
- 0x70, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x42, 0x17, 0x0a, 0x10, 0x63, 0x6f, 0x6e,
|
||||||
|
- 0x66, 0x69, 0x67, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x03, 0xf8,
|
||||||
|
- 0x42, 0x01, 0x22, 0xf1, 0x01, 0x0a, 0x09, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x64, 0x73,
|
||||||
|
- 0x12, 0x65, 0x0a, 0x18, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x5f, 0x72, 0x64, 0x73, 0x5f, 0x63,
|
||||||
|
- 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||||
|
- 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
|
- 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||||
|
- 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01,
|
||||||
|
- 0x52, 0x15, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x64, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
|
- 0x67, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x72, 0x64, 0x73, 0x5f,
|
||||||
|
- 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f,
|
||||||
|
- 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x73, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73,
|
||||||
|
- 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x47, 0x9a,
|
||||||
|
- 0xc5, 0x88, 0x1e, 0x42, 0x0a, 0x40, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
|
||||||
|
- 0x69, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72,
|
||||||
|
- 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
|
||||||
|
- 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x6f,
|
||||||
|
- 0x70, 0x65, 0x64, 0x52, 0x64, 0x73, 0x22, 0xcc, 0x02, 0x0a, 0x0a, 0x48, 0x74, 0x74, 0x70, 0x46,
|
||||||
|
- 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
|
||||||
|
- 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61,
|
||||||
|
- 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66,
|
||||||
|
- 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||||
|
- 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x48, 0x00,
|
||||||
|
- 0x52, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x58, 0x0a,
|
||||||
|
- 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72,
|
||||||
|
- 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e,
|
||||||
|
- 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x45,
|
||||||
|
- 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x6f,
|
||||||
|
- 0x75, 0x72, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69,
|
||||||
|
- 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x6f, 0x70,
|
||||||
|
- 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73,
|
||||||
|
- 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x3a, 0x48, 0x9a, 0xc5, 0x88, 0x1e, 0x43, 0x0a,
|
||||||
|
- 0x41, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x69,
|
||||||
|
- 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74,
|
||||||
|
- 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e,
|
||||||
|
- 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x46, 0x69, 0x6c, 0x74,
|
||||||
|
- 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x74, 0x79, 0x70,
|
||||||
|
- 0x65, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x06, 0x63,
|
||||||
|
- 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x9f, 0x01, 0x0a, 0x12, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
|
- 0x74, 0x49, 0x44, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x0c,
|
||||||
|
- 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01,
|
||||||
|
- 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
|
- 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x64, 0x43,
|
||||||
|
- 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3a, 0x50, 0x9a, 0xc5, 0x88, 0x1e, 0x4b, 0x0a, 0x49, 0x65, 0x6e,
|
||||||
|
+ 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x6f,
|
||||||
|
+ 0x72, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72,
|
||||||
|
+ 0x3a, 0x6a, 0x9a, 0xc5, 0x88, 0x1e, 0x65, 0x0a, 0x63, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63,
|
||||||
|
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65, 0x74,
|
||||||
|
+ 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
|
||||||
|
+ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e,
|
||||||
|
+ 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x53, 0x63, 0x6f,
|
||||||
|
+ 0x70, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x46, 0x72, 0x61,
|
||||||
|
+ 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x0b, 0x0a, 0x04,
|
||||||
|
+ 0x74, 0x79, 0x70, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x3a, 0x5a, 0x9a, 0xc5, 0x88, 0x1e, 0x55,
|
||||||
|
+ 0x0a, 0x53, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66,
|
||||||
|
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74,
|
||||||
|
+ 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61,
|
||||||
|
+ 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52,
|
||||||
|
+ 0x6f, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75,
|
||||||
|
+ 0x69, 0x6c, 0x64, 0x65, 0x72, 0x3a, 0x4a, 0x9a, 0xc5, 0x88, 0x1e, 0x45, 0x0a, 0x43, 0x65, 0x6e,
|
||||||
|
0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65,
|
||||||
|
0x72, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63,
|
||||||
|
0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
|
||||||
|
- 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x45, 0x78,
|
||||||
|
- 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x20, 0x45, 0x6e, 0x76, 0x6f,
|
||||||
|
- 0x79, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x48, 0x74, 0x74, 0x70, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
|
||||||
|
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x6a, 0x0a, 0x06,
|
||||||
|
- 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x52, 0x2e, 0x65,
|
||||||
|
- 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e,
|
||||||
|
- 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e,
|
||||||
|
- 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
|
||||||
|
- 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x43,
|
||||||
|
- 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72,
|
||||||
|
- 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x71, 0x0a, 0x49, 0x69, 0x6f, 0x2e, 0x65,
|
||||||
|
- 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e,
|
||||||
|
- 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65,
|
||||||
|
- 0x72, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f,
|
||||||
|
- 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67,
|
||||||
|
- 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x1a, 0x48, 0x74, 0x74, 0x70, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
|
||||||
|
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74,
|
||||||
|
- 0x6f, 0x50, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
|
- 0x74, 0x6f, 0x33,
|
||||||
|
+ 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x65,
|
||||||
|
+ 0x73, 0x42, 0x17, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x73, 0x70, 0x65, 0x63,
|
||||||
|
+ 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xf1, 0x01, 0x0a, 0x09, 0x53,
|
||||||
|
+ 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x64, 0x73, 0x12, 0x65, 0x0a, 0x18, 0x73, 0x63, 0x6f, 0x70,
|
||||||
|
+ 0x65, 0x64, 0x5f, 0x72, 0x64, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x73, 0x6f,
|
||||||
|
+ 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x6e, 0x76,
|
||||||
|
+ 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76,
|
||||||
|
+ 0x33, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x08,
|
||||||
|
+ 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x15, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x64,
|
||||||
|
+ 0x52, 0x64, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12,
|
||||||
|
+ 0x34, 0x0a, 0x16, 0x73, 0x72, 0x64, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
|
||||||
|
+ 0x73, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
|
+ 0x14, 0x73, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x4c, 0x6f,
|
||||||
|
+ 0x63, 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x47, 0x9a, 0xc5, 0x88, 0x1e, 0x42, 0x0a, 0x40, 0x65, 0x6e,
|
||||||
|
+ 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65,
|
||||||
|
+ 0x72, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63,
|
||||||
|
+ 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
|
||||||
|
+ 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x52, 0x64, 0x73, 0x22, 0xcc,
|
||||||
|
+ 0x02, 0x0a, 0x0a, 0x48, 0x74, 0x74, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a,
|
||||||
|
+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04,
|
||||||
|
+ 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x74, 0x79,
|
||||||
|
+ 0x70, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
|
||||||
|
+ 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||||
|
+ 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x64, 0x43,
|
||||||
|
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x58, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f,
|
||||||
|
+ 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||||
|
+ 0x2b, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63,
|
||||||
|
+ 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
|
||||||
|
+ 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0f,
|
||||||
|
+ 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x12,
|
||||||
|
+ 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x06,
|
||||||
|
+ 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
|
||||||
|
+ 0x3a, 0x48, 0x9a, 0xc5, 0x88, 0x1e, 0x43, 0x0a, 0x41, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63,
|
||||||
|
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65, 0x74,
|
||||||
|
+ 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
|
||||||
|
+ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e,
|
||||||
|
+ 0x48, 0x74, 0x74, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x63, 0x6f,
|
||||||
|
+ 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a,
|
||||||
|
+ 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x9f, 0x01,
|
||||||
|
+ 0x0a, 0x12, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x45, 0x78, 0x74, 0x65, 0x6e,
|
||||||
|
+ 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x0c, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x6f,
|
||||||
|
+ 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f,
|
||||||
|
+ 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79,
|
||||||
|
+ 0x52, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3a, 0x50, 0x9a,
|
||||||
|
+ 0xc5, 0x88, 0x1e, 0x4b, 0x0a, 0x49, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
|
||||||
|
+ 0x69, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72,
|
||||||
|
+ 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
|
||||||
|
+ 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x71,
|
||||||
|
+ 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22,
|
||||||
|
+ 0x8e, 0x01, 0x0a, 0x20, 0x45, 0x6e, 0x76, 0x6f, 0x79, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x48,
|
||||||
|
+ 0x74, 0x74, 0x70, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x6e,
|
||||||
|
+ 0x61, 0x67, 0x65, 0x72, 0x12, 0x6a, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01,
|
||||||
|
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x52, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74,
|
||||||
|
+ 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e,
|
||||||
|
+ 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e,
|
||||||
|
+ 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e,
|
||||||
|
+ 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
|
||||||
|
+ 0x6e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||||
|
+ 0x42, 0x71, 0x0a, 0x49, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78,
|
||||||
|
+ 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
|
||||||
|
+ 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f,
|
||||||
|
+ 0x72, 0x6b, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,
|
||||||
|
+ 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x1a, 0x48,
|
||||||
|
+ 0x74, 0x74, 0x70, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x6e,
|
||||||
|
+ 0x61, 0x67, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06,
|
||||||
|
+ 0x02, 0x10, 0x02, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
@@ -3277,7 +3440,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_enumTypes = make([]protoimpl.EnumInfo, 5)
|
||||||
|
-var file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
|
||||||
|
+var file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 21)
|
||||||
|
var file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_goTypes = []interface{}{
|
||||||
|
(HttpConnectionManager_CodecType)(0), // 0: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.CodecType
|
||||||
|
(HttpConnectionManager_ServerHeaderTransformation)(0), // 1: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.ServerHeaderTransformation
|
||||||
|
@@ -3302,102 +3465,107 @@
|
||||||
|
(*ScopedRoutes_ScopeKeyBuilder)(nil), // 20: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder
|
||||||
|
(*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder)(nil), // 21: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder
|
||||||
|
(*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor)(nil), // 22: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor
|
||||||
|
- (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement)(nil), // 23: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor.KvElement
|
||||||
|
- (*v32.RouteConfiguration)(nil), // 24: envoy.config.route.v3.RouteConfiguration
|
||||||
|
- (*wrappers.BoolValue)(nil), // 25: google.protobuf.BoolValue
|
||||||
|
- (*v3.HttpProtocolOptions)(nil), // 26: envoy.config.core.v3.HttpProtocolOptions
|
||||||
|
- (*v3.Http1ProtocolOptions)(nil), // 27: envoy.config.core.v3.Http1ProtocolOptions
|
||||||
|
- (*v3.Http2ProtocolOptions)(nil), // 28: envoy.config.core.v3.Http2ProtocolOptions
|
||||||
|
- (*v3.Http3ProtocolOptions)(nil), // 29: envoy.config.core.v3.Http3ProtocolOptions
|
||||||
|
- (*v3.SchemeHeaderTransformation)(nil), // 30: envoy.config.core.v3.SchemeHeaderTransformation
|
||||||
|
- (*wrappers.UInt32Value)(nil), // 31: google.protobuf.UInt32Value
|
||||||
|
- (*duration.Duration)(nil), // 32: google.protobuf.Duration
|
||||||
|
- (*v31.AccessLog)(nil), // 33: envoy.config.accesslog.v3.AccessLog
|
||||||
|
- (*v3.TypedExtensionConfig)(nil), // 34: envoy.config.core.v3.TypedExtensionConfig
|
||||||
|
- (*v3.SubstitutionFormatString)(nil), // 35: envoy.config.core.v3.SubstitutionFormatString
|
||||||
|
- (*v31.AccessLogFilter)(nil), // 36: envoy.config.accesslog.v3.AccessLogFilter
|
||||||
|
- (*v3.DataSource)(nil), // 37: envoy.config.core.v3.DataSource
|
||||||
|
- (*v3.HeaderValueOption)(nil), // 38: envoy.config.core.v3.HeaderValueOption
|
||||||
|
- (*v3.ConfigSource)(nil), // 39: envoy.config.core.v3.ConfigSource
|
||||||
|
- (*v32.ScopedRouteConfiguration)(nil), // 40: envoy.config.route.v3.ScopedRouteConfiguration
|
||||||
|
- (*any.Any)(nil), // 41: google.protobuf.Any
|
||||||
|
- (*v3.ExtensionConfigSource)(nil), // 42: envoy.config.core.v3.ExtensionConfigSource
|
||||||
|
- (*v33.Percent)(nil), // 43: envoy.type.v3.Percent
|
||||||
|
- (*v34.CustomTag)(nil), // 44: envoy.type.tracing.v3.CustomTag
|
||||||
|
- (*v35.Tracing_Http)(nil), // 45: envoy.config.trace.v3.Tracing.Http
|
||||||
|
- (*v36.PathTransformation)(nil), // 46: envoy.type.http.v3.PathTransformation
|
||||||
|
+ (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor)(nil), // 23: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HostValueExtractor
|
||||||
|
+ (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor)(nil), // 24: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.LocalPortValueExtractor
|
||||||
|
+ (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement)(nil), // 25: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor.KvElement
|
||||||
|
+ (*v32.RouteConfiguration)(nil), // 26: envoy.config.route.v3.RouteConfiguration
|
||||||
|
+ (*wrappers.BoolValue)(nil), // 27: google.protobuf.BoolValue
|
||||||
|
+ (*v3.HttpProtocolOptions)(nil), // 28: envoy.config.core.v3.HttpProtocolOptions
|
||||||
|
+ (*v3.Http1ProtocolOptions)(nil), // 29: envoy.config.core.v3.Http1ProtocolOptions
|
||||||
|
+ (*v3.Http2ProtocolOptions)(nil), // 30: envoy.config.core.v3.Http2ProtocolOptions
|
||||||
|
+ (*v3.Http3ProtocolOptions)(nil), // 31: envoy.config.core.v3.Http3ProtocolOptions
|
||||||
|
+ (*v3.SchemeHeaderTransformation)(nil), // 32: envoy.config.core.v3.SchemeHeaderTransformation
|
||||||
|
+ (*wrappers.UInt32Value)(nil), // 33: google.protobuf.UInt32Value
|
||||||
|
+ (*duration.Duration)(nil), // 34: google.protobuf.Duration
|
||||||
|
+ (*v31.AccessLog)(nil), // 35: envoy.config.accesslog.v3.AccessLog
|
||||||
|
+ (*v3.TypedExtensionConfig)(nil), // 36: envoy.config.core.v3.TypedExtensionConfig
|
||||||
|
+ (*v3.SubstitutionFormatString)(nil), // 37: envoy.config.core.v3.SubstitutionFormatString
|
||||||
|
+ (*v31.AccessLogFilter)(nil), // 38: envoy.config.accesslog.v3.AccessLogFilter
|
||||||
|
+ (*v3.DataSource)(nil), // 39: envoy.config.core.v3.DataSource
|
||||||
|
+ (*v3.HeaderValueOption)(nil), // 40: envoy.config.core.v3.HeaderValueOption
|
||||||
|
+ (*v3.ConfigSource)(nil), // 41: envoy.config.core.v3.ConfigSource
|
||||||
|
+ (*v32.ScopedRouteConfiguration)(nil), // 42: envoy.config.route.v3.ScopedRouteConfiguration
|
||||||
|
+ (*any.Any)(nil), // 43: google.protobuf.Any
|
||||||
|
+ (*v3.ExtensionConfigSource)(nil), // 44: envoy.config.core.v3.ExtensionConfigSource
|
||||||
|
+ (*v33.Percent)(nil), // 45: envoy.type.v3.Percent
|
||||||
|
+ (*v34.CustomTag)(nil), // 46: envoy.type.tracing.v3.CustomTag
|
||||||
|
+ (*v35.Tracing_Http)(nil), // 47: envoy.config.trace.v3.Tracing.Http
|
||||||
|
+ (*v36.PathTransformation)(nil), // 48: envoy.type.http.v3.PathTransformation
|
||||||
|
}
|
||||||
|
var file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_depIdxs = []int32{
|
||||||
|
0, // 0: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.codec_type:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.CodecType
|
||||||
|
8, // 1: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.rds:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.Rds
|
||||||
|
- 24, // 2: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.route_config:type_name -> envoy.config.route.v3.RouteConfiguration
|
||||||
|
+ 26, // 2: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.route_config:type_name -> envoy.config.route.v3.RouteConfiguration
|
||||||
|
10, // 3: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.scoped_routes:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes
|
||||||
|
12, // 4: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.http_filters:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter
|
||||||
|
- 25, // 5: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.add_user_agent:type_name -> google.protobuf.BoolValue
|
||||||
|
+ 27, // 5: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.add_user_agent:type_name -> google.protobuf.BoolValue
|
||||||
|
15, // 6: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.tracing:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing
|
||||||
|
- 26, // 7: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.common_http_protocol_options:type_name -> envoy.config.core.v3.HttpProtocolOptions
|
||||||
|
- 27, // 8: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.http_protocol_options:type_name -> envoy.config.core.v3.Http1ProtocolOptions
|
||||||
|
- 28, // 9: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.http2_protocol_options:type_name -> envoy.config.core.v3.Http2ProtocolOptions
|
||||||
|
- 29, // 10: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.http3_protocol_options:type_name -> envoy.config.core.v3.Http3ProtocolOptions
|
||||||
|
+ 28, // 7: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.common_http_protocol_options:type_name -> envoy.config.core.v3.HttpProtocolOptions
|
||||||
|
+ 29, // 8: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.http_protocol_options:type_name -> envoy.config.core.v3.Http1ProtocolOptions
|
||||||
|
+ 30, // 9: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.http2_protocol_options:type_name -> envoy.config.core.v3.Http2ProtocolOptions
|
||||||
|
+ 31, // 10: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.http3_protocol_options:type_name -> envoy.config.core.v3.Http3ProtocolOptions
|
||||||
|
1, // 11: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.server_header_transformation:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.ServerHeaderTransformation
|
||||||
|
- 30, // 12: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.scheme_header_transformation:type_name -> envoy.config.core.v3.SchemeHeaderTransformation
|
||||||
|
- 31, // 13: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.max_request_headers_kb:type_name -> google.protobuf.UInt32Value
|
||||||
|
- 32, // 14: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_idle_timeout:type_name -> google.protobuf.Duration
|
||||||
|
- 32, // 15: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.request_timeout:type_name -> google.protobuf.Duration
|
||||||
|
- 32, // 16: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.request_headers_timeout:type_name -> google.protobuf.Duration
|
||||||
|
- 32, // 17: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.drain_timeout:type_name -> google.protobuf.Duration
|
||||||
|
- 32, // 18: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.delayed_close_timeout:type_name -> google.protobuf.Duration
|
||||||
|
- 33, // 19: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.access_log:type_name -> envoy.config.accesslog.v3.AccessLog
|
||||||
|
- 25, // 20: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.use_remote_address:type_name -> google.protobuf.BoolValue
|
||||||
|
- 34, // 21: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.original_ip_detection_extensions:type_name -> envoy.config.core.v3.TypedExtensionConfig
|
||||||
|
+ 32, // 12: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.scheme_header_transformation:type_name -> envoy.config.core.v3.SchemeHeaderTransformation
|
||||||
|
+ 33, // 13: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.max_request_headers_kb:type_name -> google.protobuf.UInt32Value
|
||||||
|
+ 34, // 14: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_idle_timeout:type_name -> google.protobuf.Duration
|
||||||
|
+ 34, // 15: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.request_timeout:type_name -> google.protobuf.Duration
|
||||||
|
+ 34, // 16: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.request_headers_timeout:type_name -> google.protobuf.Duration
|
||||||
|
+ 34, // 17: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.drain_timeout:type_name -> google.protobuf.Duration
|
||||||
|
+ 34, // 18: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.delayed_close_timeout:type_name -> google.protobuf.Duration
|
||||||
|
+ 35, // 19: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.access_log:type_name -> envoy.config.accesslog.v3.AccessLog
|
||||||
|
+ 27, // 20: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.use_remote_address:type_name -> google.protobuf.BoolValue
|
||||||
|
+ 36, // 21: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.original_ip_detection_extensions:type_name -> envoy.config.core.v3.TypedExtensionConfig
|
||||||
|
16, // 22: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.internal_address_config:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.InternalAddressConfig
|
||||||
|
- 25, // 23: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.generate_request_id:type_name -> google.protobuf.BoolValue
|
||||||
|
+ 27, // 23: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.generate_request_id:type_name -> google.protobuf.BoolValue
|
||||||
|
2, // 24: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.forward_client_cert_details:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.ForwardClientCertDetails
|
||||||
|
17, // 25: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.set_current_client_cert_details:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.SetCurrentClientCertDetails
|
||||||
|
18, // 26: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.upgrade_configs:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.UpgradeConfig
|
||||||
|
- 25, // 27: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.normalize_path:type_name -> google.protobuf.BoolValue
|
||||||
|
+ 27, // 27: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.normalize_path:type_name -> google.protobuf.BoolValue
|
||||||
|
3, // 28: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.path_with_escaped_slashes_action:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.PathWithEscapedSlashesAction
|
||||||
|
13, // 29: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.request_id_extension:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.RequestIDExtension
|
||||||
|
6, // 30: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.local_reply_config:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.LocalReplyConfig
|
||||||
|
- 25, // 31: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_error_on_invalid_http_message:type_name -> google.protobuf.BoolValue
|
||||||
|
+ 27, // 31: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_error_on_invalid_http_message:type_name -> google.protobuf.BoolValue
|
||||||
|
19, // 32: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.path_normalization_options:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.PathNormalizationOptions
|
||||||
|
7, // 33: envoy.extensions.filters.network.http_connection_manager.v3.LocalReplyConfig.mappers:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper
|
||||||
|
- 35, // 34: envoy.extensions.filters.network.http_connection_manager.v3.LocalReplyConfig.body_format:type_name -> envoy.config.core.v3.SubstitutionFormatString
|
||||||
|
- 36, // 35: envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper.filter:type_name -> envoy.config.accesslog.v3.AccessLogFilter
|
||||||
|
- 31, // 36: envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper.status_code:type_name -> google.protobuf.UInt32Value
|
||||||
|
- 37, // 37: envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper.body:type_name -> envoy.config.core.v3.DataSource
|
||||||
|
- 35, // 38: envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper.body_format_override:type_name -> envoy.config.core.v3.SubstitutionFormatString
|
||||||
|
- 38, // 39: envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper.headers_to_add:type_name -> envoy.config.core.v3.HeaderValueOption
|
||||||
|
- 39, // 40: envoy.extensions.filters.network.http_connection_manager.v3.Rds.config_source:type_name -> envoy.config.core.v3.ConfigSource
|
||||||
|
- 40, // 41: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRouteConfigurationsList.scoped_route_configurations:type_name -> envoy.config.route.v3.ScopedRouteConfiguration
|
||||||
|
+ 37, // 34: envoy.extensions.filters.network.http_connection_manager.v3.LocalReplyConfig.body_format:type_name -> envoy.config.core.v3.SubstitutionFormatString
|
||||||
|
+ 38, // 35: envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper.filter:type_name -> envoy.config.accesslog.v3.AccessLogFilter
|
||||||
|
+ 33, // 36: envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper.status_code:type_name -> google.protobuf.UInt32Value
|
||||||
|
+ 39, // 37: envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper.body:type_name -> envoy.config.core.v3.DataSource
|
||||||
|
+ 37, // 38: envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper.body_format_override:type_name -> envoy.config.core.v3.SubstitutionFormatString
|
||||||
|
+ 40, // 39: envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper.headers_to_add:type_name -> envoy.config.core.v3.HeaderValueOption
|
||||||
|
+ 41, // 40: envoy.extensions.filters.network.http_connection_manager.v3.Rds.config_source:type_name -> envoy.config.core.v3.ConfigSource
|
||||||
|
+ 42, // 41: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRouteConfigurationsList.scoped_route_configurations:type_name -> envoy.config.route.v3.ScopedRouteConfiguration
|
||||||
|
20, // 42: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.scope_key_builder:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder
|
||||||
|
- 39, // 43: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.rds_config_source:type_name -> envoy.config.core.v3.ConfigSource
|
||||||
|
+ 41, // 43: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.rds_config_source:type_name -> envoy.config.core.v3.ConfigSource
|
||||||
|
9, // 44: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.scoped_route_configurations_list:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.ScopedRouteConfigurationsList
|
||||||
|
11, // 45: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.scoped_rds:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.ScopedRds
|
||||||
|
- 39, // 46: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRds.scoped_rds_config_source:type_name -> envoy.config.core.v3.ConfigSource
|
||||||
|
- 41, // 47: envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter.typed_config:type_name -> google.protobuf.Any
|
||||||
|
- 42, // 48: envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter.config_discovery:type_name -> envoy.config.core.v3.ExtensionConfigSource
|
||||||
|
- 41, // 49: envoy.extensions.filters.network.http_connection_manager.v3.RequestIDExtension.typed_config:type_name -> google.protobuf.Any
|
||||||
|
+ 41, // 46: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRds.scoped_rds_config_source:type_name -> envoy.config.core.v3.ConfigSource
|
||||||
|
+ 43, // 47: envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter.typed_config:type_name -> google.protobuf.Any
|
||||||
|
+ 44, // 48: envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter.config_discovery:type_name -> envoy.config.core.v3.ExtensionConfigSource
|
||||||
|
+ 43, // 49: envoy.extensions.filters.network.http_connection_manager.v3.RequestIDExtension.typed_config:type_name -> google.protobuf.Any
|
||||||
|
5, // 50: envoy.extensions.filters.network.http_connection_manager.v3.EnvoyMobileHttpConnectionManager.config:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
|
||||||
|
- 43, // 51: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.client_sampling:type_name -> envoy.type.v3.Percent
|
||||||
|
- 43, // 52: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.random_sampling:type_name -> envoy.type.v3.Percent
|
||||||
|
- 43, // 53: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.overall_sampling:type_name -> envoy.type.v3.Percent
|
||||||
|
- 31, // 54: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.max_path_tag_length:type_name -> google.protobuf.UInt32Value
|
||||||
|
- 44, // 55: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.custom_tags:type_name -> envoy.type.tracing.v3.CustomTag
|
||||||
|
- 45, // 56: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.provider:type_name -> envoy.config.trace.v3.Tracing.Http
|
||||||
|
- 25, // 57: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.SetCurrentClientCertDetails.subject:type_name -> google.protobuf.BoolValue
|
||||||
|
+ 45, // 51: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.client_sampling:type_name -> envoy.type.v3.Percent
|
||||||
|
+ 45, // 52: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.random_sampling:type_name -> envoy.type.v3.Percent
|
||||||
|
+ 45, // 53: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.overall_sampling:type_name -> envoy.type.v3.Percent
|
||||||
|
+ 33, // 54: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.max_path_tag_length:type_name -> google.protobuf.UInt32Value
|
||||||
|
+ 46, // 55: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.custom_tags:type_name -> envoy.type.tracing.v3.CustomTag
|
||||||
|
+ 47, // 56: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.provider:type_name -> envoy.config.trace.v3.Tracing.Http
|
||||||
|
+ 27, // 57: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.SetCurrentClientCertDetails.subject:type_name -> google.protobuf.BoolValue
|
||||||
|
12, // 58: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.UpgradeConfig.filters:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter
|
||||||
|
- 25, // 59: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.UpgradeConfig.enabled:type_name -> google.protobuf.BoolValue
|
||||||
|
- 46, // 60: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.PathNormalizationOptions.forwarding_transformation:type_name -> envoy.type.http.v3.PathTransformation
|
||||||
|
- 46, // 61: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.PathNormalizationOptions.http_filter_transformation:type_name -> envoy.type.http.v3.PathTransformation
|
||||||
|
+ 27, // 59: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.UpgradeConfig.enabled:type_name -> google.protobuf.BoolValue
|
||||||
|
+ 48, // 60: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.PathNormalizationOptions.forwarding_transformation:type_name -> envoy.type.http.v3.PathTransformation
|
||||||
|
+ 48, // 61: envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.PathNormalizationOptions.http_filter_transformation:type_name -> envoy.type.http.v3.PathTransformation
|
||||||
|
21, // 62: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.fragments:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder
|
||||||
|
22, // 63: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.header_value_extractor:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor
|
||||||
|
- 23, // 64: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor.element:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor.KvElement
|
||||||
|
- 65, // [65:65] is the sub-list for method output_type
|
||||||
|
- 65, // [65:65] is the sub-list for method input_type
|
||||||
|
- 65, // [65:65] is the sub-list for extension type_name
|
||||||
|
- 65, // [65:65] is the sub-list for extension extendee
|
||||||
|
- 0, // [0:65] is the sub-list for field type_name
|
||||||
|
+ 23, // 64: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.host_value_extractor:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HostValueExtractor
|
||||||
|
+ 24, // 65: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.local_port_value_extractor:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.LocalPortValueExtractor
|
||||||
|
+ 25, // 66: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor.element:type_name -> envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor.KvElement
|
||||||
|
+ 33, // 67: envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HostValueExtractor.max_recompute_num:type_name -> google.protobuf.UInt32Value
|
||||||
|
+ 68, // [68:68] is the sub-list for method output_type
|
||||||
|
+ 68, // [68:68] is the sub-list for method input_type
|
||||||
|
+ 68, // [68:68] is the sub-list for extension type_name
|
||||||
|
+ 68, // [68:68] is the sub-list for extension extendee
|
||||||
|
+ 0, // [0:68] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
@@ -3625,6 +3793,30 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
+ switch v := v.(*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor); i {
|
||||||
|
+ case 0:
|
||||||
|
+ return &v.state
|
||||||
|
+ case 1:
|
||||||
|
+ return &v.sizeCache
|
||||||
|
+ case 2:
|
||||||
|
+ return &v.unknownFields
|
||||||
|
+ default:
|
||||||
|
+ return nil
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
+ switch v := v.(*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor); i {
|
||||||
|
+ case 0:
|
||||||
|
+ return &v.state
|
||||||
|
+ case 1:
|
||||||
|
+ return &v.sizeCache
|
||||||
|
+ case 2:
|
||||||
|
+ return &v.unknownFields
|
||||||
|
+ default:
|
||||||
|
+ return nil
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
@@ -3653,6 +3845,8 @@
|
||||||
|
}
|
||||||
|
file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[16].OneofWrappers = []interface{}{
|
||||||
|
(*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_)(nil),
|
||||||
|
+ (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor_)(nil),
|
||||||
|
+ (*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor_)(nil),
|
||||||
|
}
|
||||||
|
file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_msgTypes[17].OneofWrappers = []interface{}{
|
||||||
|
(*ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_Index)(nil),
|
||||||
|
@@ -3664,7 +3858,7 @@
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_rawDesc,
|
||||||
|
NumEnums: 5,
|
||||||
|
- NumMessages: 19,
|
||||||
|
+ NumMessages: 21,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
diff -Naur go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.validate.go go-control-plane-new/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.validate.go
|
||||||
|
--- go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.validate.go 2024-01-04 21:07:22.000000000 +0800
|
||||||
|
+++ go-control-plane-new/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.validate.go 2024-01-04 21:02:10.000000000 +0800
|
||||||
|
@@ -1986,6 +1986,30 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ case *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor_:
|
||||||
|
+
|
||||||
|
+ if v, ok := interface{}(m.GetHostValueExtractor()).(interface{ Validate() error }); ok {
|
||||||
|
+ if err := v.Validate(); err != nil {
|
||||||
|
+ return ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{
|
||||||
|
+ field: "HostValueExtractor",
|
||||||
|
+ reason: "embedded message failed validation",
|
||||||
|
+ cause: err,
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ case *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor_:
|
||||||
|
+
|
||||||
|
+ if v, ok := interface{}(m.GetLocalPortValueExtractor()).(interface{ Validate() error }); ok {
|
||||||
|
+ if err := v.Validate(); err != nil {
|
||||||
|
+ return ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{
|
||||||
|
+ field: "LocalPortValueExtractor",
|
||||||
|
+ reason: "embedded message failed validation",
|
||||||
|
+ cause: err,
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
default:
|
||||||
|
return ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{
|
||||||
|
field: "Type",
|
||||||
|
@@ -2162,6 +2186,172 @@
|
||||||
|
} = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError{}
|
||||||
|
|
||||||
|
// Validate checks the field values on
|
||||||
|
+// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor with the
|
||||||
|
+// rules defined in the proto definition for this message. If any rules are
|
||||||
|
+// violated, an error is returned.
|
||||||
|
+func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor) Validate() error {
|
||||||
|
+ if m == nil {
|
||||||
|
+ return nil
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if v, ok := interface{}(m.GetMaxRecomputeNum()).(interface{ Validate() error }); ok {
|
||||||
|
+ if err := v.Validate(); err != nil {
|
||||||
|
+ return ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractorValidationError{
|
||||||
|
+ field: "MaxRecomputeNum",
|
||||||
|
+ reason: "embedded message failed validation",
|
||||||
|
+ cause: err,
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return nil
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractorValidationError
|
||||||
|
+// is the validation error returned by
|
||||||
|
+// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor.Validate if
|
||||||
|
+// the designated constraints aren't met.
|
||||||
|
+type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractorValidationError struct {
|
||||||
|
+ field string
|
||||||
|
+ reason string
|
||||||
|
+ cause error
|
||||||
|
+ key bool
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// Field function returns field value.
|
||||||
|
+func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractorValidationError) Field() string {
|
||||||
|
+ return e.field
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// Reason function returns reason value.
|
||||||
|
+func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractorValidationError) Reason() string {
|
||||||
|
+ return e.reason
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// Cause function returns cause value.
|
||||||
|
+func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractorValidationError) Cause() error {
|
||||||
|
+ return e.cause
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// Key function returns key value.
|
||||||
|
+func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractorValidationError) Key() bool {
|
||||||
|
+ return e.key
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// ErrorName returns error name.
|
||||||
|
+func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractorValidationError) ErrorName() string {
|
||||||
|
+ return "ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractorValidationError"
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// Error satisfies the builtin error interface
|
||||||
|
+func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractorValidationError) Error() string {
|
||||||
|
+ cause := ""
|
||||||
|
+ if e.cause != nil {
|
||||||
|
+ cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ key := ""
|
||||||
|
+ if e.key {
|
||||||
|
+ key = "key for "
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return fmt.Sprintf(
|
||||||
|
+ "invalid %sScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor.%s: %s%s",
|
||||||
|
+ key,
|
||||||
|
+ e.field,
|
||||||
|
+ e.reason,
|
||||||
|
+ cause)
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+var _ error = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractorValidationError{}
|
||||||
|
+
|
||||||
|
+var _ interface {
|
||||||
|
+ Field() string
|
||||||
|
+ Reason() string
|
||||||
|
+ Key() bool
|
||||||
|
+ Cause() error
|
||||||
|
+ ErrorName() string
|
||||||
|
+} = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractorValidationError{}
|
||||||
|
+
|
||||||
|
+// Validate checks the field values on
|
||||||
|
+// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor with
|
||||||
|
+// the rules defined in the proto definition for this message. If any rules
|
||||||
|
+// are violated, an error is returned.
|
||||||
|
+func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor) Validate() error {
|
||||||
|
+ if m == nil {
|
||||||
|
+ return nil
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return nil
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractorValidationError
|
||||||
|
+// is the validation error returned by
|
||||||
|
+// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor.Validate
|
||||||
|
+// if the designated constraints aren't met.
|
||||||
|
+type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractorValidationError struct {
|
||||||
|
+ field string
|
||||||
|
+ reason string
|
||||||
|
+ cause error
|
||||||
|
+ key bool
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// Field function returns field value.
|
||||||
|
+func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractorValidationError) Field() string {
|
||||||
|
+ return e.field
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// Reason function returns reason value.
|
||||||
|
+func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractorValidationError) Reason() string {
|
||||||
|
+ return e.reason
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// Cause function returns cause value.
|
||||||
|
+func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractorValidationError) Cause() error {
|
||||||
|
+ return e.cause
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// Key function returns key value.
|
||||||
|
+func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractorValidationError) Key() bool {
|
||||||
|
+ return e.key
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// ErrorName returns error name.
|
||||||
|
+func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractorValidationError) ErrorName() string {
|
||||||
|
+ return "ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractorValidationError"
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// Error satisfies the builtin error interface
|
||||||
|
+func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractorValidationError) Error() string {
|
||||||
|
+ cause := ""
|
||||||
|
+ if e.cause != nil {
|
||||||
|
+ cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ key := ""
|
||||||
|
+ if e.key {
|
||||||
|
+ key = "key for "
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return fmt.Sprintf(
|
||||||
|
+ "invalid %sScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor.%s: %s%s",
|
||||||
|
+ key,
|
||||||
|
+ e.field,
|
||||||
|
+ e.reason,
|
||||||
|
+ cause)
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+var _ error = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractorValidationError{}
|
||||||
|
+
|
||||||
|
+var _ interface {
|
||||||
|
+ Field() string
|
||||||
|
+ Reason() string
|
||||||
|
+ Key() bool
|
||||||
|
+ Cause() error
|
||||||
|
+ ErrorName() string
|
||||||
|
+} = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractorValidationError{}
|
||||||
|
+
|
||||||
|
+// Validate checks the field values on
|
||||||
|
// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement
|
||||||
|
// with the rules defined in the proto definition for this message. If any
|
||||||
|
// rules are violated, an error is returned.
|
||||||
File diff suppressed because it is too large
Load Diff
5
go.mod
5
go.mod
@@ -15,7 +15,7 @@ replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.5
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/AlecAivazis/survey/v2 v2.3.6
|
github.com/AlecAivazis/survey/v2 v2.3.6
|
||||||
github.com/agiledragon/gomonkey/v2 v2.9.0
|
github.com/agiledragon/gomonkey/v2 v2.11.0
|
||||||
github.com/avast/retry-go/v4 v4.3.4
|
github.com/avast/retry-go/v4 v4.3.4
|
||||||
github.com/compose-spec/compose-go v1.8.2
|
github.com/compose-spec/compose-go v1.8.2
|
||||||
github.com/docker/cli v20.10.20+incompatible
|
github.com/docker/cli v20.10.20+incompatible
|
||||||
@@ -238,6 +238,8 @@ require (
|
|||||||
github.com/spf13/cast v1.3.1 // indirect
|
github.com/spf13/cast v1.3.1 // indirect
|
||||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||||
github.com/theupdateframework/notary v0.7.0 // indirect
|
github.com/theupdateframework/notary v0.7.0 // indirect
|
||||||
|
github.com/tidwall/match v1.1.1 // indirect
|
||||||
|
github.com/tidwall/pretty v1.2.0 // indirect
|
||||||
github.com/tonistiigi/fsutil v0.0.0-20220930225714-4638ad635be5 // indirect
|
github.com/tonistiigi/fsutil v0.0.0-20220930225714-4638ad635be5 // indirect
|
||||||
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
|
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
|
||||||
github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3 // indirect
|
github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3 // indirect
|
||||||
@@ -302,6 +304,7 @@ require (
|
|||||||
github.com/evanphx/json-patch/v5 v5.6.0
|
github.com/evanphx/json-patch/v5 v5.6.0
|
||||||
github.com/google/yamlfmt v0.10.0
|
github.com/google/yamlfmt v0.10.0
|
||||||
github.com/kylelemons/godebug v1.1.0
|
github.com/kylelemons/godebug v1.1.0
|
||||||
|
github.com/tidwall/gjson v1.17.0
|
||||||
helm.sh/helm/v3 v3.7.1
|
helm.sh/helm/v3 v3.7.1
|
||||||
k8s.io/apiextensions-apiserver v0.25.4
|
k8s.io/apiextensions-apiserver v0.25.4
|
||||||
knative.dev/networking v0.0.0-20220302134042-e8b2eb995165
|
knative.dev/networking v0.0.0-20220302134042-e8b2eb995165
|
||||||
|
|||||||
10
go.sum
10
go.sum
@@ -160,8 +160,8 @@ github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmx
|
|||||||
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
|
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
|
||||||
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
|
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
|
||||||
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
|
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
|
||||||
github.com/agiledragon/gomonkey/v2 v2.9.0 h1:PDiKKybR596O6FHW+RVSG0Z7uGCBNbmbUXh3uCNQ7Hc=
|
github.com/agiledragon/gomonkey/v2 v2.11.0 h1:5oxSgA+tC1xuGsrIorR+sYiziYltmJyEZ9qA25b6l5U=
|
||||||
github.com/agiledragon/gomonkey/v2 v2.9.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
|
github.com/agiledragon/gomonkey/v2 v2.11.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
|
||||||
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0=
|
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0=
|
||||||
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0/go.mod h1:TdjdkYhlOifCQWPs1UdTma97kQQMozf5h26hTuG70u8=
|
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0/go.mod h1:TdjdkYhlOifCQWPs1UdTma97kQQMozf5h26hTuG70u8=
|
||||||
github.com/alecthomas/jsonschema v0.0.0-20180308105923-f2c93856175a/go.mod h1:qpebaTNSsyUn5rPSJMsfqEtDw71TTggXM6stUDI16HA=
|
github.com/alecthomas/jsonschema v0.0.0-20180308105923-f2c93856175a/go.mod h1:qpebaTNSsyUn5rPSJMsfqEtDw71TTggXM6stUDI16HA=
|
||||||
@@ -1582,6 +1582,12 @@ github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIU
|
|||||||
github.com/theupdateframework/notary v0.6.1/go.mod h1:MOfgIfmox8s7/7fduvB2xyPPMJCrjRLRizA8OFwpnKY=
|
github.com/theupdateframework/notary v0.6.1/go.mod h1:MOfgIfmox8s7/7fduvB2xyPPMJCrjRLRizA8OFwpnKY=
|
||||||
github.com/theupdateframework/notary v0.7.0 h1:QyagRZ7wlSpjT5N2qQAh/pN+DVqgekv4DzbAiAiEL3c=
|
github.com/theupdateframework/notary v0.7.0 h1:QyagRZ7wlSpjT5N2qQAh/pN+DVqgekv4DzbAiAiEL3c=
|
||||||
github.com/theupdateframework/notary v0.7.0/go.mod h1:c9DRxcmhHmVLDay4/2fUYdISnHqbFDGRSlXPO0AhYWw=
|
github.com/theupdateframework/notary v0.7.0/go.mod h1:c9DRxcmhHmVLDay4/2fUYdISnHqbFDGRSlXPO0AhYWw=
|
||||||
|
github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM=
|
||||||
|
github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||||
|
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
||||||
|
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||||
|
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
|
||||||
|
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
appVersion: 1.3.0
|
appVersion: 1.3.4
|
||||||
description: Helm chart for deploying higress gateways
|
description: Helm chart for deploying higress gateways
|
||||||
icon: https://higress.io/img/higress_logo_small.png
|
icon: https://higress.io/img/higress_logo_small.png
|
||||||
home: http://higress.io/
|
home: http://higress.io/
|
||||||
@@ -10,4 +10,4 @@ name: higress-core
|
|||||||
sources:
|
sources:
|
||||||
- http://github.com/alibaba/higress
|
- http://github.com/alibaba/higress
|
||||||
type: application
|
type: application
|
||||||
version: 1.3.0
|
version: 1.3.4
|
||||||
|
|||||||
@@ -154,6 +154,11 @@ spec:
|
|||||||
type: array
|
type: array
|
||||||
httpPath:
|
httpPath:
|
||||||
type: string
|
type: string
|
||||||
|
paramFromEntireBody:
|
||||||
|
properties:
|
||||||
|
paramType:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
params:
|
params:
|
||||||
items:
|
items:
|
||||||
properties:
|
properties:
|
||||||
|
|||||||
@@ -31,11 +31,7 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
{{- if not .Values.global.enableHigressIstio }}
|
{{- if not .Values.global.enableHigressIstio }}
|
||||||
- name: discovery
|
- name: discovery
|
||||||
{{- if contains "/" .Values.pilot.image }}
|
|
||||||
image: "{{ .Values.pilot.image }}"
|
|
||||||
{{- else }}
|
|
||||||
image: "{{ .Values.pilot.hub | default .Values.global.hub }}/{{ .Values.pilot.image | default "pilot" }}:{{ .Values.pilot.tag | default .Chart.AppVersion }}"
|
image: "{{ .Values.pilot.hub | default .Values.global.hub }}/{{ .Values.pilot.image | default "pilot" }}:{{ .Values.pilot.tag | default .Chart.AppVersion }}"
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.global.imagePullPolicy }}
|
{{- if .Values.global.imagePullPolicy }}
|
||||||
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
|
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -74,8 +70,18 @@ spec:
|
|||||||
periodSeconds: 3
|
periodSeconds: 3
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
env:
|
env:
|
||||||
|
- name: DEFAULT_UPSTREAM_CONCURRENCY_THRESHOLD
|
||||||
|
value: "{{ .Values.global.defaultUpstreamConcurrencyThreshold }}"
|
||||||
|
- name: ISTIO_GPRC_MAXRECVMSGSIZE
|
||||||
|
value: "{{ .Values.global.xdsMaxRecvMsgSize }}"
|
||||||
|
- name: ENBALE_SCOPED_RDS
|
||||||
|
value: "{{ .Values.global.enableSRDS }}"
|
||||||
|
- name: ON_DEMAND_RDS
|
||||||
|
value: "{{ .Values.global.onDemandRDS }}"
|
||||||
|
- name: HOST_RDS_MERGE_SUBSET
|
||||||
|
value: "{{ .Values.global.hostRDSMergeSubset }}"
|
||||||
- name: PILOT_FILTER_GATEWAY_CLUSTER_CONFIG
|
- name: PILOT_FILTER_GATEWAY_CLUSTER_CONFIG
|
||||||
value: "true"
|
value: "{{ .Values.global.onlyPushRouteCluster }}"
|
||||||
- name: HIGRESS_CONTROLLER_SVC
|
- name: HIGRESS_CONTROLLER_SVC
|
||||||
value: "127.0.0.1"
|
value: "127.0.0.1"
|
||||||
- name: HIGRESS_CONTROLLER_PORT
|
- name: HIGRESS_CONTROLLER_PORT
|
||||||
@@ -184,7 +190,7 @@ spec:
|
|||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.controller.securityContext | nindent 12 }}
|
{{- toYaml .Values.controller.securityContext | nindent 12 }}
|
||||||
image: "{{ .Values.hub }}/{{ .Values.controller.image }}:{{ .Values.controller.tag | default .Chart.AppVersion }}"
|
image: "{{ .Values.controller.hub | default .Values.global.hub }}/{{ .Values.controller.image | default "higress" }}:{{ .Values.controller.tag | default .Chart.AppVersion }}"
|
||||||
args:
|
args:
|
||||||
- "serve"
|
- "serve"
|
||||||
- --gatewaySelectorKey=higress
|
- --gatewaySelectorKey=higress
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: higress-gateway
|
- name: higress-gateway
|
||||||
image: "{{ .Values.hub }}/{{ .Values.gateway.image }}:{{ .Values.gateway.tag | default .Chart.AppVersion }}"
|
image: "{{ .Values.gateway.hub | default .Values.global.hub }}/{{ .Values.gateway.image | default "gateway" }}:{{ .Values.gateway.tag | default .Chart.AppVersion }}"
|
||||||
args:
|
args:
|
||||||
- proxy
|
- proxy
|
||||||
- router
|
- router
|
||||||
@@ -134,6 +134,8 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: spec.serviceAccountName
|
fieldPath: spec.serviceAccountName
|
||||||
|
- name: PILOT_XDS_SEND_TIMEOUT
|
||||||
|
value: 60s
|
||||||
- name: PROXY_XDS_VIA_AGENT
|
- name: PROXY_XDS_VIA_AGENT
|
||||||
value: "true"
|
value: "true"
|
||||||
- name: ENABLE_INGRESS_GATEWAY_SDS
|
- name: ENABLE_INGRESS_GATEWAY_SDS
|
||||||
@@ -173,15 +175,15 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
{{- end }}
|
{{- end }}
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
failureThreshold: 30
|
failureThreshold: {{ .Values.gateway.readinessFailureThreshold }}
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz/ready
|
path: /healthz/ready
|
||||||
port: 15021
|
port: 15021
|
||||||
scheme: HTTP
|
scheme: HTTP
|
||||||
initialDelaySeconds: 1
|
initialDelaySeconds: {{ .Values.gateway.readinessInitialDelaySeconds }}
|
||||||
periodSeconds: 2
|
periodSeconds: {{ .Values.gateway.readinessPeriodSeconds }}
|
||||||
successThreshold: 1
|
successThreshold: {{ .Values.gateway.readinessSuccessThreshold }}
|
||||||
timeoutSeconds: 3
|
timeoutSeconds: {{ .Values.gateway.readinessTimeoutSeconds }}
|
||||||
{{- if not (or .Values.global.local .Values.global.kind) }}
|
{{- if not (or .Values.global.local .Values.global.kind) }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.gateway.resources | nindent 12 }}
|
{{- toYaml .Values.gateway.resources | nindent 12 }}
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
revision: ""
|
revision: ""
|
||||||
global:
|
global:
|
||||||
|
xdsMaxRecvMsgSize: 104857600
|
||||||
|
defaultUpstreamConcurrencyThreshold: 10000
|
||||||
|
enableSRDS: true
|
||||||
|
onDemandRDS: false
|
||||||
|
hostRDSMergeSubset: false
|
||||||
|
onlyPushRouteCluster: true
|
||||||
# IngressClass filters which ingress resources the higress controller watches.
|
# IngressClass filters which ingress resources the higress controller watches.
|
||||||
# The default ingress class is higress.
|
# The default ingress class is higress.
|
||||||
# There are some special cases for special ingress class.
|
# There are some special cases for special ingress class.
|
||||||
@@ -9,7 +15,7 @@ global:
|
|||||||
# resources in the k8s cluster.
|
# resources in the k8s cluster.
|
||||||
ingressClass: "higress"
|
ingressClass: "higress"
|
||||||
watchNamespace: ""
|
watchNamespace: ""
|
||||||
disableAlpnH2: true
|
disableAlpnH2: false
|
||||||
enableStatus: true
|
enableStatus: true
|
||||||
# whether to use autoscaling/v2 template for HPA settings
|
# whether to use autoscaling/v2 template for HPA settings
|
||||||
# for internal usage only, not to be configured by users.
|
# for internal usage only, not to be configured by users.
|
||||||
@@ -147,12 +153,18 @@ global:
|
|||||||
# The number of successive failed probes before indicating readiness failure.
|
# The number of successive failed probes before indicating readiness failure.
|
||||||
readinessFailureThreshold: 30
|
readinessFailureThreshold: 30
|
||||||
|
|
||||||
|
# The number of successive successed probes before indicating readiness success.
|
||||||
|
readinessSuccessThreshold: 30
|
||||||
|
|
||||||
# The initial delay for readiness probes in seconds.
|
# The initial delay for readiness probes in seconds.
|
||||||
readinessInitialDelaySeconds: 1
|
readinessInitialDelaySeconds: 1
|
||||||
|
|
||||||
# The period between readiness probes.
|
# The period between readiness probes.
|
||||||
readinessPeriodSeconds: 2
|
readinessPeriodSeconds: 2
|
||||||
|
|
||||||
|
# The readiness timeout seconds
|
||||||
|
readinessTimeoutSeconds: 3
|
||||||
|
|
||||||
# Resources for the sidecar.
|
# Resources for the sidecar.
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
@@ -368,6 +380,23 @@ gateway:
|
|||||||
name: "higress-gateway"
|
name: "higress-gateway"
|
||||||
replicas: 2
|
replicas: 2
|
||||||
image: gateway
|
image: gateway
|
||||||
|
|
||||||
|
# The number of successive failed probes before indicating readiness failure.
|
||||||
|
readinessFailureThreshold: 30
|
||||||
|
|
||||||
|
# The number of successive successed probes before indicating readiness success.
|
||||||
|
readinessSuccessThreshold: 1
|
||||||
|
|
||||||
|
# The initial delay for readiness probes in seconds.
|
||||||
|
readinessInitialDelaySeconds: 1
|
||||||
|
|
||||||
|
# The period between readiness probes.
|
||||||
|
readinessPeriodSeconds: 2
|
||||||
|
|
||||||
|
# The readiness timeout seconds
|
||||||
|
readinessTimeoutSeconds: 3
|
||||||
|
|
||||||
|
hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress
|
||||||
tag: ""
|
tag: ""
|
||||||
# revision declares which revision this gateway is a part of
|
# revision declares which revision this gateway is a part of
|
||||||
revision: ""
|
revision: ""
|
||||||
@@ -456,6 +485,8 @@ controller:
|
|||||||
name: "higress-controller"
|
name: "higress-controller"
|
||||||
replicas: 1
|
replicas: 1
|
||||||
image: higress
|
image: higress
|
||||||
|
|
||||||
|
hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress
|
||||||
tag: ""
|
tag: ""
|
||||||
env: {}
|
env: {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: higress-core
|
- name: higress-core
|
||||||
repository: file://../core
|
repository: file://../core
|
||||||
version: 1.3.0
|
version: 1.3.4
|
||||||
- name: higress-console
|
- name: higress-console
|
||||||
repository: https://higress.io/helm-charts/
|
repository: https://higress.io/helm-charts/
|
||||||
version: 1.3.0
|
version: 1.3.2
|
||||||
digest: sha256:3efc59ad8cd92ab4c3c87abeed8e2fc0288bb3ecc2805888ba6eaaf265ba6a10
|
digest: sha256:1a5849d5ead79151e42ce419a96669f6691567e6fbf155643a928e6b62c3daa1
|
||||||
generated: "2023-11-02T11:45:56.011629+08:00"
|
generated: "2024-02-20T11:54:00.898489+08:00"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
appVersion: 1.3.0
|
appVersion: 1.3.4
|
||||||
description: Helm chart for deploying Higress gateways
|
description: Helm chart for deploying Higress gateways
|
||||||
icon: https://higress.io/img/higress_logo_small.png
|
icon: https://higress.io/img/higress_logo_small.png
|
||||||
home: http://higress.io/
|
home: http://higress.io/
|
||||||
@@ -12,9 +12,9 @@ sources:
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: higress-core
|
- name: higress-core
|
||||||
repository: "file://../core"
|
repository: "file://../core"
|
||||||
version: 1.3.0
|
version: 1.3.4
|
||||||
- name: higress-console
|
- name: higress-console
|
||||||
repository: "https://higress.io/helm-charts/"
|
repository: "https://higress.io/helm-charts/"
|
||||||
version: 1.3.0
|
version: 1.3.2
|
||||||
type: application
|
type: application
|
||||||
version: 1.3.0
|
version: 1.3.4
|
||||||
|
|||||||
62
istio/1.12/patches/istio/20231115-optimize-xds-push.patch
Normal file
62
istio/1.12/patches/istio/20231115-optimize-xds-push.patch
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
diff -Naur istio/pilot/pkg/xds/ads.go istio-new/pilot/pkg/xds/ads.go
|
||||||
|
--- istio/pilot/pkg/xds/ads.go 2023-11-15 20:25:18.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/xds/ads.go 2023-11-15 20:24:20.000000000 +0800
|
||||||
|
@@ -318,6 +318,27 @@
|
||||||
|
<-con.initialized
|
||||||
|
|
||||||
|
for {
|
||||||
|
+ // Go select{} statements are not ordered; the same channel can be chosen many times.
|
||||||
|
+ // For requests, these are higher priority (client may be blocked on startup until these are done)
|
||||||
|
+ // and often very cheap to handle (simple ACK), so we check it first.
|
||||||
|
+ select {
|
||||||
|
+ case req, ok := <-con.reqChan:
|
||||||
|
+ if ok {
|
||||||
|
+ if err := s.processRequest(req, con); err != nil {
|
||||||
|
+ return err
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ // Remote side closed connection or error processing the request.
|
||||||
|
+ return <-con.errorChan
|
||||||
|
+ }
|
||||||
|
+ case <-con.stop:
|
||||||
|
+ return nil
|
||||||
|
+ default:
|
||||||
|
+ }
|
||||||
|
+ // If there wasn't already a request, poll for requests and pushes. Note: if we have a huge
|
||||||
|
+ // amount of incoming requests, we may still send some pushes, as we do not `continue` above;
|
||||||
|
+ // however, requests will be handled ~2x as much as pushes. This ensures a wave of requests
|
||||||
|
+ // cannot completely starve pushes. However, this scenario is unlikely.
|
||||||
|
select {
|
||||||
|
case req, ok := <-con.reqChan:
|
||||||
|
if ok {
|
||||||
|
diff -Naur istio/pilot/pkg/xds/delta.go istio-new/pilot/pkg/xds/delta.go
|
||||||
|
--- istio/pilot/pkg/xds/delta.go 2023-11-15 20:25:18.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/xds/delta.go 2023-11-15 20:24:44.000000000 +0800
|
||||||
|
@@ -102,6 +102,27 @@
|
||||||
|
<-con.initialized
|
||||||
|
|
||||||
|
for {
|
||||||
|
+ // Go select{} statements are not ordered; the same channel can be chosen many times.
|
||||||
|
+ // For requests, these are higher priority (client may be blocked on startup until these are done)
|
||||||
|
+ // and often very cheap to handle (simple ACK), so we check it first.
|
||||||
|
+ select {
|
||||||
|
+ case req, ok := <-con.deltaReqChan:
|
||||||
|
+ if ok {
|
||||||
|
+ if err := s.processDeltaRequest(req, con); err != nil {
|
||||||
|
+ return err
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ // Remote side closed connection or error processing the request.
|
||||||
|
+ return <-con.errorChan
|
||||||
|
+ }
|
||||||
|
+ case <-con.stop:
|
||||||
|
+ return nil
|
||||||
|
+ default:
|
||||||
|
+ }
|
||||||
|
+ // If there wasn't already a request, poll for requests and pushes. Note: if we have a huge
|
||||||
|
+ // amount of incoming requests, we may still send some pushes, as we do not `continue` above;
|
||||||
|
+ // however, requests will be handled ~2x as much as pushes. This ensures a wave of requests
|
||||||
|
+ // cannot completely starve pushes. However, this scenario is unlikely.
|
||||||
|
select {
|
||||||
|
case req, ok := <-con.deltaReqChan:
|
||||||
|
if ok {
|
||||||
633
istio/1.12/patches/istio/20240104-enhance-srds.patch
Normal file
633
istio/1.12/patches/istio/20240104-enhance-srds.patch
Normal file
@@ -0,0 +1,633 @@
|
|||||||
|
diff -Naur istio/pilot/pkg/features/pilot.go istio-new/pilot/pkg/features/pilot.go
|
||||||
|
--- istio/pilot/pkg/features/pilot.go 2024-01-05 17:58:08.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/features/pilot.go 2024-01-04 21:20:00.000000000 +0800
|
||||||
|
@@ -569,6 +569,12 @@
|
||||||
|
// Added by ingress
|
||||||
|
CustomCACertConfigMapName = env.RegisterStringVar("CUSTOM_CA_CERT_NAME", "",
|
||||||
|
"Defines the configmap's name of istio's root ca certificate").Get()
|
||||||
|
+ HostRDSMergeSubset = env.RegisterBoolVar("HOST_RDS_MERGE_SUBSET", true,
|
||||||
|
+ "If enabled, if host A is a subset of B, then we merge B's routes into A's hostRDS").Get()
|
||||||
|
+ EnableScopedRDS = env.RegisterBoolVar("ENBALE_SCOPED_RDS", true,
|
||||||
|
+ "If enabled, each host in virtualservice will have an independent RDS, which is used with SRDS").Get()
|
||||||
|
+ OnDemandRDS = env.RegisterBoolVar("ON_DEMAND_RDS", false,
|
||||||
|
+ "If enabled, the on demand filter will be added to the HCM filters").Get()
|
||||||
|
// End added by ingress
|
||||||
|
)
|
||||||
|
|
||||||
|
diff -Naur istio/pilot/pkg/networking/core/configgen.go istio-new/pilot/pkg/networking/core/configgen.go
|
||||||
|
--- istio/pilot/pkg/networking/core/configgen.go 2024-01-05 17:58:02.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/networking/core/configgen.go 2024-01-04 21:20:00.000000000 +0800
|
||||||
|
@@ -17,6 +17,7 @@
|
||||||
|
import (
|
||||||
|
core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
|
||||||
|
listener "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3"
|
||||||
|
+ route "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
|
||||||
|
discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
|
||||||
|
|
||||||
|
meshconfig "istio.io/api/mesh/v1alpha1"
|
||||||
|
@@ -44,6 +45,10 @@
|
||||||
|
// BuildHTTPRoutes returns the list of HTTP routes for the given proxy. This is the RDS output
|
||||||
|
BuildHTTPRoutes(node *model.Proxy, req *model.PushRequest, routeNames []string) ([]*discovery.Resource, model.XdsLogDetails)
|
||||||
|
|
||||||
|
+ // Added by ingress
|
||||||
|
+ BuildScopedRoutes(node *model.Proxy, push *model.PushContext) []*route.ScopedRouteConfiguration
|
||||||
|
+ // End added by ingress
|
||||||
|
+
|
||||||
|
// BuildNameTable returns list of hostnames and the associated IPs
|
||||||
|
BuildNameTable(node *model.Proxy, push *model.PushContext) *dnsProto.NameTable
|
||||||
|
|
||||||
|
diff -Naur istio/pilot/pkg/networking/core/v1alpha3/gateway.go istio-new/pilot/pkg/networking/core/v1alpha3/gateway.go
|
||||||
|
--- istio/pilot/pkg/networking/core/v1alpha3/gateway.go 2024-01-05 17:58:07.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/networking/core/v1alpha3/gateway.go 2024-01-05 11:19:54.000000000 +0800
|
||||||
|
@@ -41,7 +41,9 @@
|
||||||
|
"istio.io/istio/pilot/pkg/networking/plugin"
|
||||||
|
"istio.io/istio/pilot/pkg/networking/util"
|
||||||
|
authn_model "istio.io/istio/pilot/pkg/security/model"
|
||||||
|
+ "istio.io/istio/pilot/pkg/util/sets"
|
||||||
|
"istio.io/istio/pkg/config"
|
||||||
|
+ "istio.io/istio/pkg/config/constants"
|
||||||
|
"istio.io/istio/pkg/config/gateway"
|
||||||
|
"istio.io/istio/pkg/config/host"
|
||||||
|
"istio.io/istio/pkg/config/protocol"
|
||||||
|
@@ -104,10 +106,15 @@
|
||||||
|
// We can also have QUIC on a given port along with HTTPS/TLS on a given port. It does not
|
||||||
|
// cause port-conflict as they use different transport protocols
|
||||||
|
opts := &buildListenerOpts{
|
||||||
|
- push: builder.push,
|
||||||
|
- proxy: builder.node,
|
||||||
|
- bind: bind,
|
||||||
|
- port: &model.Port{Port: int(port.Number)},
|
||||||
|
+ push: builder.push,
|
||||||
|
+ proxy: builder.node,
|
||||||
|
+ bind: bind,
|
||||||
|
+ port: &model.Port{
|
||||||
|
+ Port: int(port.Number),
|
||||||
|
+ // Added by ingress
|
||||||
|
+ Protocol: protocol.Parse(port.Protocol),
|
||||||
|
+ // End added by ingress
|
||||||
|
+ },
|
||||||
|
bindToPort: true,
|
||||||
|
class: istionetworking.ListenerClassGateway,
|
||||||
|
transport: transport,
|
||||||
|
@@ -340,6 +347,269 @@
|
||||||
|
return nameToServiceMap
|
||||||
|
}
|
||||||
|
|
||||||
|
+// Added by ingress
|
||||||
|
+func (configgen *ConfigGeneratorImpl) BuildScopedRoutes(node *model.Proxy, push *model.PushContext) []*route.ScopedRouteConfiguration {
|
||||||
|
+ if node.MergedGateway == nil {
|
||||||
|
+ log.Warnf("buildScopedRoutes: no gateways for router %v", node.ID)
|
||||||
|
+ return nil
|
||||||
|
+ }
|
||||||
|
+ merged := node.MergedGateway
|
||||||
|
+ var out []*route.ScopedRouteConfiguration
|
||||||
|
+ gatewayVirtualServices := make(map[string][]config.Config)
|
||||||
|
+ serverIterator := func(listenerPort int, mergedServers map[model.ServerPort]*model.MergedServers) sets.Set {
|
||||||
|
+ hostSet := sets.NewSet()
|
||||||
|
+ for port, servers := range mergedServers {
|
||||||
|
+ if port.Number != uint32(listenerPort) {
|
||||||
|
+ continue
|
||||||
|
+ }
|
||||||
|
+ for _, server := range servers.Servers {
|
||||||
|
+ gatewayName := merged.GatewayNameForServer[server]
|
||||||
|
+
|
||||||
|
+ var virtualServices []config.Config
|
||||||
|
+ var exists bool
|
||||||
|
+
|
||||||
|
+ if virtualServices, exists = gatewayVirtualServices[gatewayName]; !exists {
|
||||||
|
+ virtualServices = push.VirtualServicesForGateway(node, gatewayName)
|
||||||
|
+ gatewayVirtualServices[gatewayName] = virtualServices
|
||||||
|
+ }
|
||||||
|
+ for _, virtualService := range virtualServices {
|
||||||
|
+ for _, host := range virtualService.Spec.(*networking.VirtualService).Hosts {
|
||||||
|
+ hostSet.Insert(host)
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ return hostSet
|
||||||
|
+ }
|
||||||
|
+ buildPortHostScopedRoute := func(listenerPort model.ServerPort) {
|
||||||
|
+ p := protocol.Parse(listenerPort.Protocol)
|
||||||
|
+ if !p.IsHTTP() && p != protocol.HTTPS {
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+ port := strconv.Itoa(int(listenerPort.Number))
|
||||||
|
+ hostSet := serverIterator(int(listenerPort.Number), merged.MergedServers).
|
||||||
|
+ Union(serverIterator(int(listenerPort.Number), merged.MergedQUICTransportServers))
|
||||||
|
+ for host, _ := range hostSet {
|
||||||
|
+ portKey := &route.ScopedRouteConfiguration_Key_Fragment{
|
||||||
|
+ Type: &route.ScopedRouteConfiguration_Key_Fragment_StringKey{
|
||||||
|
+ StringKey: port,
|
||||||
|
+ },
|
||||||
|
+ }
|
||||||
|
+ hostKey := &route.ScopedRouteConfiguration_Key_Fragment{
|
||||||
|
+ Type: &route.ScopedRouteConfiguration_Key_Fragment_StringKey{
|
||||||
|
+ StringKey: host,
|
||||||
|
+ },
|
||||||
|
+ }
|
||||||
|
+ name := strings.Join([]string{port, host}, ".")
|
||||||
|
+ out = append(out, &route.ScopedRouteConfiguration{
|
||||||
|
+ OnDemand: features.OnDemandRDS,
|
||||||
|
+ Name: name,
|
||||||
|
+ RouteConfigurationName: constants.HigressHostRDSNamePrefix + name,
|
||||||
|
+ Key: &route.ScopedRouteConfiguration_Key{
|
||||||
|
+ Fragments: []*route.ScopedRouteConfiguration_Key_Fragment{portKey, hostKey},
|
||||||
|
+ },
|
||||||
|
+ })
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ for _, port := range merged.ServerPorts {
|
||||||
|
+ buildPortHostScopedRoute(port)
|
||||||
|
+ }
|
||||||
|
+ return out
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+type virtualServiceContext struct {
|
||||||
|
+ virtualService config.Config
|
||||||
|
+ server *networking.Server
|
||||||
|
+ gatewayName string
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+func (configgen *ConfigGeneratorImpl) buildHostRDSConfig(node *model.Proxy, push *model.PushContext,
|
||||||
|
+ routeName string) *route.RouteConfiguration {
|
||||||
|
+ var (
|
||||||
|
+ hostRDSPort string
|
||||||
|
+ hostRDSHost string
|
||||||
|
+ )
|
||||||
|
+ portAndHost := strings.SplitN(strings.TrimPrefix(routeName, constants.HigressHostRDSNamePrefix), ".", 2)
|
||||||
|
+ if len(portAndHost) != 2 {
|
||||||
|
+ log.Errorf("Invalid route %s when using Higress hostRDS", routeName)
|
||||||
|
+ return nil
|
||||||
|
+ }
|
||||||
|
+ hostRDSPort = portAndHost[0]
|
||||||
|
+ hostRDSHost = portAndHost[1]
|
||||||
|
+ merged := node.MergedGateway
|
||||||
|
+ log.Debugf("buildGatewayRoutes: gateways after merging: %v", merged)
|
||||||
|
+ rdsPort, err := strconv.Atoi(hostRDSPort)
|
||||||
|
+ if err != nil {
|
||||||
|
+ log.Errorf("Invalid port %s of route %s when using Higress hostRDS", hostRDSPort, routeName)
|
||||||
|
+ return nil
|
||||||
|
+ }
|
||||||
|
+ listenerPort := uint32(rdsPort)
|
||||||
|
+ globalHTTPFilters := mseingress.ExtractGlobalHTTPFilters(node, push)
|
||||||
|
+
|
||||||
|
+ isH3DiscoveryNeeded := false
|
||||||
|
+
|
||||||
|
+ // When this is true, we add alt-svc header to the response to tell the client
|
||||||
|
+ // that HTTP/3 over QUIC is available on the same port for this host. This is
|
||||||
|
+ // very important for discovering HTTP/3 services
|
||||||
|
+ for port, servers := range merged.MergedQUICTransportServers {
|
||||||
|
+ if port.Number == listenerPort && len(servers.Servers) > 0 {
|
||||||
|
+ isH3DiscoveryNeeded = true
|
||||||
|
+ break
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ gatewayRoutes := make(map[string]map[string][]*route.Route)
|
||||||
|
+ gatewayVirtualServices := make(map[string][]config.Config)
|
||||||
|
+ var selectedVirtualServices []virtualServiceContext
|
||||||
|
+ var vHost *route.VirtualHost
|
||||||
|
+ serverIterator := func(mergedServers map[model.ServerPort]*model.MergedServers) {
|
||||||
|
+ for port, servers := range mergedServers {
|
||||||
|
+ if port.Number != listenerPort {
|
||||||
|
+ continue
|
||||||
|
+ }
|
||||||
|
+ for _, server := range servers.Servers {
|
||||||
|
+ gatewayName := merged.GatewayNameForServer[server]
|
||||||
|
+
|
||||||
|
+ var virtualServices []config.Config
|
||||||
|
+ var exists bool
|
||||||
|
+
|
||||||
|
+ if virtualServices, exists = gatewayVirtualServices[gatewayName]; !exists {
|
||||||
|
+ virtualServices = push.VirtualServicesForGateway(node, gatewayName)
|
||||||
|
+ gatewayVirtualServices[gatewayName] = virtualServices
|
||||||
|
+ }
|
||||||
|
+ for _, virtualService := range virtualServices {
|
||||||
|
+ hostMatch := false
|
||||||
|
+ var selectHost string
|
||||||
|
+ virtualServiceHosts := host.NewNames(virtualService.Spec.(*networking.VirtualService).Hosts)
|
||||||
|
+ for _, hostname := range virtualServiceHosts {
|
||||||
|
+ // exact match
|
||||||
|
+ if hostname == host.Name(hostRDSHost) {
|
||||||
|
+ hostMatch = true
|
||||||
|
+ selectHost = hostRDSHost
|
||||||
|
+ break
|
||||||
|
+ }
|
||||||
|
+ if features.HostRDSMergeSubset {
|
||||||
|
+ // subset match
|
||||||
|
+ if host.Name(hostRDSHost).SubsetOf(hostname) {
|
||||||
|
+ hostMatch = true
|
||||||
|
+ selectHost = string(hostname)
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if !hostMatch {
|
||||||
|
+ continue
|
||||||
|
+ }
|
||||||
|
+ copiedVS := virtualService.DeepCopy()
|
||||||
|
+ copiedVS.Spec.(*networking.VirtualService).Hosts = []string{selectHost}
|
||||||
|
+ selectedVirtualServices = append(selectedVirtualServices, virtualServiceContext{
|
||||||
|
+ virtualService: copiedVS,
|
||||||
|
+ server: server,
|
||||||
|
+ gatewayName: gatewayName,
|
||||||
|
+ })
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ serverIterator(merged.MergedServers)
|
||||||
|
+ serverIterator(merged.MergedQUICTransportServers)
|
||||||
|
+ // Sort by subset
|
||||||
|
+ // before: ["*.abc.com", "*.com", "www.abc.com"]
|
||||||
|
+ // after: ["www.abc.com", "*.abc.com", "*.com"]
|
||||||
|
+ sort.SliceStable(selectedVirtualServices, func(i, j int) bool {
|
||||||
|
+ return host.Name(selectedVirtualServices[i].virtualService.Spec.(*networking.VirtualService).Hosts[0]).SubsetOf(
|
||||||
|
+ host.Name(selectedVirtualServices[j].virtualService.Spec.(*networking.VirtualService).Hosts[0]))
|
||||||
|
+ })
|
||||||
|
+ port := int(listenerPort)
|
||||||
|
+ for _, ctx := range selectedVirtualServices {
|
||||||
|
+ virtualService := ctx.virtualService
|
||||||
|
+ server := ctx.server
|
||||||
|
+ gatewayName := ctx.gatewayName
|
||||||
|
+ // Make sure we can obtain services which are visible to this virtualService as much as possible.
|
||||||
|
+ nameToServiceMap := buildNameToServiceMapForHTTPRoutes(node, push, virtualService)
|
||||||
|
+
|
||||||
|
+ var routes []*route.Route
|
||||||
|
+ var exists bool
|
||||||
|
+ var err error
|
||||||
|
+ if _, exists = gatewayRoutes[gatewayName]; !exists {
|
||||||
|
+ gatewayRoutes[gatewayName] = make(map[string][]*route.Route)
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ vskey := virtualService.Name + "/" + virtualService.Namespace
|
||||||
|
+
|
||||||
|
+ if routes, exists = gatewayRoutes[gatewayName][vskey]; !exists {
|
||||||
|
+ hashByDestination := istio_route.GetConsistentHashForVirtualService(push, node, virtualService, nameToServiceMap)
|
||||||
|
+ routes, err = istio_route.BuildHTTPRoutesForVirtualServiceWithHTTPFilters(node, virtualService, nameToServiceMap,
|
||||||
|
+ hashByDestination, port, map[string]bool{gatewayName: true}, isH3DiscoveryNeeded, push.Mesh, globalHTTPFilters)
|
||||||
|
+ if err != nil {
|
||||||
|
+ log.Debugf("%s omitting routes for virtual service %v/%v due to error: %v", node.ID, virtualService.Namespace, virtualService.Name, err)
|
||||||
|
+ continue
|
||||||
|
+ }
|
||||||
|
+ gatewayRoutes[gatewayName][vskey] = routes
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if vHost != nil {
|
||||||
|
+ vHost.Routes = append(vHost.Routes, routes...)
|
||||||
|
+ if server.Tls != nil && server.Tls.HttpsRedirect {
|
||||||
|
+ vHost.RequireTls = route.VirtualHost_ALL
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ vHost = &route.VirtualHost{
|
||||||
|
+ Name: util.DomainName(hostRDSHost, port),
|
||||||
|
+ Domains: buildGatewayVirtualHostDomains(hostRDSHost, port),
|
||||||
|
+ Routes: routes,
|
||||||
|
+ IncludeRequestAttemptCount: true,
|
||||||
|
+ TypedPerFilterConfig: mseingress.ConstructTypedPerFilterConfigForVHost(globalHTTPFilters, virtualService),
|
||||||
|
+ }
|
||||||
|
+ if server.Tls != nil && server.Tls.HttpsRedirect {
|
||||||
|
+ vHost.RequireTls = route.VirtualHost_ALL
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // check all hostname if is not exist with HttpsRedirect set to true
|
||||||
|
+ // create VirtualHost to redirect
|
||||||
|
+ for _, hostname := range server.Hosts {
|
||||||
|
+ if !server.GetTls().GetHttpsRedirect() {
|
||||||
|
+ continue
|
||||||
|
+ }
|
||||||
|
+ if vHost != nil && host.Name(hostname) == host.Name(hostRDSHost) {
|
||||||
|
+ vHost.RequireTls = route.VirtualHost_ALL
|
||||||
|
+ continue
|
||||||
|
+ }
|
||||||
|
+ vHost = &route.VirtualHost{
|
||||||
|
+ Name: util.DomainName(hostname, port),
|
||||||
|
+ Domains: buildGatewayVirtualHostDomains(hostname, port),
|
||||||
|
+ IncludeRequestAttemptCount: true,
|
||||||
|
+ RequireTls: route.VirtualHost_ALL,
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+ var virtualHosts []*route.VirtualHost
|
||||||
|
+ if vHost == nil {
|
||||||
|
+ log.Warnf("constructed http route config for route %s on port %d with no vhosts; Setting up a default 404 vhost", routeName, port)
|
||||||
|
+ virtualHosts = []*route.VirtualHost{{
|
||||||
|
+ Name: util.DomainName("blackhole", port),
|
||||||
|
+ Domains: []string{"*"},
|
||||||
|
+ // Empty route list will cause Envoy to 404 NR any requests
|
||||||
|
+ Routes: []*route.Route{},
|
||||||
|
+ }}
|
||||||
|
+ } else {
|
||||||
|
+ vHost.Routes = istio_route.CombineVHostRoutes(vHost.Routes)
|
||||||
|
+ virtualHosts = append(virtualHosts, vHost)
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ routeCfg := &route.RouteConfiguration{
|
||||||
|
+ // Retain the routeName as its used by EnvoyFilter patching logic
|
||||||
|
+ Name: routeName,
|
||||||
|
+ VirtualHosts: virtualHosts,
|
||||||
|
+ ValidateClusters: proto.BoolFalse,
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return routeCfg
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// End added by ingress
|
||||||
|
+
|
||||||
|
func (configgen *ConfigGeneratorImpl) buildGatewayHTTPRouteConfig(node *model.Proxy, push *model.PushContext,
|
||||||
|
routeName string) *route.RouteConfiguration {
|
||||||
|
if node.MergedGateway == nil {
|
||||||
|
@@ -351,6 +621,12 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Added by ingress
|
||||||
|
+ if strings.HasPrefix(routeName, constants.HigressHostRDSNamePrefix) {
|
||||||
|
+ return configgen.buildHostRDSConfig(node, push, routeName)
|
||||||
|
+ }
|
||||||
|
+ // End added by ingress
|
||||||
|
+
|
||||||
|
merged := node.MergedGateway
|
||||||
|
log.Debugf("buildGatewayRoutes: gateways after merging: %v", merged)
|
||||||
|
|
||||||
|
@@ -670,7 +946,9 @@
|
||||||
|
// TLS mode | Mesh-wide SDS | Ingress SDS | Resulting Configuration
|
||||||
|
// SIMPLE/MUTUAL | ENABLED | ENABLED | support SDS at ingress gateway to terminate SSL communication outside the mesh
|
||||||
|
// ISTIO_MUTUAL | ENABLED | DISABLED | support SDS at gateway to terminate workload mTLS, with internal workloads
|
||||||
|
-// | for egress or with another trusted cluster for ingress)
|
||||||
|
+//
|
||||||
|
+// | for egress or with another trusted cluster for ingress)
|
||||||
|
+//
|
||||||
|
// ISTIO_MUTUAL | DISABLED | DISABLED | use file-mounted secret paths to terminate workload mTLS from gateway
|
||||||
|
//
|
||||||
|
// Note that ISTIO_MUTUAL TLS mode and ingressSds should not be used simultaneously on the same ingress gateway.
|
||||||
|
diff -Naur istio/pilot/pkg/networking/core/v1alpha3/listener.go istio-new/pilot/pkg/networking/core/v1alpha3/listener.go
|
||||||
|
--- istio/pilot/pkg/networking/core/v1alpha3/listener.go 2024-01-05 17:58:07.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/networking/core/v1alpha3/listener.go 2024-01-05 17:31:10.000000000 +0800
|
||||||
|
@@ -1279,8 +1279,48 @@
|
||||||
|
|
||||||
|
notimeout := durationpb.New(0 * time.Second)
|
||||||
|
connectionManager.StreamIdleTimeout = notimeout
|
||||||
|
-
|
||||||
|
- if httpOpts.rds != "" {
|
||||||
|
+ // Added by ingress
|
||||||
|
+ enableSRDS := false
|
||||||
|
+ if features.EnableScopedRDS &&
|
||||||
|
+ (listenerOpts.port.Protocol.IsHTTP() || (listenerOpts.port.Protocol == protocol.HTTPS)) {
|
||||||
|
+ enableSRDS = true
|
||||||
|
+ portFragment := &hcm.ScopedRoutes_ScopeKeyBuilder_FragmentBuilder{
|
||||||
|
+ Type: &hcm.ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor_{
|
||||||
|
+ LocalPortValueExtractor: &hcm.ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_LocalPortValueExtractor{},
|
||||||
|
+ }}
|
||||||
|
+ hostFragment := &hcm.ScopedRoutes_ScopeKeyBuilder_FragmentBuilder{
|
||||||
|
+ Type: &hcm.ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor_{
|
||||||
|
+ HostValueExtractor: &hcm.ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HostValueExtractor{},
|
||||||
|
+ }}
|
||||||
|
+ scopedRoutes := &hcm.HttpConnectionManager_ScopedRoutes{
|
||||||
|
+ ScopedRoutes: &hcm.ScopedRoutes{
|
||||||
|
+ Name: constants.DefaultScopedRouteName,
|
||||||
|
+ ScopeKeyBuilder: &hcm.ScopedRoutes_ScopeKeyBuilder{
|
||||||
|
+ Fragments: []*hcm.ScopedRoutes_ScopeKeyBuilder_FragmentBuilder{portFragment, hostFragment},
|
||||||
|
+ },
|
||||||
|
+ RdsConfigSource: &core.ConfigSource{
|
||||||
|
+ ConfigSourceSpecifier: &core.ConfigSource_Ads{
|
||||||
|
+ Ads: &core.AggregatedConfigSource{},
|
||||||
|
+ },
|
||||||
|
+ InitialFetchTimeout: durationpb.New(0),
|
||||||
|
+ ResourceApiVersion: core.ApiVersion_V3,
|
||||||
|
+ },
|
||||||
|
+ ConfigSpecifier: &hcm.ScopedRoutes_ScopedRds{
|
||||||
|
+ ScopedRds: &hcm.ScopedRds{
|
||||||
|
+ ScopedRdsConfigSource: &core.ConfigSource{
|
||||||
|
+ ConfigSourceSpecifier: &core.ConfigSource_Ads{
|
||||||
|
+ Ads: &core.AggregatedConfigSource{},
|
||||||
|
+ },
|
||||||
|
+ InitialFetchTimeout: durationpb.New(0),
|
||||||
|
+ ResourceApiVersion: core.ApiVersion_V3,
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
+ }
|
||||||
|
+ connectionManager.RouteSpecifier = scopedRoutes
|
||||||
|
+ } else if httpOpts.rds != "" {
|
||||||
|
+ // End added by ingress
|
||||||
|
rds := &hcm.HttpConnectionManager_Rds{
|
||||||
|
Rds: &hcm.Rds{
|
||||||
|
ConfigSource: &core.ConfigSource{
|
||||||
|
@@ -1304,8 +1344,15 @@
|
||||||
|
|
||||||
|
filters := make([]*hcm.HttpFilter, len(httpFilters))
|
||||||
|
copy(filters, httpFilters)
|
||||||
|
- // Make sure cors filter always in the first.
|
||||||
|
- filters = append([]*hcm.HttpFilter{xdsfilters.Cors}, filters...)
|
||||||
|
+ // Added by ingress
|
||||||
|
+ // Now only support onDemandRDS when enable SRDS
|
||||||
|
+ if features.OnDemandRDS && enableSRDS {
|
||||||
|
+ filters = append([]*hcm.HttpFilter{xdsfilters.OnDemand, xdsfilters.Cors}, filters...)
|
||||||
|
+ } else {
|
||||||
|
+ // End added by ingress
|
||||||
|
+ // Make sure cors filter always in the first.
|
||||||
|
+ filters = append([]*hcm.HttpFilter{xdsfilters.Cors}, filters...)
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if features.MetadataExchange {
|
||||||
|
filters = append(filters, xdsfilters.HTTPMx)
|
||||||
|
diff -Naur istio/pilot/pkg/xds/ads.go istio-new/pilot/pkg/xds/ads.go
|
||||||
|
--- istio/pilot/pkg/xds/ads.go 2024-01-05 17:58:08.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/xds/ads.go 2024-01-05 17:31:44.000000000 +0800
|
||||||
|
@@ -797,15 +797,18 @@
|
||||||
|
|
||||||
|
// PushOrder defines the order that updates will be pushed in. Any types not listed here will be pushed in random
|
||||||
|
// order after the types listed here
|
||||||
|
-var PushOrder = []string{v3.ClusterType, v3.EndpointType, v3.ListenerType, v3.RouteType, v3.SecretType}
|
||||||
|
+var PushOrder = []string{v3.ClusterType, v3.EndpointType, v3.ListenerType, v3.ScopedRouteType, v3.RouteType, v3.SecretType}
|
||||||
|
|
||||||
|
// KnownOrderedTypeUrls has typeUrls for which we know the order of push.
|
||||||
|
var KnownOrderedTypeUrls = map[string]struct{}{
|
||||||
|
v3.ClusterType: {},
|
||||||
|
v3.EndpointType: {},
|
||||||
|
v3.ListenerType: {},
|
||||||
|
- v3.RouteType: {},
|
||||||
|
- v3.SecretType: {},
|
||||||
|
+ // Added by ingress
|
||||||
|
+ v3.ScopedRouteType: {},
|
||||||
|
+ // End added by ingress
|
||||||
|
+ v3.RouteType: {},
|
||||||
|
+ v3.SecretType: {},
|
||||||
|
}
|
||||||
|
|
||||||
|
// orderWatchedResources orders the resources in accordance with known push order.
|
||||||
|
diff -Naur istio/pilot/pkg/xds/discovery.go istio-new/pilot/pkg/xds/discovery.go
|
||||||
|
--- istio/pilot/pkg/xds/discovery.go 2024-01-05 17:58:07.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/xds/discovery.go 2024-01-04 21:20:00.000000000 +0800
|
||||||
|
@@ -589,6 +589,9 @@
|
||||||
|
s.Generators[v3.ClusterType] = &CdsGenerator{Server: s}
|
||||||
|
s.Generators[v3.ListenerType] = &LdsGenerator{Server: s}
|
||||||
|
s.Generators[v3.RouteType] = &RdsGenerator{Server: s}
|
||||||
|
+ // Added by ingress
|
||||||
|
+ s.Generators[v3.ScopedRouteType] = &SrdsGenerator{Server: s}
|
||||||
|
+ // End added by ingress
|
||||||
|
s.Generators[v3.EndpointType] = edsGen
|
||||||
|
s.Generators[v3.NameTableType] = &NdsGenerator{Server: s}
|
||||||
|
s.Generators[v3.ExtensionConfigurationType] = &EcdsGenerator{Server: s}
|
||||||
|
diff -Naur istio/pilot/pkg/xds/filters/filters.go istio-new/pilot/pkg/xds/filters/filters.go
|
||||||
|
--- istio/pilot/pkg/xds/filters/filters.go 2024-01-05 17:58:03.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/xds/filters/filters.go 2024-01-04 21:20:00.000000000 +0800
|
||||||
|
@@ -21,6 +21,7 @@
|
||||||
|
fault "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/fault/v3"
|
||||||
|
grpcstats "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/grpc_stats/v3"
|
||||||
|
grpcweb "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/grpc_web/v3"
|
||||||
|
+ ondemand "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/on_demand/v3"
|
||||||
|
router "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/router/v3"
|
||||||
|
httpwasm "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/wasm/v3"
|
||||||
|
httpinspector "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/listener/http_inspector/v3"
|
||||||
|
@@ -54,6 +55,14 @@
|
||||||
|
// Define static filters to be reused across the codebase. This avoids duplicate marshaling/unmarshaling
|
||||||
|
// This should not be used for filters that will be mutated
|
||||||
|
var (
|
||||||
|
+ // Added by ingress
|
||||||
|
+ OnDemand = &hcm.HttpFilter{
|
||||||
|
+ Name: "envoy.filters.http.on_demand.v3.OnDemand",
|
||||||
|
+ ConfigType: &hcm.HttpFilter_TypedConfig{
|
||||||
|
+ TypedConfig: util.MessageToAny(&ondemand.OnDemand{}),
|
||||||
|
+ },
|
||||||
|
+ }
|
||||||
|
+ // End added by ingress
|
||||||
|
Cors = &hcm.HttpFilter{
|
||||||
|
Name: wellknown.CORS,
|
||||||
|
ConfigType: &hcm.HttpFilter_TypedConfig{
|
||||||
|
diff -Naur istio/pilot/pkg/xds/srds.go istio-new/pilot/pkg/xds/srds.go
|
||||||
|
--- istio/pilot/pkg/xds/srds.go 1970-01-01 08:00:00.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/xds/srds.go 2024-01-05 13:45:49.000000000 +0800
|
||||||
|
@@ -0,0 +1,79 @@
|
||||||
|
+// 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.
|
||||||
|
+
|
||||||
|
+package xds
|
||||||
|
+
|
||||||
|
+import (
|
||||||
|
+ discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
|
||||||
|
+ "istio.io/istio/pilot/pkg/features"
|
||||||
|
+ "istio.io/istio/pilot/pkg/model"
|
||||||
|
+ "istio.io/istio/pilot/pkg/networking/util"
|
||||||
|
+ "istio.io/istio/pkg/config"
|
||||||
|
+ "istio.io/istio/pkg/config/schema/gvk"
|
||||||
|
+)
|
||||||
|
+
|
||||||
|
+type SrdsGenerator struct {
|
||||||
|
+ Server *DiscoveryServer
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+var _ model.XdsResourceGenerator = &SrdsGenerator{}
|
||||||
|
+
|
||||||
|
+// Map of all configs that do not impact SRDS
|
||||||
|
+var skippedSrdsConfigs = map[config.GroupVersionKind]struct{}{
|
||||||
|
+ gvk.WorkloadEntry: {},
|
||||||
|
+ gvk.WorkloadGroup: {},
|
||||||
|
+ gvk.RequestAuthentication: {},
|
||||||
|
+ gvk.PeerAuthentication: {},
|
||||||
|
+ gvk.Secret: {},
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+func srdsNeedsPush(req *model.PushRequest) bool {
|
||||||
|
+ if !features.EnableScopedRDS {
|
||||||
|
+ return false
|
||||||
|
+ }
|
||||||
|
+ if req == nil {
|
||||||
|
+ return true
|
||||||
|
+ }
|
||||||
|
+ if !req.Full {
|
||||||
|
+ // SRDS only handles full push
|
||||||
|
+ return false
|
||||||
|
+ }
|
||||||
|
+ // If none set, we will always push
|
||||||
|
+ if len(req.ConfigsUpdated) == 0 {
|
||||||
|
+ return true
|
||||||
|
+ }
|
||||||
|
+ for config := range req.ConfigsUpdated {
|
||||||
|
+ if _, f := skippedSrdsConfigs[config.Kind]; !f {
|
||||||
|
+ return true
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ return false
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+func (s SrdsGenerator) Generate(proxy *model.Proxy, push *model.PushContext, w *model.WatchedResource,
|
||||||
|
+ req *model.PushRequest) (model.Resources, model.XdsLogDetails, error) {
|
||||||
|
+ if !srdsNeedsPush(req) {
|
||||||
|
+ return nil, model.DefaultXdsLogDetails, nil
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ scopedRoutes := s.Server.ConfigGenerator.BuildScopedRoutes(proxy, push)
|
||||||
|
+ resources := model.Resources{}
|
||||||
|
+ for _, sr := range scopedRoutes {
|
||||||
|
+ resources = append(resources, &discovery.Resource{
|
||||||
|
+ Name: sr.Name,
|
||||||
|
+ Resource: util.MessageToAny(sr),
|
||||||
|
+ })
|
||||||
|
+ }
|
||||||
|
+ return resources, model.DefaultXdsLogDetails, nil
|
||||||
|
+}
|
||||||
|
diff -Naur istio/pilot/pkg/xds/v3/model.go istio-new/pilot/pkg/xds/v3/model.go
|
||||||
|
--- istio/pilot/pkg/xds/v3/model.go 2024-01-05 17:58:03.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/xds/v3/model.go 2024-01-05 16:55:49.000000000 +0800
|
||||||
|
@@ -31,6 +31,10 @@
|
||||||
|
SecretType = resource.SecretType
|
||||||
|
ExtensionConfigurationType = resource.ExtensionConfigType
|
||||||
|
|
||||||
|
+ // Added by ingress
|
||||||
|
+ ScopedRouteType = apiTypePrefix + "envoy.config.route.v3.ScopedRouteConfiguration"
|
||||||
|
+ // End added by ingress
|
||||||
|
+
|
||||||
|
NameTableType = apiTypePrefix + "istio.networking.nds.v1.NameTable"
|
||||||
|
HealthInfoType = apiTypePrefix + "istio.v1.HealthInformation"
|
||||||
|
ProxyConfigType = apiTypePrefix + "istio.mesh.v1alpha1.ProxyConfig"
|
||||||
|
@@ -61,6 +65,10 @@
|
||||||
|
return "PCDS"
|
||||||
|
case ExtensionConfigurationType:
|
||||||
|
return "ECDS"
|
||||||
|
+ // Added by ingress
|
||||||
|
+ case ScopedRouteType:
|
||||||
|
+ return "SRDS"
|
||||||
|
+ // End added by ingress
|
||||||
|
default:
|
||||||
|
return typeURL
|
||||||
|
}
|
||||||
|
@@ -87,6 +95,10 @@
|
||||||
|
return "ecds"
|
||||||
|
case BootstrapType:
|
||||||
|
return "bds"
|
||||||
|
+ // Added by ingress
|
||||||
|
+ case ScopedRouteType:
|
||||||
|
+ return "srds"
|
||||||
|
+ // End added by ingress
|
||||||
|
default:
|
||||||
|
return typeURL
|
||||||
|
}
|
||||||
|
diff -Naur istio/pkg/config/constants/constants.go istio-new/pkg/config/constants/constants.go
|
||||||
|
--- istio/pkg/config/constants/constants.go 2024-01-05 17:58:08.000000000 +0800
|
||||||
|
+++ istio-new/pkg/config/constants/constants.go 2024-01-04 21:20:00.000000000 +0800
|
||||||
|
@@ -143,4 +143,9 @@
|
||||||
|
// CertProviderNone does not create any certificates for the control plane. It is assumed that some external
|
||||||
|
// load balancer, such as an Istio Gateway, is terminating the TLS.
|
||||||
|
CertProviderNone = "none"
|
||||||
|
+
|
||||||
|
+ // Added by ingress
|
||||||
|
+ HigressHostRDSNamePrefix = "higress-rds-"
|
||||||
|
+ DefaultScopedRouteName = "scoped-route"
|
||||||
|
+ // End added by ingress
|
||||||
|
)
|
||||||
373
istio/1.12/patches/istio/20240115-optimize-rds-cache.patch
Normal file
373
istio/1.12/patches/istio/20240115-optimize-rds-cache.patch
Normal file
@@ -0,0 +1,373 @@
|
|||||||
|
diff -Naur istio/pilot/pkg/model/push_context.go istio-new/pilot/pkg/model/push_context.go
|
||||||
|
--- istio/pilot/pkg/model/push_context.go 2024-01-15 20:46:45.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/model/push_context.go 2024-01-15 19:20:45.000000000 +0800
|
||||||
|
@@ -96,6 +96,9 @@
|
||||||
|
publicByGateway map[string][]config.Config
|
||||||
|
// root vs namespace/name ->delegate vs virtualservice gvk/namespace/name
|
||||||
|
delegates map[ConfigKey][]ConfigKey
|
||||||
|
+ // Added by ingress
|
||||||
|
+ byHost map[string][]config.Config
|
||||||
|
+ // End added by ingress
|
||||||
|
}
|
||||||
|
|
||||||
|
func newVirtualServiceIndex() virtualServiceIndex {
|
||||||
|
@@ -104,6 +107,9 @@
|
||||||
|
privateByNamespaceAndGateway: map[string]map[string][]config.Config{},
|
||||||
|
exportedToNamespaceByGateway: map[string]map[string][]config.Config{},
|
||||||
|
delegates: map[ConfigKey][]ConfigKey{},
|
||||||
|
+ // Added by ingress
|
||||||
|
+ byHost: map[string][]config.Config{},
|
||||||
|
+ // End added by ingress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -857,6 +863,13 @@
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
+// Added by ingress
|
||||||
|
+func (ps *PushContext) VirtualServicesForHost(proxy *Proxy, host string) []config.Config {
|
||||||
|
+ return ps.virtualServiceIndex.byHost[host]
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// End added by ingress
|
||||||
|
+
|
||||||
|
// DelegateVirtualServicesConfigKey lists all the delegate virtual services configkeys associated with the provided virtual services
|
||||||
|
func (ps *PushContext) DelegateVirtualServicesConfigKey(vses []config.Config) []ConfigKey {
|
||||||
|
var out []ConfigKey
|
||||||
|
@@ -1468,6 +1481,11 @@
|
||||||
|
for _, virtualService := range vservices {
|
||||||
|
ns := virtualService.Namespace
|
||||||
|
rule := virtualService.Spec.(*networking.VirtualService)
|
||||||
|
+ // Added by ingress
|
||||||
|
+ for _, host := range rule.Hosts {
|
||||||
|
+ ps.virtualServiceIndex.byHost[host] = append(ps.virtualServiceIndex.byHost[host], virtualService)
|
||||||
|
+ }
|
||||||
|
+ // End added by ingress
|
||||||
|
gwNames := getGatewayNames(rule)
|
||||||
|
if len(rule.ExportTo) == 0 {
|
||||||
|
// No exportTo in virtualService. Use the global default
|
||||||
|
diff -Naur istio/pilot/pkg/networking/core/v1alpha3/gateway.go istio-new/pilot/pkg/networking/core/v1alpha3/gateway.go
|
||||||
|
--- istio/pilot/pkg/networking/core/v1alpha3/gateway.go 2024-01-15 20:46:45.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/networking/core/v1alpha3/gateway.go 2024-01-15 20:04:05.000000000 +0800
|
||||||
|
@@ -28,6 +28,7 @@
|
||||||
|
route "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
|
||||||
|
hcm "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3"
|
||||||
|
tls "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3"
|
||||||
|
+ discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
|
||||||
|
"github.com/hashicorp/go-multierror"
|
||||||
|
|
||||||
|
meshconfig "istio.io/api/mesh/v1alpha1"
|
||||||
|
@@ -35,6 +36,7 @@
|
||||||
|
"istio.io/istio/pilot/pkg/features"
|
||||||
|
"istio.io/istio/pilot/pkg/model"
|
||||||
|
istionetworking "istio.io/istio/pilot/pkg/networking"
|
||||||
|
+ "istio.io/istio/pilot/pkg/networking/core/v1alpha3/envoyfilter"
|
||||||
|
"istio.io/istio/pilot/pkg/networking/core/v1alpha3/extension"
|
||||||
|
"istio.io/istio/pilot/pkg/networking/core/v1alpha3/mseingress"
|
||||||
|
istio_route "istio.io/istio/pilot/pkg/networking/core/v1alpha3/route"
|
||||||
|
@@ -423,8 +425,15 @@
|
||||||
|
gatewayName string
|
||||||
|
}
|
||||||
|
|
||||||
|
-func (configgen *ConfigGeneratorImpl) buildHostRDSConfig(node *model.Proxy, push *model.PushContext,
|
||||||
|
- routeName string) *route.RouteConfiguration {
|
||||||
|
+func (configgen *ConfigGeneratorImpl) buildHostRDSConfig(
|
||||||
|
+ node *model.Proxy,
|
||||||
|
+ req *model.PushRequest,
|
||||||
|
+ routeName string,
|
||||||
|
+ vsCache map[int][]virtualServiceContext,
|
||||||
|
+ efw *model.EnvoyFilterWrapper,
|
||||||
|
+ efKeys []string,
|
||||||
|
+) (*discovery.Resource, bool) {
|
||||||
|
+ push := req.Push
|
||||||
|
var (
|
||||||
|
hostRDSPort string
|
||||||
|
hostRDSHost string
|
||||||
|
@@ -432,7 +441,7 @@
|
||||||
|
portAndHost := strings.SplitN(strings.TrimPrefix(routeName, constants.HigressHostRDSNamePrefix), ".", 2)
|
||||||
|
if len(portAndHost) != 2 {
|
||||||
|
log.Errorf("Invalid route %s when using Higress hostRDS", routeName)
|
||||||
|
- return nil
|
||||||
|
+ return nil, false
|
||||||
|
}
|
||||||
|
hostRDSPort = portAndHost[0]
|
||||||
|
hostRDSHost = portAndHost[1]
|
||||||
|
@@ -441,10 +450,24 @@
|
||||||
|
rdsPort, err := strconv.Atoi(hostRDSPort)
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf("Invalid port %s of route %s when using Higress hostRDS", hostRDSPort, routeName)
|
||||||
|
- return nil
|
||||||
|
+ return nil, false
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ routeCache := &istio_route.Cache{
|
||||||
|
+ RouteName: routeName,
|
||||||
|
+ ProxyVersion: node.Metadata.IstioVersion,
|
||||||
|
+ ListenerPort: rdsPort,
|
||||||
|
+ // Use same host vs to cache, although the cache can be cleared when the port is different, this can be accepted
|
||||||
|
+ VirtualServices: push.VirtualServicesForHost(node, hostRDSHost),
|
||||||
|
+ EnvoyFilterKeys: efKeys,
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ resource, exist := configgen.Cache.Get(routeCache)
|
||||||
|
+ if exist {
|
||||||
|
+ return resource, true
|
||||||
|
}
|
||||||
|
+
|
||||||
|
listenerPort := uint32(rdsPort)
|
||||||
|
- globalHTTPFilters := mseingress.ExtractGlobalHTTPFilters(node, push)
|
||||||
|
|
||||||
|
isH3DiscoveryNeeded := false
|
||||||
|
|
||||||
|
@@ -457,9 +480,9 @@
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-
|
||||||
|
gatewayRoutes := make(map[string]map[string][]*route.Route)
|
||||||
|
gatewayVirtualServices := make(map[string][]config.Config)
|
||||||
|
+ var listenerVirtualServices []virtualServiceContext
|
||||||
|
var selectedVirtualServices []virtualServiceContext
|
||||||
|
var vHost *route.VirtualHost
|
||||||
|
serverIterator := func(mergedServers map[model.ServerPort]*model.MergedServers) {
|
||||||
|
@@ -478,31 +501,8 @@
|
||||||
|
gatewayVirtualServices[gatewayName] = virtualServices
|
||||||
|
}
|
||||||
|
for _, virtualService := range virtualServices {
|
||||||
|
- hostMatch := false
|
||||||
|
- var selectHost string
|
||||||
|
- virtualServiceHosts := host.NewNames(virtualService.Spec.(*networking.VirtualService).Hosts)
|
||||||
|
- for _, hostname := range virtualServiceHosts {
|
||||||
|
- // exact match
|
||||||
|
- if hostname == host.Name(hostRDSHost) {
|
||||||
|
- hostMatch = true
|
||||||
|
- selectHost = hostRDSHost
|
||||||
|
- break
|
||||||
|
- }
|
||||||
|
- if features.HostRDSMergeSubset {
|
||||||
|
- // subset match
|
||||||
|
- if host.Name(hostRDSHost).SubsetOf(hostname) {
|
||||||
|
- hostMatch = true
|
||||||
|
- selectHost = string(hostname)
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- if !hostMatch {
|
||||||
|
- continue
|
||||||
|
- }
|
||||||
|
- copiedVS := virtualService.DeepCopy()
|
||||||
|
- copiedVS.Spec.(*networking.VirtualService).Hosts = []string{selectHost}
|
||||||
|
- selectedVirtualServices = append(selectedVirtualServices, virtualServiceContext{
|
||||||
|
- virtualService: copiedVS,
|
||||||
|
+ listenerVirtualServices = append(listenerVirtualServices, virtualServiceContext{
|
||||||
|
+ virtualService: virtualService,
|
||||||
|
server: server,
|
||||||
|
gatewayName: gatewayName,
|
||||||
|
})
|
||||||
|
@@ -510,15 +510,63 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- serverIterator(merged.MergedServers)
|
||||||
|
- serverIterator(merged.MergedQUICTransportServers)
|
||||||
|
- // Sort by subset
|
||||||
|
- // before: ["*.abc.com", "*.com", "www.abc.com"]
|
||||||
|
- // after: ["www.abc.com", "*.abc.com", "*.com"]
|
||||||
|
- sort.SliceStable(selectedVirtualServices, func(i, j int) bool {
|
||||||
|
- return host.Name(selectedVirtualServices[i].virtualService.Spec.(*networking.VirtualService).Hosts[0]).SubsetOf(
|
||||||
|
- host.Name(selectedVirtualServices[j].virtualService.Spec.(*networking.VirtualService).Hosts[0]))
|
||||||
|
- })
|
||||||
|
+ var vsExists bool
|
||||||
|
+ if listenerVirtualServices, vsExists = vsCache[rdsPort]; !vsExists {
|
||||||
|
+ serverIterator(merged.MergedServers)
|
||||||
|
+ serverIterator(merged.MergedQUICTransportServers)
|
||||||
|
+ vsCache[rdsPort] = listenerVirtualServices
|
||||||
|
+ }
|
||||||
|
+ for _, vsCtx := range listenerVirtualServices {
|
||||||
|
+ virtualService := vsCtx.virtualService
|
||||||
|
+ hostMatch := false
|
||||||
|
+ var selectHost string
|
||||||
|
+ for _, hostname := range virtualService.Spec.(*networking.VirtualService).Hosts {
|
||||||
|
+ // exact match
|
||||||
|
+ if hostname == hostRDSHost {
|
||||||
|
+ hostMatch = true
|
||||||
|
+ selectHost = hostRDSHost
|
||||||
|
+ break
|
||||||
|
+ }
|
||||||
|
+ if features.HostRDSMergeSubset {
|
||||||
|
+ // subset match
|
||||||
|
+ if host.Name(hostRDSHost).SubsetOf(host.Name(hostname)) {
|
||||||
|
+ hostMatch = true
|
||||||
|
+ selectHost = hostname
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if !hostMatch {
|
||||||
|
+ continue
|
||||||
|
+ }
|
||||||
|
+ if len(virtualService.Spec.(*networking.VirtualService).Hosts) > 1 {
|
||||||
|
+ copiedVS := &networking.VirtualService{}
|
||||||
|
+ copiedVS = virtualService.Spec.(*networking.VirtualService)
|
||||||
|
+ copiedVS.Hosts = []string{selectHost}
|
||||||
|
+ selectedVirtualServices = append(selectedVirtualServices, virtualServiceContext{
|
||||||
|
+ virtualService: config.Config{
|
||||||
|
+ Meta: virtualService.Meta,
|
||||||
|
+ Spec: copiedVS,
|
||||||
|
+ Status: virtualService.Status,
|
||||||
|
+ },
|
||||||
|
+ server: vsCtx.server,
|
||||||
|
+ gatewayName: vsCtx.gatewayName,
|
||||||
|
+ })
|
||||||
|
+ } else {
|
||||||
|
+ selectedVirtualServices = append(selectedVirtualServices, vsCtx)
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if features.HostRDSMergeSubset {
|
||||||
|
+ // Sort by subset
|
||||||
|
+ // before: ["*.abc.com", "*.com", "www.abc.com"]
|
||||||
|
+ // after: ["www.abc.com", "*.abc.com", "*.com"]
|
||||||
|
+ sort.SliceStable(selectedVirtualServices, func(i, j int) bool {
|
||||||
|
+ return host.Name(selectedVirtualServices[i].virtualService.Spec.(*networking.VirtualService).Hosts[0]).SubsetOf(
|
||||||
|
+ host.Name(selectedVirtualServices[j].virtualService.Spec.(*networking.VirtualService).Hosts[0]))
|
||||||
|
+ })
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ globalHTTPFilters := mseingress.ExtractGlobalHTTPFilters(node, push)
|
||||||
|
+
|
||||||
|
port := int(listenerPort)
|
||||||
|
for _, ctx := range selectedVirtualServices {
|
||||||
|
virtualService := ctx.virtualService
|
||||||
|
@@ -605,25 +653,42 @@
|
||||||
|
ValidateClusters: proto.BoolFalse,
|
||||||
|
}
|
||||||
|
|
||||||
|
- return routeCfg
|
||||||
|
+ routeCfg = envoyfilter.ApplyRouteConfigurationPatches(networking.EnvoyFilter_GATEWAY, node, efw, routeCfg)
|
||||||
|
+ resource = &discovery.Resource{
|
||||||
|
+ Name: routeName,
|
||||||
|
+ Resource: util.MessageToAny(routeCfg),
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if features.EnableRDSCaching {
|
||||||
|
+ configgen.Cache.Add(routeCache, req, resource)
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return resource, false
|
||||||
|
}
|
||||||
|
|
||||||
|
// End added by ingress
|
||||||
|
|
||||||
|
-func (configgen *ConfigGeneratorImpl) buildGatewayHTTPRouteConfig(node *model.Proxy, push *model.PushContext,
|
||||||
|
- routeName string) *route.RouteConfiguration {
|
||||||
|
+// Modifed by ingress
|
||||||
|
+func (configgen *ConfigGeneratorImpl) buildGatewayHTTPRouteConfig(
|
||||||
|
+ node *model.Proxy,
|
||||||
|
+ req *model.PushRequest,
|
||||||
|
+ routeName string,
|
||||||
|
+ vsCache map[int][]virtualServiceContext,
|
||||||
|
+ efw *model.EnvoyFilterWrapper,
|
||||||
|
+ efKeys []string,
|
||||||
|
+) (*discovery.Resource, bool) {
|
||||||
|
if node.MergedGateway == nil {
|
||||||
|
log.Warnf("buildGatewayRoutes: no gateways for router %v", node.ID)
|
||||||
|
- return &route.RouteConfiguration{
|
||||||
|
- Name: routeName,
|
||||||
|
- VirtualHosts: []*route.VirtualHost{},
|
||||||
|
- ValidateClusters: proto.BoolFalse,
|
||||||
|
- }
|
||||||
|
+ return nil, false
|
||||||
|
}
|
||||||
|
-
|
||||||
|
// Added by ingress
|
||||||
|
+ push := req.Push
|
||||||
|
if strings.HasPrefix(routeName, constants.HigressHostRDSNamePrefix) {
|
||||||
|
- return configgen.buildHostRDSConfig(node, push, routeName)
|
||||||
|
+ resource, cacheHit := configgen.buildHostRDSConfig(node, req, routeName, vsCache, efw, efKeys)
|
||||||
|
+ if resource == nil {
|
||||||
|
+ return nil, false
|
||||||
|
+ }
|
||||||
|
+ return resource, cacheHit
|
||||||
|
}
|
||||||
|
// End added by ingress
|
||||||
|
|
||||||
|
@@ -636,7 +701,7 @@
|
||||||
|
|
||||||
|
// This can happen when a gateway has recently been deleted. Envoy will still request route
|
||||||
|
// information due to the draining of listeners, so we should not return an error.
|
||||||
|
- return nil
|
||||||
|
+ return nil, false
|
||||||
|
}
|
||||||
|
|
||||||
|
servers := merged.ServersByRouteName[routeName]
|
||||||
|
@@ -768,9 +833,16 @@
|
||||||
|
ValidateClusters: proto.BoolFalse,
|
||||||
|
}
|
||||||
|
|
||||||
|
- return routeCfg
|
||||||
|
+ routeCfg = envoyfilter.ApplyRouteConfigurationPatches(networking.EnvoyFilter_GATEWAY, node, efw, routeCfg)
|
||||||
|
+ resource := &discovery.Resource{
|
||||||
|
+ Name: routeName,
|
||||||
|
+ Resource: util.MessageToAny(routeCfg),
|
||||||
|
+ }
|
||||||
|
+ return resource, false
|
||||||
|
}
|
||||||
|
|
||||||
|
+// End modified by ingress
|
||||||
|
+
|
||||||
|
// hashRouteList returns a hash of a list of pointers
|
||||||
|
func hashRouteList(r []*route.Route) uint64 {
|
||||||
|
hash := md5.New()
|
||||||
|
diff -Naur istio/pilot/pkg/networking/core/v1alpha3/httproute.go istio-new/pilot/pkg/networking/core/v1alpha3/httproute.go
|
||||||
|
--- istio/pilot/pkg/networking/core/v1alpha3/httproute.go 2024-01-15 20:46:41.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/networking/core/v1alpha3/httproute.go 2024-01-15 10:29:09.000000000 +0800
|
||||||
|
@@ -78,17 +78,30 @@
|
||||||
|
routeConfigurations = append(routeConfigurations, rc)
|
||||||
|
}
|
||||||
|
case model.Router:
|
||||||
|
+ // Modified by ingress
|
||||||
|
+ vsCache := make(map[int][]virtualServiceContext)
|
||||||
|
+ envoyfilterKeys := efw.Keys()
|
||||||
|
for _, routeName := range routeNames {
|
||||||
|
- rc := configgen.buildGatewayHTTPRouteConfig(node, req.Push, routeName)
|
||||||
|
- if rc != nil {
|
||||||
|
- rc = envoyfilter.ApplyRouteConfigurationPatches(networking.EnvoyFilter_GATEWAY, node, efw, rc)
|
||||||
|
- resource := &discovery.Resource{
|
||||||
|
+ rc, cached := configgen.buildGatewayHTTPRouteConfig(node, req, routeName, vsCache, efw, envoyfilterKeys)
|
||||||
|
+ if cached && !features.EnableUnsafeAssertions {
|
||||||
|
+ hit++
|
||||||
|
+ } else {
|
||||||
|
+ miss++
|
||||||
|
+ }
|
||||||
|
+ if rc == nil {
|
||||||
|
+ emptyRoute := &route.RouteConfiguration{
|
||||||
|
+ Name: routeName,
|
||||||
|
+ VirtualHosts: []*route.VirtualHost{},
|
||||||
|
+ ValidateClusters: proto.BoolFalse,
|
||||||
|
+ }
|
||||||
|
+ rc = &discovery.Resource{
|
||||||
|
Name: routeName,
|
||||||
|
- Resource: util.MessageToAny(rc),
|
||||||
|
+ Resource: util.MessageToAny(emptyRoute),
|
||||||
|
}
|
||||||
|
- routeConfigurations = append(routeConfigurations, resource)
|
||||||
|
}
|
||||||
|
+ routeConfigurations = append(routeConfigurations, rc)
|
||||||
|
}
|
||||||
|
+ // End modified by ingress
|
||||||
|
}
|
||||||
|
if !features.EnableRDSCaching {
|
||||||
|
return routeConfigurations, model.DefaultXdsLogDetails
|
||||||
|
diff -Naur istio/pilot/pkg/xds/discovery.go istio-new/pilot/pkg/xds/discovery.go
|
||||||
|
--- istio/pilot/pkg/xds/discovery.go 2024-01-15 20:46:45.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/xds/discovery.go 2024-01-12 19:56:02.000000000 +0800
|
||||||
|
@@ -392,6 +392,9 @@
|
||||||
|
// ConfigUpdate implements ConfigUpdater interface, used to request pushes.
|
||||||
|
// It replaces the 'clear cache' from v1.
|
||||||
|
func (s *DiscoveryServer) ConfigUpdate(req *model.PushRequest) {
|
||||||
|
+ if req.Full {
|
||||||
|
+ log.Infof("full push happen, reason:%v", req.Reason)
|
||||||
|
+ }
|
||||||
|
inboundConfigUpdates.Increment()
|
||||||
|
s.InboundUpdates.Inc()
|
||||||
|
s.pushChannel <- req
|
||||||
60
istio/1.12/patches/istio/20240201-optimize-default-arg.patch
Normal file
60
istio/1.12/patches/istio/20240201-optimize-default-arg.patch
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
diff -Naur istio/pilot/cmd/pilot-agent/status/util/stats.go istio-new/pilot/cmd/pilot-agent/status/util/stats.go
|
||||||
|
--- istio/pilot/cmd/pilot-agent/status/util/stats.go 2024-02-01 10:20:13.000000000 +0800
|
||||||
|
+++ istio-new/pilot/cmd/pilot-agent/status/util/stats.go 2024-01-31 22:44:53.000000000 +0800
|
||||||
|
@@ -73,7 +73,7 @@
|
||||||
|
localHostAddr = "localhost"
|
||||||
|
}
|
||||||
|
|
||||||
|
- readinessURL := fmt.Sprintf("http://%s:%d/stats?usedonly&filter=%s", localHostAddr, adminPort, readyStatsRegex)
|
||||||
|
+ readinessURL := fmt.Sprintf("http://%s:%d/stats?usedonly", localHostAddr, adminPort)
|
||||||
|
stats, err := http.DoHTTPGetWithTimeout(readinessURL, readinessTimeout)
|
||||||
|
if err != nil {
|
||||||
|
return nil, false, err
|
||||||
|
@@ -105,7 +105,7 @@
|
||||||
|
localHostAddr = "localhost"
|
||||||
|
}
|
||||||
|
|
||||||
|
- stats, err := http.DoHTTPGet(fmt.Sprintf("http://%s:%d/stats?usedonly&filter=%s", localHostAddr, adminPort, updateStatsRegex))
|
||||||
|
+ stats, err := http.DoHTTPGet(fmt.Sprintf("http://%s:%d/stats?usedonly", localHostAddr, adminPort))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
diff -Naur istio/pilot/pkg/features/pilot.go istio-new/pilot/pkg/features/pilot.go
|
||||||
|
--- istio/pilot/pkg/features/pilot.go 2024-02-01 10:20:17.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/features/pilot.go 2024-02-01 10:16:18.000000000 +0800
|
||||||
|
@@ -575,6 +575,8 @@
|
||||||
|
"If enabled, each host in virtualservice will have an independent RDS, which is used with SRDS").Get()
|
||||||
|
OnDemandRDS = env.RegisterBoolVar("ON_DEMAND_RDS", false,
|
||||||
|
"If enabled, the on demand filter will be added to the HCM filters").Get()
|
||||||
|
+ DefaultUpstreamConcurrencyThreshold = env.RegisterIntVar("DEFAULT_UPSTREAM_CONCURRENCY_THRESHOLD", 1000000,
|
||||||
|
+ "The default threshold of max_requests/max_pending_requests/max_connections of circuit breaker").Get()
|
||||||
|
// End added by ingress
|
||||||
|
)
|
||||||
|
|
||||||
|
diff -Naur istio/pilot/pkg/networking/core/v1alpha3/cluster.go istio-new/pilot/pkg/networking/core/v1alpha3/cluster.go
|
||||||
|
--- istio/pilot/pkg/networking/core/v1alpha3/cluster.go 2024-02-01 10:20:17.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/networking/core/v1alpha3/cluster.go 2024-02-01 10:16:05.000000000 +0800
|
||||||
|
@@ -61,6 +61,7 @@
|
||||||
|
|
||||||
|
// getDefaultCircuitBreakerThresholds returns a copy of the default circuit breaker thresholds for the given traffic direction.
|
||||||
|
func getDefaultCircuitBreakerThresholds() *cluster.CircuitBreakers_Thresholds {
|
||||||
|
+ // Modified by ingress
|
||||||
|
return &cluster.CircuitBreakers_Thresholds{
|
||||||
|
// DefaultMaxRetries specifies the default for the Envoy circuit breaker parameter max_retries. This
|
||||||
|
// defines the maximum number of parallel retries a given Envoy will allow to the upstream cluster. Envoy defaults
|
||||||
|
@@ -68,11 +69,12 @@
|
||||||
|
// where multiple endpoints in a cluster are terminated. In these scenarios the circuit breaker can kick
|
||||||
|
// in before Pilot is able to deliver an updated endpoint list to Envoy, leading to client-facing 503s.
|
||||||
|
MaxRetries: &wrappers.UInt32Value{Value: math.MaxUint32},
|
||||||
|
- MaxRequests: &wrappers.UInt32Value{Value: math.MaxUint32},
|
||||||
|
- MaxConnections: &wrappers.UInt32Value{Value: math.MaxUint32},
|
||||||
|
- MaxPendingRequests: &wrappers.UInt32Value{Value: math.MaxUint32},
|
||||||
|
+ MaxRequests: &wrappers.UInt32Value{Value: uint32(features.DefaultUpstreamConcurrencyThreshold)},
|
||||||
|
+ MaxConnections: &wrappers.UInt32Value{Value: uint32(features.DefaultUpstreamConcurrencyThreshold)},
|
||||||
|
+ MaxPendingRequests: &wrappers.UInt32Value{Value: uint32(features.DefaultUpstreamConcurrencyThreshold)},
|
||||||
|
TrackRemaining: true,
|
||||||
|
}
|
||||||
|
+ // End modified by ingress
|
||||||
|
}
|
||||||
|
|
||||||
|
// BuildClusters returns the list of clusters for the given proxy. This is the CDS output
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
diff -Naur istio/pilot/pkg/networking/core/v1alpha3/gateway.go istio-new/pilot/pkg/networking/core/v1alpha3/gateway.go
|
||||||
|
--- istio/pilot/pkg/networking/core/v1alpha3/gateway.go 2024-02-01 13:53:17.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/networking/core/v1alpha3/gateway.go 2024-02-01 13:52:11.000000000 +0800
|
||||||
|
@@ -501,6 +501,16 @@
|
||||||
|
gatewayVirtualServices[gatewayName] = virtualServices
|
||||||
|
}
|
||||||
|
for _, virtualService := range virtualServices {
|
||||||
|
+ virtualServiceHosts := host.NewNames(virtualService.Spec.(*networking.VirtualService).Hosts)
|
||||||
|
+ serverHosts := host.NamesForNamespace(server.Hosts, virtualService.Namespace)
|
||||||
|
+
|
||||||
|
+ // We have two cases here:
|
||||||
|
+ // 1. virtualService hosts are 1.foo.com, 2.foo.com, 3.foo.com and server hosts are ns/*.foo.com
|
||||||
|
+ // 2. virtualService hosts are *.foo.com, and server hosts are ns/1.foo.com, ns/2.foo.com, ns/3.foo.com
|
||||||
|
+ intersectingHosts := serverHosts.Intersection(virtualServiceHosts)
|
||||||
|
+ if len(intersectingHosts) == 0 {
|
||||||
|
+ continue
|
||||||
|
+ }
|
||||||
|
listenerVirtualServices = append(listenerVirtualServices, virtualServiceContext{
|
||||||
|
virtualService: virtualService,
|
||||||
|
server: server,
|
||||||
|
@@ -615,22 +625,24 @@
|
||||||
|
|
||||||
|
// check all hostname if is not exist with HttpsRedirect set to true
|
||||||
|
// create VirtualHost to redirect
|
||||||
|
- for _, hostname := range server.Hosts {
|
||||||
|
- if !server.GetTls().GetHttpsRedirect() {
|
||||||
|
- continue
|
||||||
|
- }
|
||||||
|
- if vHost != nil && host.Name(hostname) == host.Name(hostRDSHost) {
|
||||||
|
+ if server.GetTls().GetHttpsRedirect() {
|
||||||
|
+ if vHost != nil {
|
||||||
|
vHost.RequireTls = route.VirtualHost_ALL
|
||||||
|
- continue
|
||||||
|
+ } else {
|
||||||
|
+ vHost = &route.VirtualHost{
|
||||||
|
+ Name: util.DomainName(hostRDSHost, port),
|
||||||
|
+ Domains: buildGatewayVirtualHostDomains(hostRDSHost, port),
|
||||||
|
+ IncludeRequestAttemptCount: true,
|
||||||
|
+ RequireTls: route.VirtualHost_ALL,
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
- vHost = &route.VirtualHost{
|
||||||
|
- Name: util.DomainName(hostname, port),
|
||||||
|
- Domains: buildGatewayVirtualHostDomains(hostname, port),
|
||||||
|
- IncludeRequestAttemptCount: true,
|
||||||
|
- RequireTls: route.VirtualHost_ALL,
|
||||||
|
+ } else if vHost != nil {
|
||||||
|
+ mode := server.GetTls().GetMode()
|
||||||
|
+ if mode == networking.ServerTLSSettings_MUTUAL ||
|
||||||
|
+ mode == networking.ServerTLSSettings_ISTIO_MUTUAL {
|
||||||
|
+ vHost.AllowServerNames = append(vHost.AllowServerNames, server.Hosts...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-
|
||||||
|
}
|
||||||
|
var virtualHosts []*route.VirtualHost
|
||||||
|
if vHost == nil {
|
||||||
|
@@ -642,6 +654,30 @@
|
||||||
|
Routes: []*route.Route{},
|
||||||
|
}}
|
||||||
|
} else {
|
||||||
|
+ sort.SliceStable(vHost.AllowServerNames, func(i, j int) bool {
|
||||||
|
+ hostI := vHost.AllowServerNames[i]
|
||||||
|
+ hostJ := vHost.AllowServerNames[j]
|
||||||
|
+ if host.Name(hostI).SubsetOf(host.Name(hostJ)) {
|
||||||
|
+ return true
|
||||||
|
+ }
|
||||||
|
+ return hostI < hostJ
|
||||||
|
+ })
|
||||||
|
+ var uniqueServerNames []string
|
||||||
|
+ hasAllCatch := false
|
||||||
|
+ for i, name := range vHost.AllowServerNames {
|
||||||
|
+ if name == "*" {
|
||||||
|
+ hasAllCatch = true
|
||||||
|
+ break
|
||||||
|
+ }
|
||||||
|
+ if i == 0 || vHost.AllowServerNames[i-1] != name {
|
||||||
|
+ uniqueServerNames = append(uniqueServerNames, name)
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if hasAllCatch {
|
||||||
|
+ vHost.AllowServerNames = nil
|
||||||
|
+ } else {
|
||||||
|
+ vHost.AllowServerNames = uniqueServerNames
|
||||||
|
+ }
|
||||||
|
vHost.Routes = istio_route.CombineVHostRoutes(vHost.Routes)
|
||||||
|
virtualHosts = append(virtualHosts, vHost)
|
||||||
|
}
|
||||||
41
istio/1.12/patches/istio/20240202-fix-rds-cache.patch
Normal file
41
istio/1.12/patches/istio/20240202-fix-rds-cache.patch
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
diff -Naur istio/pilot/pkg/xds/discovery.go istio-new/pilot/pkg/xds/discovery.go
|
||||||
|
--- istio/pilot/pkg/xds/discovery.go 2024-02-02 16:26:49.000000000 +0800
|
||||||
|
+++ istio-new/pilot/pkg/xds/discovery.go 2024-02-02 15:38:53.000000000 +0800
|
||||||
|
@@ -18,6 +18,7 @@
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
+ "strings"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
@@ -41,6 +42,7 @@
|
||||||
|
"istio.io/istio/pilot/pkg/util/sets"
|
||||||
|
v3 "istio.io/istio/pilot/pkg/xds/v3"
|
||||||
|
"istio.io/istio/pkg/cluster"
|
||||||
|
+ "istio.io/istio/pkg/config/constants"
|
||||||
|
"istio.io/istio/pkg/security"
|
||||||
|
)
|
||||||
|
|
||||||
|
@@ -332,6 +334,21 @@
|
||||||
|
} else {
|
||||||
|
// Otherwise, just clear the updated configs
|
||||||
|
s.Cache.Clear(req.ConfigsUpdated)
|
||||||
|
+ //Added by ingress
|
||||||
|
+ trimKeyMap := make(map[model.ConfigKey]struct{})
|
||||||
|
+ for configKey := range req.ConfigsUpdated {
|
||||||
|
+ if strings.HasPrefix(configKey.Name, constants.IstioIngressGatewayName+"-") {
|
||||||
|
+ trimKeyMap[model.ConfigKey{
|
||||||
|
+ Kind: configKey.Kind,
|
||||||
|
+ Name: strings.TrimPrefix(configKey.Name, constants.IstioIngressGatewayName+"-"),
|
||||||
|
+ Namespace: configKey.Namespace,
|
||||||
|
+ }] = struct{}{}
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if len(trimKeyMap) > 0 {
|
||||||
|
+ s.Cache.Clear(trimKeyMap)
|
||||||
|
+ }
|
||||||
|
+ //End added by ingress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
diff -Naur istio/pilot/cmd/pilot-agent/status/util/stats.go istio-new/pilot/cmd/pilot-agent/status/util/stats.go
|
||||||
|
--- istio/pilot/cmd/pilot-agent/status/util/stats.go 2024-02-04 18:48:18.000000000 +0800
|
||||||
|
+++ istio-new/pilot/cmd/pilot-agent/status/util/stats.go 2024-02-04 09:35:42.000000000 +0800
|
||||||
|
@@ -37,7 +37,7 @@
|
||||||
|
updateStatsRegex = "^(cluster_manager\\.cds|listener_manager\\.lds)\\.(update_success|update_rejected)$"
|
||||||
|
)
|
||||||
|
|
||||||
|
-var readinessTimeout = time.Second * 3 // Default Readiness timeout. It is set the same in helm charts.
|
||||||
|
+var readinessTimeout = time.Second * 60 // Default Readiness timeout. It is set the same in helm charts.
|
||||||
|
|
||||||
|
type stat struct {
|
||||||
|
name string
|
||||||
|
@@ -105,7 +105,7 @@
|
||||||
|
localHostAddr = "localhost"
|
||||||
|
}
|
||||||
|
|
||||||
|
- stats, err := http.DoHTTPGet(fmt.Sprintf("http://%s:%d/stats?usedonly", localHostAddr, adminPort))
|
||||||
|
+ stats, err := http.DoHTTPGetWithTimeout(fmt.Sprintf("http://%s:%d/stats?usedonly", localHostAddr, adminPort), readinessTimeout)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
338
pkg/cmd/hgctl/code_debug.go
Normal file
338
pkg/cmd/hgctl/code_debug.go
Normal file
@@ -0,0 +1,338 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
package hgctl
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"net"
|
||||||
|
"os"
|
||||||
|
"regexp"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/client-go/tools/clientcmd"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
DefaultIp = "127.0.0.1"
|
||||||
|
DefaultPort = ":15051"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newCodeDebugCmd() *cobra.Command {
|
||||||
|
codeDebugCmd := &cobra.Command{
|
||||||
|
Use: "code-debug",
|
||||||
|
Short: "Start or stop code debug",
|
||||||
|
}
|
||||||
|
|
||||||
|
codeDebugCmd.AddCommand(getStartCodeDebugCmd())
|
||||||
|
codeDebugCmd.AddCommand(getStopCodeDebugCmd())
|
||||||
|
|
||||||
|
return codeDebugCmd
|
||||||
|
}
|
||||||
|
|
||||||
|
func getStartCodeDebugCmd() *cobra.Command {
|
||||||
|
homeDir, err := os.UserHomeDir()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("fail to get user home dir: %v", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
kubeConfigDir := homeDir + "/.kube/config"
|
||||||
|
|
||||||
|
startCodeDebugCmd := &cobra.Command{
|
||||||
|
Use: "start",
|
||||||
|
Aliases: []string{"start"},
|
||||||
|
Short: "Start code debug",
|
||||||
|
Example: "hgctl code-debug start",
|
||||||
|
RunE: func(c *cobra.Command, args []string) error {
|
||||||
|
writer := c.OutOrStdout()
|
||||||
|
|
||||||
|
// wait for user to confirm
|
||||||
|
if !promptCodeDebug(writer, "local grpc address") {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// check profile type is local or not
|
||||||
|
fmt.Fprintf(writer, "Checking profile type...\n")
|
||||||
|
profiles, err := getAllProfiles()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("fail to get all profiles: %v", err)
|
||||||
|
}
|
||||||
|
if len(profiles) == 0 {
|
||||||
|
fmt.Fprintf(writer, "Higress hasn't been installed yet!\n")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
for _, profile := range profiles {
|
||||||
|
if profile.Install != helm.InstallLocalK8s {
|
||||||
|
fmt.Fprintf(writer, "\nHigress needs to be installed locally!\n")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// get kubernetes clientSet
|
||||||
|
fmt.Fprintf(writer, "Getting kubernetes clientset...\n")
|
||||||
|
config, err := clientcmd.BuildConfigFromFlags("", kubeConfigDir)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(writer, "fail to build config from kubeconfig: %v", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
clientSet, err := kubernetes.NewForConfig(config)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(writer, "fail to create kubernetes clientset: %v", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// get non-loopback IPv4 address
|
||||||
|
fmt.Fprintf(writer, "Getting non-loopback IPv4 address...\n")
|
||||||
|
ip, err := getNonLoopbackIPv4()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(writer, "fail to get non-loopback IPv4 address: %v", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// update the xds address in higress-config ConfigMap
|
||||||
|
// and trigger rollout for higress-controller and higress-gateway deployments
|
||||||
|
fmt.Fprintf(writer, "Updating xds address in higress-config ConfigMap "+
|
||||||
|
"and triggering rollout for higress-controller and higress-gateway deployments...\n")
|
||||||
|
err = updateXdsIpAndRollout(clientSet, ip, DefaultPort)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(writer, "fail to update xds address in higress-config ConfigMap: %v", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Fprintf(writer, "Code debug started!\n")
|
||||||
|
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
startCodeDebugCmd.PersistentFlags().StringVar(&kubeConfigDir, "kubeconfig", kubeConfigDir,
|
||||||
|
"Use a Kubernetes configuration file instead of in-cluster configuration")
|
||||||
|
|
||||||
|
return startCodeDebugCmd
|
||||||
|
}
|
||||||
|
|
||||||
|
func getStopCodeDebugCmd() *cobra.Command {
|
||||||
|
homeDir, err := os.UserHomeDir()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("fail to get user home dir: %v", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
kubeConfigDir := homeDir + "/.kube/config"
|
||||||
|
|
||||||
|
stopCodeDebugCmd := &cobra.Command{
|
||||||
|
Use: "stop",
|
||||||
|
Aliases: []string{"stop"},
|
||||||
|
Short: "Stop code debug",
|
||||||
|
Example: "hgctl code-debug stop",
|
||||||
|
RunE: func(c *cobra.Command, args []string) error {
|
||||||
|
// wait for user to confirm
|
||||||
|
writer := c.OutOrStdout()
|
||||||
|
if !promptCodeDebug(writer, "default grpc address") {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// check profile type is local or not
|
||||||
|
fmt.Fprintf(writer, "Checking profile type...\n")
|
||||||
|
profiles, err := getAllProfiles()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("fail to get all profiles: %v", err)
|
||||||
|
}
|
||||||
|
if len(profiles) == 0 {
|
||||||
|
fmt.Fprintf(writer, "Higress hasn't been installed yet!\n")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
for _, profile := range profiles {
|
||||||
|
if profile.Install != helm.InstallLocalK8s {
|
||||||
|
fmt.Fprintf(writer, "\nHigress needs to be installed locally!\n")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// get kubernetes clientSet
|
||||||
|
fmt.Fprintf(writer, "Getting kubernetes clientset...\n")
|
||||||
|
config, err := clientcmd.BuildConfigFromFlags("", kubeConfigDir)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(writer, "fail to build config from kubeconfig: %v", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
clientSet, err := kubernetes.NewForConfig(config)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(writer, "fail to create kubernetes clientset: %v", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// recover the xds address in higress-config ConfigMap
|
||||||
|
// and trigger rollout for higress-controller and higress-gateway deployments
|
||||||
|
fmt.Fprintf(writer, "Recovering xds address in higress-config ConfigMap "+
|
||||||
|
"and triggering rollout for higress-controller and higress-gateway deployments...\n")
|
||||||
|
err = updateXdsIpAndRollout(clientSet, DefaultIp, DefaultPort)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(writer, "fail to recover xds address in higress-config ConfigMap: %v", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Fprintf(writer, "Code debug stopped!\n")
|
||||||
|
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
stopCodeDebugCmd.PersistentFlags().StringVar(&kubeConfigDir, "kubeconfig", kubeConfigDir,
|
||||||
|
"Use a Kubernetes configuration file instead of in-cluster configuration")
|
||||||
|
|
||||||
|
return stopCodeDebugCmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// getNonLoopbackIPv4 returns the first non-loopback IPv4 address of the host.
|
||||||
|
func getNonLoopbackIPv4() (string, error) {
|
||||||
|
// get all network interfaces
|
||||||
|
interfaces, err := net.Interfaces()
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
// traverse all network interfaces
|
||||||
|
for _, i := range interfaces {
|
||||||
|
// exclude loopback interface and virtual interface
|
||||||
|
if i.Flags&net.FlagLoopback == 0 && i.Flags&net.FlagUp != 0 {
|
||||||
|
// get all addresses of the interface
|
||||||
|
addrs, err := i.Addrs()
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
// traverse all addresses of the interface
|
||||||
|
for _, addr := range addrs {
|
||||||
|
// check the type of the address is IP address
|
||||||
|
if ipnet, ok := addr.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
|
||||||
|
// check the IP address is IPv4 address
|
||||||
|
if ipnet.IP.To4() != nil {
|
||||||
|
return ipnet.IP.String(), nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "", fmt.Errorf("Non-loopback IPv4 address not found")
|
||||||
|
}
|
||||||
|
|
||||||
|
// updateXdsIpAndRollout updates the xds address in higress-config ConfigMap
|
||||||
|
// and triggers rollout for higress-controller and higress-gateway deployments
|
||||||
|
// also can recover the xds address in higress-config ConfigMap
|
||||||
|
func updateXdsIpAndRollout(c *kubernetes.Clientset, ip string, port string) error {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
// Get higress-config ConfigMap
|
||||||
|
cm, err := c.CoreV1().ConfigMaps("higress-system").Get(ctx, "higress-config", metav1.GetOptions{})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update mesh field in higress-config ConfigMap
|
||||||
|
if _, ok := cm.Data["mesh"]; !ok {
|
||||||
|
return fmt.Errorf("mesh not found in configmap higress-config")
|
||||||
|
}
|
||||||
|
mesh := cm.Data["mesh"]
|
||||||
|
newMesh, err := replaceXDSAddress(mesh, ip, port)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
cm.Data["mesh"] = newMesh
|
||||||
|
|
||||||
|
// Update higress-config ConfigMap
|
||||||
|
_, err = c.CoreV1().ConfigMaps("higress-system").Update(ctx, cm, metav1.UpdateOptions{})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trigger rollout for higress-controller deployment
|
||||||
|
err = triggerRollout(c, "higress-controller")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trigger rollout for higress-gateway deployment
|
||||||
|
err = triggerRollout(c, "higress-gateway")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// triggerRollout triggers rollout for the specified deployment
|
||||||
|
func triggerRollout(clientset *kubernetes.Clientset, deploymentName string) error {
|
||||||
|
deploymentsClient := clientset.AppsV1().Deployments("higress-system")
|
||||||
|
|
||||||
|
// Get the deployment
|
||||||
|
deployment, err := deploymentsClient.Get(context.TODO(), deploymentName, metav1.GetOptions{})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Increment the deployment's revision to trigger a rollout
|
||||||
|
deployment.Spec.Template.ObjectMeta.Labels["version"] = time.Now().Format("20060102150405")
|
||||||
|
|
||||||
|
// Update the deployment
|
||||||
|
_, err = deploymentsClient.Update(context.TODO(), deployment, metav1.UpdateOptions{})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// replaceXDSAddress replaces the xds address in the config string with new IP and Port
|
||||||
|
func replaceXDSAddress(configString, newIP, newPort string) (string, error) {
|
||||||
|
// define the regular expression to match xds address
|
||||||
|
xdsRegex := regexp.MustCompile(`xds://[0-9.:]+`)
|
||||||
|
|
||||||
|
// find the first match
|
||||||
|
match := xdsRegex.FindString(configString)
|
||||||
|
if match == "" {
|
||||||
|
// if no match, return error
|
||||||
|
return "", fmt.Errorf("no xds address found in config string")
|
||||||
|
}
|
||||||
|
|
||||||
|
// replace xds address with new IP and Port
|
||||||
|
newXDSAddress := fmt.Sprintf("xds://%s%s", newIP, newPort)
|
||||||
|
result := xdsRegex.ReplaceAllString(configString, newXDSAddress)
|
||||||
|
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// promptCodeDebug prompts user to confirm code debug
|
||||||
|
func promptCodeDebug(writer io.Writer, t string) bool {
|
||||||
|
answer := ""
|
||||||
|
for {
|
||||||
|
fmt.Fprintf(writer, "This will start set xds address to %s in higress-config ConfigMap "+
|
||||||
|
"and trigger rollout for higress-controller and higress-gateway deployments. \nProceed? (y/N)", t)
|
||||||
|
fmt.Scanln(&answer)
|
||||||
|
if answer == "y" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if answer == "N" {
|
||||||
|
fmt.Fprintf(writer, "Cancelled.\n")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
232
pkg/cmd/hgctl/completion.go
Normal file
232
pkg/cmd/hgctl/completion.go
Normal file
@@ -0,0 +1,232 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
package hgctl
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
const completionDesc = `
|
||||||
|
Generate autocompletion scripts for hgctl for the specified shell.
|
||||||
|
`
|
||||||
|
|
||||||
|
const bashCompDesc = `
|
||||||
|
Generate the autocompletion script for the bash shell.
|
||||||
|
|
||||||
|
This script depends on the 'bash-completion' package.
|
||||||
|
If it is not installed already, you can install it via your OS's package manager.
|
||||||
|
|
||||||
|
To load completions in your current shell session:
|
||||||
|
|
||||||
|
source <(hgctl completion bash)
|
||||||
|
|
||||||
|
To load completions for every new session, execute once:
|
||||||
|
|
||||||
|
#### Linux:
|
||||||
|
|
||||||
|
hgctl completion bash > /etc/bash_completion.d/hgctl
|
||||||
|
|
||||||
|
#### macOS:
|
||||||
|
|
||||||
|
hgctl completion bash > $(brew --prefix)/etc/bash_completion.d/hgctl
|
||||||
|
|
||||||
|
You will need to start a new shell for this setup to take effect.
|
||||||
|
`
|
||||||
|
|
||||||
|
const zshCompDesc = `
|
||||||
|
Generate the autocompletion script for the zsh shell.
|
||||||
|
|
||||||
|
If shell completion is not already enabled in your environment you will need
|
||||||
|
to enable it. You can execute the following once:
|
||||||
|
|
||||||
|
echo "autoload -U compinit; compinit" >> ~/.zshrc
|
||||||
|
|
||||||
|
To load completions in your current shell session:
|
||||||
|
|
||||||
|
source <(hgctl completion zsh); compdef _hgctl hgctl
|
||||||
|
|
||||||
|
To load completions for every new session, execute once:
|
||||||
|
|
||||||
|
#### Linux:
|
||||||
|
|
||||||
|
hgctl completion zsh > "${fpath[1]}/_hgctl"
|
||||||
|
|
||||||
|
#### macOS:
|
||||||
|
|
||||||
|
hgctl completion zsh > $(brew --prefix)/share/zsh/site-functions/_hgctl
|
||||||
|
|
||||||
|
You will need to start a new shell for this setup to take effect.
|
||||||
|
`
|
||||||
|
|
||||||
|
const fishCompDesc = `
|
||||||
|
Generate the autocompletion script for the fish shell.
|
||||||
|
|
||||||
|
To load completions in your current shell session:
|
||||||
|
|
||||||
|
hgctl completion fish | source
|
||||||
|
|
||||||
|
To load completions for every new session, execute once:
|
||||||
|
|
||||||
|
hgctl completion fish > ~/.config/fish/completions/hgctl.fish
|
||||||
|
|
||||||
|
You will need to start a new shell for this setup to take effect.
|
||||||
|
`
|
||||||
|
|
||||||
|
const powershellCompDesc = `
|
||||||
|
Generate the autocompletion script for powershell.
|
||||||
|
|
||||||
|
To load completions in your current shell session:
|
||||||
|
|
||||||
|
hgctl completion powershell | Out-String | Invoke-Expression
|
||||||
|
|
||||||
|
To load completions for every new session, add the output of the above command
|
||||||
|
to your powershell profile.
|
||||||
|
`
|
||||||
|
|
||||||
|
const (
|
||||||
|
noDescFlagName = "no-descriptions"
|
||||||
|
noDescFlagText = "disable completion descriptions"
|
||||||
|
)
|
||||||
|
|
||||||
|
var disableCompDescriptions bool
|
||||||
|
|
||||||
|
// newCompletionCmd creates a new completion command for hgctl
|
||||||
|
func newCompletionCmd(out io.Writer) *cobra.Command {
|
||||||
|
cmd := &cobra.Command{
|
||||||
|
Use: "completion",
|
||||||
|
Short: "generate autocompletion scripts for the specified shell",
|
||||||
|
Long: completionDesc,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
}
|
||||||
|
|
||||||
|
bash := &cobra.Command{
|
||||||
|
Use: "bash",
|
||||||
|
Short: "generate autocompletion script for bash",
|
||||||
|
Long: bashCompDesc,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
ValidArgsFunction: noCompletions,
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
return runCompletionBash(out, cmd)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
bash.Flags().BoolVar(&disableCompDescriptions, noDescFlagName, false, noDescFlagText)
|
||||||
|
|
||||||
|
zsh := &cobra.Command{
|
||||||
|
Use: "zsh",
|
||||||
|
Short: "generate autocompletion script for zsh",
|
||||||
|
Long: zshCompDesc,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
ValidArgsFunction: noCompletions,
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
return runCompletionZsh(out, cmd)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
zsh.Flags().BoolVar(&disableCompDescriptions, noDescFlagName, false, noDescFlagText)
|
||||||
|
|
||||||
|
fish := &cobra.Command{
|
||||||
|
Use: "fish",
|
||||||
|
Short: "generate autocompletion script for fish",
|
||||||
|
Long: fishCompDesc,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
ValidArgsFunction: noCompletions,
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
return runCompletionFish(out, cmd)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
fish.Flags().BoolVar(&disableCompDescriptions, noDescFlagName, false, noDescFlagText)
|
||||||
|
|
||||||
|
powershell := &cobra.Command{
|
||||||
|
Use: "powershell",
|
||||||
|
Short: "generate autocompletion script for powershell",
|
||||||
|
Long: powershellCompDesc,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
ValidArgsFunction: noCompletions,
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
return runCompletionPowershell(out, cmd)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
powershell.Flags().BoolVar(&disableCompDescriptions, noDescFlagName, false, noDescFlagText)
|
||||||
|
|
||||||
|
cmd.AddCommand(bash, zsh, fish, powershell)
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
func runCompletionBash(out io.Writer, cmd *cobra.Command) error {
|
||||||
|
err := cmd.Root().GenBashCompletionV2(out, !disableCompDescriptions)
|
||||||
|
|
||||||
|
// In case the user renamed the hgctl binary, we hook the new binary name to the completion function
|
||||||
|
if binary := filepath.Base(os.Args[0]); binary != "hgctl" {
|
||||||
|
renamedBinaryHook := `
|
||||||
|
# Hook the command used to generate the completion script
|
||||||
|
# to the hgctl completion function to handle the case where
|
||||||
|
# the user renamed the hgctl binary
|
||||||
|
if [[ $(type -t compopt) = "builtin" ]]; then
|
||||||
|
complete -o default -F __start_hgctl %[1]s
|
||||||
|
else
|
||||||
|
complete -o default -o nospace -F __start_hgctl %[1]s
|
||||||
|
fi
|
||||||
|
`
|
||||||
|
fmt.Fprintf(out, renamedBinaryHook, binary)
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func runCompletionZsh(out io.Writer, cmd *cobra.Command) error {
|
||||||
|
var err error
|
||||||
|
if disableCompDescriptions {
|
||||||
|
err = cmd.Root().GenZshCompletionNoDesc(out)
|
||||||
|
} else {
|
||||||
|
err = cmd.Root().GenZshCompletion(out)
|
||||||
|
}
|
||||||
|
|
||||||
|
// In case the user renamed the hgctl binary, we hook the new binary name to the completion function
|
||||||
|
if binary := filepath.Base(os.Args[0]); binary != "hgctl" {
|
||||||
|
renamedBinaryHook := `
|
||||||
|
# Hook the command used to generate the completion script
|
||||||
|
# to the hgctl completion function to handle the case where
|
||||||
|
# the user renamed the hgctl binary
|
||||||
|
compdef _hgctl %[1]s
|
||||||
|
`
|
||||||
|
fmt.Fprintf(out, renamedBinaryHook, binary)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cobra doesn't source zsh completion file, explicitly doing it here
|
||||||
|
fmt.Fprintf(out, "compdef _hgctl hgctl")
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func runCompletionFish(out io.Writer, cmd *cobra.Command) error {
|
||||||
|
return cmd.Root().GenFishCompletion(out, !disableCompDescriptions)
|
||||||
|
}
|
||||||
|
|
||||||
|
func runCompletionPowershell(out io.Writer, cmd *cobra.Command) error {
|
||||||
|
if disableCompDescriptions {
|
||||||
|
return cmd.Root().GenPowerShellCompletion(out)
|
||||||
|
}
|
||||||
|
return cmd.Root().GenPowerShellCompletionWithDesc(out)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to disable file completion
|
||||||
|
func noCompletions(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||||
|
return nil, cobra.ShellCompDirectiveNoFileComp
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ package hgctl
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/alibaba/higress/cmd/hgctl/config"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
||||||
)
|
)
|
||||||
@@ -45,21 +46,20 @@ func bootstrapConfigCmd() *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runBootstrapConfig(c *cobra.Command, args []string) error {
|
func runBootstrapConfig(c *cobra.Command, args []string) error {
|
||||||
configDump, err := retrieveConfigDump(args, false)
|
if len(args) != 0 {
|
||||||
|
podName = args[0]
|
||||||
|
}
|
||||||
|
envoyConfig, err := config.GetEnvoyConfig(&config.GetEnvoyConfigOptions{
|
||||||
|
PodName: podName,
|
||||||
|
PodNamespace: podNamespace,
|
||||||
|
BindAddress: bindAddress,
|
||||||
|
Output: output,
|
||||||
|
EnvoyConfigType: config.BootstrapEnvoyConfigType,
|
||||||
|
IncludeEds: true,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
_, err = fmt.Fprintln(c.OutOrStdout(), string(envoyConfig))
|
||||||
bootstrap, err := GetXDSResource(BootstrapEnvoyConfigType, configDump)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
out, err := formatGatewayConfig(bootstrap, output)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = fmt.Fprintln(c.OutOrStdout(), string(out))
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,13 @@
|
|||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package hgctl
|
package hgctl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/alibaba/higress/cmd/hgctl/config"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
||||||
)
|
)
|
||||||
@@ -44,21 +46,20 @@ func clusterConfigCmd() *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runClusterConfig(c *cobra.Command, args []string) error {
|
func runClusterConfig(c *cobra.Command, args []string) error {
|
||||||
configDump, err := retrieveConfigDump(args, false)
|
if len(args) != 0 {
|
||||||
|
podName = args[0]
|
||||||
|
}
|
||||||
|
envoyConfig, err := config.GetEnvoyConfig(&config.GetEnvoyConfigOptions{
|
||||||
|
PodName: podName,
|
||||||
|
PodNamespace: podNamespace,
|
||||||
|
BindAddress: bindAddress,
|
||||||
|
Output: output,
|
||||||
|
EnvoyConfigType: config.ClusterEnvoyConfigType,
|
||||||
|
IncludeEds: true,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
_, err = fmt.Fprintln(c.OutOrStdout(), string(envoyConfig))
|
||||||
cluster, err := GetXDSResource(ClusterEnvoyConfigType, configDump)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
out, err := formatGatewayConfig(cluster, output)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = fmt.Fprintln(c.OutOrStdout(), string(out))
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,11 +17,23 @@ package hgctl
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/alibaba/higress/cmd/hgctl/config"
|
||||||
"github.com/alibaba/higress/pkg/cmd/options"
|
"github.com/alibaba/higress/pkg/cmd/options"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
output string
|
||||||
|
podName string
|
||||||
|
podNamespace string
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
defaultProxyAdminPort = 15000
|
||||||
|
containerName = "envoy"
|
||||||
|
)
|
||||||
|
|
||||||
func newConfigCommand() *cobra.Command {
|
func newConfigCommand() *cobra.Command {
|
||||||
cfgCommand := &cobra.Command{
|
cfgCommand := &cobra.Command{
|
||||||
Use: "gateway-config",
|
Use: "gateway-config",
|
||||||
@@ -69,11 +81,20 @@ func allConfigCmd() *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runAllConfig(c *cobra.Command, args []string) error {
|
func runAllConfig(c *cobra.Command, args []string) error {
|
||||||
configDump, err := retrieveConfigDump(args, true)
|
if len(args) != 0 {
|
||||||
|
podName = args[0]
|
||||||
|
}
|
||||||
|
envoyConfig, err := config.GetEnvoyConfig(&config.GetEnvoyConfigOptions{
|
||||||
|
PodName: podName,
|
||||||
|
PodNamespace: podNamespace,
|
||||||
|
BindAddress: bindAddress,
|
||||||
|
Output: output,
|
||||||
|
EnvoyConfigType: config.AllEnvoyConfigType,
|
||||||
|
IncludeEds: true,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
_, err = fmt.Fprintln(c.OutOrStdout(), string(envoyConfig))
|
||||||
_, err = fmt.Fprintln(c.OutOrStdout(), string(configDump))
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ package hgctl
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/alibaba/higress/cmd/hgctl/config"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
||||||
)
|
)
|
||||||
@@ -45,21 +46,20 @@ func endpointConfigCmd() *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runEndpointConfig(c *cobra.Command, args []string) error {
|
func runEndpointConfig(c *cobra.Command, args []string) error {
|
||||||
configDump, err := retrieveConfigDump(args, true)
|
if len(args) != 0 {
|
||||||
|
podName = args[0]
|
||||||
|
}
|
||||||
|
envoyConfig, err := config.GetEnvoyConfig(&config.GetEnvoyConfigOptions{
|
||||||
|
PodName: podName,
|
||||||
|
PodNamespace: podNamespace,
|
||||||
|
BindAddress: bindAddress,
|
||||||
|
Output: output,
|
||||||
|
EnvoyConfigType: config.EndpointEnvoyConfigType,
|
||||||
|
IncludeEds: true,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
_, err = fmt.Fprintln(c.OutOrStdout(), string(envoyConfig))
|
||||||
endpoint, err := GetXDSResource(EndpointEnvoyConfigType, configDump)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
out, err := formatGatewayConfig(endpoint, output)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = fmt.Fprintln(c.OutOrStdout(), string(out))
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ package hgctl
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/alibaba/higress/cmd/hgctl/config"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
||||||
)
|
)
|
||||||
@@ -45,21 +46,20 @@ func listenerConfigCmd() *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runListenerConfig(c *cobra.Command, args []string) error {
|
func runListenerConfig(c *cobra.Command, args []string) error {
|
||||||
configDump, err := retrieveConfigDump(args, false)
|
if len(args) != 0 {
|
||||||
|
podName = args[0]
|
||||||
|
}
|
||||||
|
envoyConfig, err := config.GetEnvoyConfig(&config.GetEnvoyConfigOptions{
|
||||||
|
PodName: podName,
|
||||||
|
PodNamespace: podNamespace,
|
||||||
|
BindAddress: bindAddress,
|
||||||
|
Output: output,
|
||||||
|
EnvoyConfigType: config.ListenerEnvoyConfigType,
|
||||||
|
IncludeEds: true,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
_, err = fmt.Fprintln(c.OutOrStdout(), string(envoyConfig))
|
||||||
listener, err := GetXDSResource(ListenerEnvoyConfigType, configDump)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
out, err := formatGatewayConfig(listener, output)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = fmt.Fprintln(c.OutOrStdout(), string(out))
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ package hgctl
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/alibaba/higress/cmd/hgctl/config"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
||||||
)
|
)
|
||||||
@@ -45,21 +46,20 @@ func routeConfigCmd() *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runRouteConfig(c *cobra.Command, args []string) error {
|
func runRouteConfig(c *cobra.Command, args []string) error {
|
||||||
configDump, err := retrieveConfigDump(args, false)
|
if len(args) != 0 {
|
||||||
|
podName = args[0]
|
||||||
|
}
|
||||||
|
envoyConfig, err := config.GetEnvoyConfig(&config.GetEnvoyConfigOptions{
|
||||||
|
PodName: podName,
|
||||||
|
PodNamespace: podNamespace,
|
||||||
|
BindAddress: bindAddress,
|
||||||
|
Output: output,
|
||||||
|
EnvoyConfigType: config.RouteEnvoyConfigType,
|
||||||
|
IncludeEds: true,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
_, err = fmt.Fprintln(c.OutOrStdout(), string(envoyConfig))
|
||||||
route, err := GetXDSResource(RouteEnvoyConfigType, configDump)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
out, err := formatGatewayConfig(route, output)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = fmt.Fprintln(c.OutOrStdout(), string(out))
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,15 +15,20 @@
|
|||||||
package hgctl
|
package hgctl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/kubernetes"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/kubernetes"
|
||||||
"github.com/alibaba/higress/pkg/cmd/options"
|
"github.com/alibaba/higress/pkg/cmd/options"
|
||||||
|
"github.com/docker/cli/cli/command"
|
||||||
|
"github.com/docker/cli/cli/flags"
|
||||||
|
types2 "github.com/docker/docker/api/types"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
@@ -49,6 +54,8 @@ var (
|
|||||||
envoyDashNs = ""
|
envoyDashNs = ""
|
||||||
|
|
||||||
proxyAdminPort int
|
proxyAdminPort int
|
||||||
|
|
||||||
|
docker = false
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -81,6 +88,7 @@ func newDashboardCmd() *cobra.Command {
|
|||||||
"Default is true which means hgctl dashboard will always open a browser to view the dashboard.")
|
"Default is true which means hgctl dashboard will always open a browser to view the dashboard.")
|
||||||
dashboardCmd.PersistentFlags().StringVarP(&addonNamespace, "namespace", "n", "higress-system",
|
dashboardCmd.PersistentFlags().StringVarP(&addonNamespace, "namespace", "n", "higress-system",
|
||||||
"Namespace where the addon is running, if not specified, higress-system would be used")
|
"Namespace where the addon is running, if not specified, higress-system would be used")
|
||||||
|
dashboardCmd.PersistentFlags().StringVarP(&bindAddress, "listen", "l", "localhost", "The address to bind to")
|
||||||
|
|
||||||
prom := promDashCmd()
|
prom := promDashCmd()
|
||||||
prom.PersistentFlags().IntVar(&promPort, "ui-port", defaultPrometheusPort, "The component dashboard UI port.")
|
prom.PersistentFlags().IntVar(&promPort, "ui-port", defaultPrometheusPort, "The component dashboard UI port.")
|
||||||
@@ -91,7 +99,7 @@ func newDashboardCmd() *cobra.Command {
|
|||||||
dashboardCmd.AddCommand(graf)
|
dashboardCmd.AddCommand(graf)
|
||||||
|
|
||||||
envoy := envoyDashCmd()
|
envoy := envoyDashCmd()
|
||||||
envoy.PersistentFlags().StringVarP(&labelSelector, "selector", "l", "app=higress-gateway", "Label selector")
|
envoy.PersistentFlags().StringVarP(&labelSelector, "selector", "s", "app=higress-gateway", "Label selector")
|
||||||
envoy.PersistentFlags().StringVarP(&envoyDashNs, "namespace", "n", "",
|
envoy.PersistentFlags().StringVarP(&envoyDashNs, "namespace", "n", "",
|
||||||
"Namespace where the addon is running, if not specified, higress-system would be used")
|
"Namespace where the addon is running, if not specified, higress-system would be used")
|
||||||
envoy.PersistentFlags().IntVar(&proxyAdminPort, "ui-port", defaultProxyAdminPort, "The component dashboard UI port.")
|
envoy.PersistentFlags().IntVar(&proxyAdminPort, "ui-port", defaultProxyAdminPort, "The component dashboard UI port.")
|
||||||
@@ -99,6 +107,7 @@ func newDashboardCmd() *cobra.Command {
|
|||||||
|
|
||||||
consoleCmd := consoleDashCmd()
|
consoleCmd := consoleDashCmd()
|
||||||
consoleCmd.PersistentFlags().IntVar(&consolePort, "ui-port", defaultConsolePort, "The component dashboard UI port.")
|
consoleCmd.PersistentFlags().IntVar(&consolePort, "ui-port", defaultConsolePort, "The component dashboard UI port.")
|
||||||
|
consoleCmd.PersistentFlags().BoolVar(&docker, "docker", false, "Search higress console from docker")
|
||||||
dashboardCmd.AddCommand(consoleCmd)
|
dashboardCmd.AddCommand(consoleCmd)
|
||||||
|
|
||||||
controllerDebugCmd := controllerDebugCmd()
|
controllerDebugCmd := controllerDebugCmd()
|
||||||
@@ -156,18 +165,23 @@ func consoleDashCmd() *cobra.Command {
|
|||||||
hgctl dash console
|
hgctl dash console
|
||||||
hgctl d console`,
|
hgctl d console`,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
if docker {
|
||||||
|
return accessDocker(cmd)
|
||||||
|
}
|
||||||
client, err := kubernetes.NewCLIClient(options.DefaultConfigFlags.ToRawKubeConfigLoader())
|
client, err := kubernetes.NewCLIClient(options.DefaultConfigFlags.ToRawKubeConfigLoader())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("build CLI client fail: %w", err)
|
fmt.Printf("build kubernetes CLI client fail: %v\ntry to access docker container\n", err)
|
||||||
|
return accessDocker(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
pl, err := client.PodsForSelector(addonNamespace, "app.kubernetes.io/name=higress-console")
|
pl, err := client.PodsForSelector(addonNamespace, "app.kubernetes.io/name=higress-console")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("not able to locate console pod: %v", err)
|
fmt.Printf("build kubernetes CLI client fail: %v\ntry to access docker container\n", err)
|
||||||
|
return accessDocker(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(pl.Items) < 1 {
|
if len(pl.Items) < 1 {
|
||||||
return errors.New("no higress console pods found")
|
fmt.Printf("no higress console pods found\ntry to access docker container\n")
|
||||||
|
return accessDocker(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
// only use the first pod in the list
|
// only use the first pod in the list
|
||||||
@@ -179,6 +193,32 @@ func consoleDashCmd() *cobra.Command {
|
|||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// accessDocker access docker container
|
||||||
|
func accessDocker(cmd *cobra.Command) error {
|
||||||
|
dockerCli, err := command.NewDockerCli(command.WithCombinedStreams(os.Stdout))
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("build docker CLI client fail: %w", err)
|
||||||
|
}
|
||||||
|
err = dockerCli.Initialize(flags.NewClientOptions())
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("docker client initialize fail: %w", err)
|
||||||
|
}
|
||||||
|
apiClient := dockerCli.Client()
|
||||||
|
list, err := apiClient.ContainerList(context.Background(), types2.ContainerListOptions{})
|
||||||
|
for _, container := range list {
|
||||||
|
for i, name := range container.Names {
|
||||||
|
if strings.Contains(name, "higress-console") {
|
||||||
|
port := container.Ports[i].PublicPort
|
||||||
|
// not support define ip address
|
||||||
|
url := fmt.Sprintf("http://localhost:%d", port)
|
||||||
|
openBrowser(url, cmd.OutOrStdout(), browser)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return errors.New("no higress console container found")
|
||||||
|
}
|
||||||
|
|
||||||
// port-forward to Higress System Grafana; open browser
|
// port-forward to Higress System Grafana; open browser
|
||||||
func grafanaDashCmd() *cobra.Command {
|
func grafanaDashCmd() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
@@ -324,7 +364,7 @@ func portForward(podName, namespace, flavor, urlFormat, localAddress string, rem
|
|||||||
var err error
|
var err error
|
||||||
for _, localPort := range portPrefs {
|
for _, localPort := range portPrefs {
|
||||||
var fw kubernetes.PortForwarder
|
var fw kubernetes.PortForwarder
|
||||||
fw, err = kubernetes.NewLocalPortForwarder(client, types.NamespacedName{Namespace: namespace, Name: podName}, localPort, remotePort)
|
fw, err = kubernetes.NewLocalPortForwarder(client, types.NamespacedName{Namespace: namespace, Name: podName}, localPort, remotePort, bindAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not build port forwarder for %s: %v", flavor, err)
|
return fmt.Errorf("could not build port forwarder for %s: %v", flavor, err)
|
||||||
}
|
}
|
||||||
@@ -361,8 +401,6 @@ func ClosePortForwarderOnInterrupt(fw kubernetes.PortForwarder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func openBrowser(url string, writer io.Writer, browser bool) {
|
func openBrowser(url string, writer io.Writer, browser bool) {
|
||||||
var err error
|
|
||||||
|
|
||||||
fmt.Fprintf(writer, "%s\n", url)
|
fmt.Fprintf(writer, "%s\n", url)
|
||||||
|
|
||||||
if !browser {
|
if !browser {
|
||||||
@@ -372,16 +410,30 @@ func openBrowser(url string, writer io.Writer, browser bool) {
|
|||||||
|
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "linux":
|
case "linux":
|
||||||
err = exec.Command("xdg-open", url).Start()
|
openCommand(writer, "xdg-open", url)
|
||||||
case "windows":
|
case "windows":
|
||||||
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
|
openCommand(writer, "rundll32", "url.dll,FileProtocolHandler", url)
|
||||||
case "darwin":
|
case "darwin":
|
||||||
err = exec.Command("open", url).Start()
|
openCommand(writer, "open", url)
|
||||||
default:
|
default:
|
||||||
fmt.Fprintf(writer, "Unsupported platform %q; open %s in your browser.\n", runtime.GOOS, url)
|
fmt.Fprintf(writer, "Unsupported platform %q; open %s in your browser.\n", runtime.GOOS, url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func openCommand(writer io.Writer, command string, args ...string) {
|
||||||
|
_, err := exec.LookPath(command)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(writer, "Failed to open browser; open %s in your browser.\nError: %s\n", url, err.Error())
|
if errors.Is(err, exec.ErrNotFound) {
|
||||||
|
fmt.Fprintf(writer, "Could not open your browser. Please open it maually.\n")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Fprintf(writer, "Failed to open browser; open %s in your browser.\nError: %s\n", args[0], err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err = exec.Command(command, args...).Start()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(writer, "Failed to open browser; open %s in your browser.\nError: %s\n", args[0], err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -318,7 +318,45 @@ func GenProfile(profileOrPath, fileOverlayYAML string, setFlags []string) (strin
|
|||||||
return "", nil, err
|
return "", nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
finalProfile.InstallPackagePath = installPackagePath
|
if len(installPackagePath) > 0 {
|
||||||
|
finalProfile.InstallPackagePath = installPackagePath
|
||||||
|
}
|
||||||
|
|
||||||
|
if finalProfile.Profile == "" {
|
||||||
|
finalProfile.Profile = DefaultProfileName
|
||||||
|
}
|
||||||
|
return util.ToYAML(finalProfile), finalProfile, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func GenProfileFromProfileContent(profileContent, fileOverlayYAML string, setFlags []string) (string, *Profile, error) {
|
||||||
|
installPackagePath, err := getInstallPackagePath(fileOverlayYAML)
|
||||||
|
if err != nil {
|
||||||
|
return "", nil, err
|
||||||
|
}
|
||||||
|
if sfp := GetValueForSetFlag(setFlags, "installPackagePath"); sfp != "" {
|
||||||
|
// set flag installPackagePath has the highest precedence, if set.
|
||||||
|
installPackagePath = sfp
|
||||||
|
}
|
||||||
|
|
||||||
|
// Combine file and --set overlays and translate any K8s settings in values to Profile format
|
||||||
|
overlayYAML, err := overlaySetFlagValues(fileOverlayYAML, setFlags)
|
||||||
|
if err != nil {
|
||||||
|
return "", nil, err
|
||||||
|
}
|
||||||
|
// Merge user file and --set flags.
|
||||||
|
outYAML, err := util.OverlayYAML(profileContent, overlayYAML)
|
||||||
|
if err != nil {
|
||||||
|
return "", nil, fmt.Errorf("could not overlay user config over base: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
finalProfile, err := UnmarshalProfile(outYAML)
|
||||||
|
if err != nil {
|
||||||
|
return "", nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(installPackagePath) > 0 {
|
||||||
|
finalProfile.InstallPackagePath = installPackagePath
|
||||||
|
}
|
||||||
|
|
||||||
if finalProfile.Profile == "" {
|
if finalProfile.Profile == "" {
|
||||||
finalProfile.Profile = DefaultProfileName
|
finalProfile.Profile = DefaultProfileName
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ const (
|
|||||||
type Profile struct {
|
type Profile struct {
|
||||||
Profile string `json:"profile,omitempty"`
|
Profile string `json:"profile,omitempty"`
|
||||||
InstallPackagePath string `json:"installPackagePath,omitempty"`
|
InstallPackagePath string `json:"installPackagePath,omitempty"`
|
||||||
|
HigressVersion string `json:"higressVersion,omitempty"`
|
||||||
Global ProfileGlobal `json:"global,omitempty"`
|
Global ProfileGlobal `json:"global,omitempty"`
|
||||||
Console ProfileConsole `json:"console,omitempty"`
|
Console ProfileConsole `json:"console,omitempty"`
|
||||||
Gateway ProfileGateway `json:"gateway,omitempty"`
|
Gateway ProfileGateway `json:"gateway,omitempty"`
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import (
|
|||||||
"helm.sh/helm/v3/pkg/engine"
|
"helm.sh/helm/v3/pkg/engine"
|
||||||
"helm.sh/helm/v3/pkg/getter"
|
"helm.sh/helm/v3/pkg/getter"
|
||||||
"helm.sh/helm/v3/pkg/repo"
|
"helm.sh/helm/v3/pkg/repo"
|
||||||
|
"k8s.io/client-go/rest"
|
||||||
"sigs.k8s.io/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -134,6 +135,12 @@ type RendererOptions struct {
|
|||||||
// fields for RemoteRenderer
|
// fields for RemoteRenderer
|
||||||
Version string
|
Version string
|
||||||
RepoURL string
|
RepoURL string
|
||||||
|
|
||||||
|
// Capabilities
|
||||||
|
Capabilities *chartutil.Capabilities
|
||||||
|
|
||||||
|
// rest config
|
||||||
|
restConfig *rest.Config
|
||||||
}
|
}
|
||||||
|
|
||||||
type RendererOption func(*RendererOptions)
|
type RendererOption func(*RendererOptions)
|
||||||
@@ -174,6 +181,18 @@ func WithRepoURL(repo string) RendererOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WithCapabilities(capabilities *chartutil.Capabilities) RendererOption {
|
||||||
|
return func(opts *RendererOptions) {
|
||||||
|
opts.Capabilities = capabilities
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func WithRestConfig(config *rest.Config) RendererOption {
|
||||||
|
return func(opts *RendererOptions) {
|
||||||
|
opts.restConfig = config
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// LocalFileRenderer load yaml files from local file system
|
// LocalFileRenderer load yaml files from local file system
|
||||||
type LocalFileRenderer struct {
|
type LocalFileRenderer struct {
|
||||||
Opts *RendererOptions
|
Opts *RendererOptions
|
||||||
@@ -418,8 +437,11 @@ func renderManifest(valsYaml string, cht *chart.Chart, builtIn bool, opts *Rende
|
|||||||
Name: opts.Name,
|
Name: opts.Name,
|
||||||
Namespace: opts.Namespace,
|
Namespace: opts.Namespace,
|
||||||
}
|
}
|
||||||
// TODO need to specify k8s version
|
var caps *chartutil.Capabilities
|
||||||
caps := chartutil.DefaultCapabilities
|
caps = opts.Capabilities
|
||||||
|
if caps == nil {
|
||||||
|
caps = chartutil.DefaultCapabilities
|
||||||
|
}
|
||||||
// maybe we need a configuration to change this caps
|
// maybe we need a configuration to change this caps
|
||||||
resVals, err := chartutil.ToRenderValues(cht, valsMap, RelOpts, caps)
|
resVals, err := chartutil.ToRenderValues(cht, valsMap, RelOpts, caps)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -428,7 +450,7 @@ func renderManifest(valsYaml string, cht *chart.Chart, builtIn bool, opts *Rende
|
|||||||
if builtIn {
|
if builtIn {
|
||||||
resVals["Values"].(chartutil.Values)["enabled"] = true
|
resVals["Values"].(chartutil.Values)["enabled"] = true
|
||||||
}
|
}
|
||||||
filesMap, err := engine.Render(cht, resVals)
|
filesMap, err := engine.RenderWithClient(cht, resVals, opts.restConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("Render chart failed err: %s", err)
|
return "", fmt.Errorf("Render chart failed err: %s", err)
|
||||||
}
|
}
|
||||||
@@ -562,7 +584,7 @@ func locateChart(cpOpts *action.ChartPathOptions, name string, settings *cli.Env
|
|||||||
return fileAbsPath, nil
|
return fileAbsPath, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseLatestVersion(repoUrl string, version string) (string, error) {
|
func ParseLatestVersion(repoUrl string, version string, devel bool) (string, error) {
|
||||||
|
|
||||||
cpOpts := &action.ChartPathOptions{
|
cpOpts := &action.ChartPathOptions{
|
||||||
RepoURL: repoUrl,
|
RepoURL: repoUrl,
|
||||||
@@ -610,7 +632,16 @@ func ParseLatestVersion(repoUrl string, version string) (string, error) {
|
|||||||
|
|
||||||
// get higress helm chart latest version
|
// get higress helm chart latest version
|
||||||
if entries, ok := indexFile.Entries[RepoChartIndexYamlHigressIndex]; ok {
|
if entries, ok := indexFile.Entries[RepoChartIndexYamlHigressIndex]; ok {
|
||||||
return entries[0].AppVersion, nil
|
if devel {
|
||||||
|
return entries[0].AppVersion, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if chatVersion, err := indexFile.Get(RepoChartIndexYamlHigressIndex, ""); err != nil {
|
||||||
|
return "", errors.New("can't find higress latest version")
|
||||||
|
} else {
|
||||||
|
return chatVersion.Version, nil
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", errors.New("can't find higress latest version")
|
return "", errors.New("can't find higress latest version")
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ package hgctl
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
||||||
@@ -51,6 +52,8 @@ type InstallArgs struct {
|
|||||||
Set []string
|
Set []string
|
||||||
// ManifestsPath is a path to a ManifestsPath and profiles directory in the local filesystem with a release tgz.
|
// ManifestsPath is a path to a ManifestsPath and profiles directory in the local filesystem with a release tgz.
|
||||||
ManifestsPath string
|
ManifestsPath string
|
||||||
|
// Devel if set true when version is latest, it will get latest version, otherwise it will get latest stable version
|
||||||
|
Devel bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *InstallArgs) String() string {
|
func (a *InstallArgs) String() string {
|
||||||
@@ -66,6 +69,7 @@ func addInstallFlags(cmd *cobra.Command, args *InstallArgs) {
|
|||||||
cmd.PersistentFlags().StringSliceVarP(&args.InFilenames, "filename", "f", nil, filenameFlagHelpStr)
|
cmd.PersistentFlags().StringSliceVarP(&args.InFilenames, "filename", "f", nil, filenameFlagHelpStr)
|
||||||
cmd.PersistentFlags().StringArrayVarP(&args.Set, "set", "s", nil, setFlagHelpStr)
|
cmd.PersistentFlags().StringArrayVarP(&args.Set, "set", "s", nil, setFlagHelpStr)
|
||||||
cmd.PersistentFlags().StringVarP(&args.ManifestsPath, "manifests", "d", "", manifestsFlagHelpStr)
|
cmd.PersistentFlags().StringVarP(&args.ManifestsPath, "manifests", "d", "", manifestsFlagHelpStr)
|
||||||
|
cmd.PersistentFlags().BoolVar(&args.Devel, "devel", false, "use development versions (alpha, beta, and release candidate releases), If version is set, this is ignored")
|
||||||
}
|
}
|
||||||
|
|
||||||
// --manifests is an alias for --set installPackagePath=
|
// --manifests is an alias for --set installPackagePath=
|
||||||
@@ -134,16 +138,22 @@ func install(writer io.Writer, iArgs *InstallArgs) error {
|
|||||||
return fmt.Errorf("generate config: %v", err)
|
return fmt.Errorf("generate config: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(writer, "🧐 Validating Profile: \"%s\" \n", profileName)
|
fmt.Fprintf(writer, "\n🧐 Validating Profile: \"%s\" \n", profileName)
|
||||||
err = profile.Validate()
|
err = profile.Validate()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = installManifests(profile, writer)
|
err = installManifests(profile, writer, iArgs.Devel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to install manifests: %v", err)
|
return fmt.Errorf("failed to install manifests: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove "~/.hgctl/profiles/install.yaml"
|
||||||
|
if oldProfileName, isExisted := installer.GetInstalledYamlPath(); isExisted {
|
||||||
|
_ = os.Remove(oldProfileName)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,8 +195,8 @@ func promptProfileName(writer io.Writer) string {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func installManifests(profile *helm.Profile, writer io.Writer) error {
|
func installManifests(profile *helm.Profile, writer io.Writer, devel bool) error {
|
||||||
installer, err := installer.NewInstaller(profile, writer, false)
|
installer, err := installer.NewInstaller(profile, writer, false, devel, installer.InstallInstallerMode)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ package installer
|
|||||||
import (
|
import (
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/util"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/util"
|
||||||
|
"helm.sh/helm/v3/pkg/chartutil"
|
||||||
"sigs.k8s.io/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -49,6 +50,10 @@ type ComponentOptions struct {
|
|||||||
ChartName string
|
ChartName string
|
||||||
Version string
|
Version string
|
||||||
Quiet bool
|
Quiet bool
|
||||||
|
// Capabilities
|
||||||
|
Capabilities *chartutil.Capabilities
|
||||||
|
// devel
|
||||||
|
Devel bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type ComponentOption func(*ComponentOptions)
|
type ComponentOption func(*ComponentOptions)
|
||||||
@@ -83,12 +88,24 @@ func WithComponentVersion(version string) ComponentOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WithComponentCapabilities(capabilities *chartutil.Capabilities) ComponentOption {
|
||||||
|
return func(opts *ComponentOptions) {
|
||||||
|
opts.Capabilities = capabilities
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func WithQuiet() ComponentOption {
|
func WithQuiet() ComponentOption {
|
||||||
return func(opts *ComponentOptions) {
|
return func(opts *ComponentOptions) {
|
||||||
opts.Quiet = true
|
opts.Quiet = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WithDevel(devel bool) ComponentOption {
|
||||||
|
return func(opts *ComponentOptions) {
|
||||||
|
opts.Devel = devel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func renderComponentManifest(spec any, renderer helm.Renderer, addOn bool, name ComponentName, namespace string) (string, error) {
|
func renderComponentManifest(spec any, renderer helm.Renderer, addOn bool, name ComponentName, namespace string) (string, error) {
|
||||||
var valsBytes []byte
|
var valsBytes []byte
|
||||||
var valsYaml string
|
var valsYaml string
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/kubernetes"
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/manifests"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/manifests"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -34,9 +35,10 @@ type GatewayAPIComponent struct {
|
|||||||
opts *ComponentOptions
|
opts *ComponentOptions
|
||||||
renderer helm.Renderer
|
renderer helm.Renderer
|
||||||
writer io.Writer
|
writer io.Writer
|
||||||
|
kubeCli kubernetes.CLIClient
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGatewayAPIComponent(profile *helm.Profile, writer io.Writer, opts ...ComponentOption) (Component, error) {
|
func NewGatewayAPIComponent(kubeCli kubernetes.CLIClient, profile *helm.Profile, writer io.Writer, opts ...ComponentOption) (Component, error) {
|
||||||
newOpts := &ComponentOptions{}
|
newOpts := &ComponentOptions{}
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
opt(newOpts)
|
opt(newOpts)
|
||||||
@@ -55,6 +57,8 @@ func NewGatewayAPIComponent(profile *helm.Profile, writer io.Writer, opts ...Com
|
|||||||
helm.WithVersion(newOpts.Version),
|
helm.WithVersion(newOpts.Version),
|
||||||
helm.WithFS(manifests.BuiltinOrDir("")),
|
helm.WithFS(manifests.BuiltinOrDir("")),
|
||||||
helm.WithDir(chartDir),
|
helm.WithDir(chartDir),
|
||||||
|
helm.WithCapabilities(newOpts.Capabilities),
|
||||||
|
helm.WithRestConfig(kubeCli.RESTConfig()),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -65,6 +69,7 @@ func NewGatewayAPIComponent(profile *helm.Profile, writer io.Writer, opts ...Com
|
|||||||
renderer: renderer,
|
renderer: renderer,
|
||||||
opts: newOpts,
|
opts: newOpts,
|
||||||
writer: writer,
|
writer: writer,
|
||||||
|
kubeCli: kubeCli,
|
||||||
}
|
}
|
||||||
return gatewayAPIComponent, nil
|
return gatewayAPIComponent, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,10 @@ package installer
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/kubernetes"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -31,6 +33,7 @@ type HigressComponent struct {
|
|||||||
opts *ComponentOptions
|
opts *ComponentOptions
|
||||||
renderer helm.Renderer
|
renderer helm.Renderer
|
||||||
writer io.Writer
|
writer io.Writer
|
||||||
|
kubeCli kubernetes.CLIClient
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *HigressComponent) ComponentName() ComponentName {
|
func (h *HigressComponent) ComponentName() ComponentName {
|
||||||
@@ -49,7 +52,7 @@ func (h *HigressComponent) Run() error {
|
|||||||
// Parse latest version
|
// Parse latest version
|
||||||
if h.opts.Version == helm.RepoLatestVersion {
|
if h.opts.Version == helm.RepoLatestVersion {
|
||||||
|
|
||||||
latestVersion, err := helm.ParseLatestVersion(h.opts.RepoURL, h.opts.Version)
|
latestVersion, err := helm.ParseLatestVersion(h.opts.RepoURL, h.opts.Version, h.opts.Devel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -67,6 +70,7 @@ func (h *HigressComponent) Run() error {
|
|||||||
if err := h.renderer.Init(); err != nil {
|
if err := h.renderer.Init(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
h.profile.HigressVersion = h.opts.Version
|
||||||
h.started = true
|
h.started = true
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -89,7 +93,7 @@ func (h *HigressComponent) RenderManifest() (string, error) {
|
|||||||
return manifest, nil
|
return manifest, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHigressComponent(profile *helm.Profile, writer io.Writer, opts ...ComponentOption) (Component, error) {
|
func NewHigressComponent(kubeCli kubernetes.CLIClient, profile *helm.Profile, writer io.Writer, opts ...ComponentOption) (Component, error) {
|
||||||
newOpts := &ComponentOptions{}
|
newOpts := &ComponentOptions{}
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
opt(newOpts)
|
opt(newOpts)
|
||||||
@@ -105,6 +109,8 @@ func NewHigressComponent(profile *helm.Profile, writer io.Writer, opts ...Compon
|
|||||||
helm.WithNamespace(newOpts.Namespace),
|
helm.WithNamespace(newOpts.Namespace),
|
||||||
helm.WithRepoURL(newOpts.RepoURL),
|
helm.WithRepoURL(newOpts.RepoURL),
|
||||||
helm.WithVersion(newOpts.Version),
|
helm.WithVersion(newOpts.Version),
|
||||||
|
helm.WithCapabilities(newOpts.Capabilities),
|
||||||
|
helm.WithRestConfig(kubeCli.RESTConfig()),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -115,6 +121,7 @@ func NewHigressComponent(profile *helm.Profile, writer io.Writer, opts ...Compon
|
|||||||
renderer: renderer,
|
renderer: renderer,
|
||||||
opts: newOpts,
|
opts: newOpts,
|
||||||
writer: writer,
|
writer: writer,
|
||||||
|
kubeCli: kubeCli,
|
||||||
}
|
}
|
||||||
return higressComponent, nil
|
return higressComponent, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ import (
|
|||||||
"k8s.io/client-go/util/homedir"
|
"k8s.io/client-go/util/homedir"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type InstallerMode int32
|
||||||
|
|
||||||
const (
|
const (
|
||||||
HgctlHomeDirPath = ".hgctl"
|
HgctlHomeDirPath = ".hgctl"
|
||||||
StandaloneInstalledPath = "higress-standalone"
|
StandaloneInstalledPath = "higress-standalone"
|
||||||
@@ -37,20 +39,26 @@ const (
|
|||||||
DefaultIstioNamespace = "istio-system"
|
DefaultIstioNamespace = "istio-system"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
InstallInstallerMode InstallerMode = iota
|
||||||
|
UpgradeInstallerMode
|
||||||
|
UninstallInstallerMode
|
||||||
|
)
|
||||||
|
|
||||||
type Installer interface {
|
type Installer interface {
|
||||||
Install() error
|
Install() error
|
||||||
UnInstall() error
|
UnInstall() error
|
||||||
Upgrade() error
|
Upgrade() error
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewInstaller(profile *helm.Profile, writer io.Writer, quiet bool) (Installer, error) {
|
func NewInstaller(profile *helm.Profile, writer io.Writer, quiet bool, devel bool, installerMode InstallerMode) (Installer, error) {
|
||||||
switch profile.Global.Install {
|
switch profile.Global.Install {
|
||||||
case helm.InstallK8s, helm.InstallLocalK8s:
|
case helm.InstallK8s, helm.InstallLocalK8s:
|
||||||
cliClient, err := kubernetes.NewCLIClient(options.DefaultConfigFlags.ToRawKubeConfigLoader())
|
cliClient, err := kubernetes.NewCLIClient(options.DefaultConfigFlags.ToRawKubeConfigLoader())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to build kubernetes client: %w", err)
|
return nil, fmt.Errorf("failed to build kubernetes client: %w", err)
|
||||||
}
|
}
|
||||||
installer, err := NewK8sInstaller(profile, cliClient, writer, quiet)
|
installer, err := NewK8sInstaller(profile, cliClient, writer, quiet, devel, installerMode)
|
||||||
return installer, err
|
return installer, err
|
||||||
case helm.InstallLocalDocker:
|
case helm.InstallLocalDocker:
|
||||||
installer, err := NewDockerInstaller(profile, writer, quiet)
|
installer, err := NewDockerInstaller(profile, writer, quiet)
|
||||||
|
|||||||
@@ -17,17 +17,17 @@ package installer
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/util"
|
|
||||||
"io"
|
"io"
|
||||||
"os"
|
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DockerInstaller struct {
|
type DockerInstaller struct {
|
||||||
started bool
|
started bool
|
||||||
standalone *StandaloneComponent
|
standalone *StandaloneComponent
|
||||||
profile *helm.Profile
|
profile *helm.Profile
|
||||||
writer io.Writer
|
writer io.Writer
|
||||||
|
profileStore ProfileStore
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *DockerInstaller) Install() error {
|
func (d *DockerInstaller) Install() error {
|
||||||
@@ -37,11 +37,11 @@ func (d *DockerInstaller) Install() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
profileName, _ := GetInstalledYamlPath()
|
profileName, err1 := d.profileStore.Save(d.profile)
|
||||||
fmt.Fprintf(d.writer, "\n✔️ Wrote Profile: \"%s\" \n", profileName)
|
if err1 != nil {
|
||||||
if err := util.WriteFileString(profileName, util.ToYAML(d.profile), 0o644); err != nil {
|
return err1
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
fmt.Fprintf(d.writer, "\n✔️ Wrote Profile: \"%s\" \n", profileName)
|
||||||
|
|
||||||
fmt.Fprintf(d.writer, "\n🎊 Install All Resources Complete!\n")
|
fmt.Fprintf(d.writer, "\n🎊 Install All Resources Complete!\n")
|
||||||
return nil
|
return nil
|
||||||
@@ -55,9 +55,11 @@ func (d *DockerInstaller) UnInstall() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
profileName, _ := GetInstalledYamlPath()
|
profileName, err1 := d.profileStore.Delete(d.profile)
|
||||||
|
if err1 != nil {
|
||||||
|
return err1
|
||||||
|
}
|
||||||
fmt.Fprintf(d.writer, "\n✔️ Removed Profile: \"%s\" \n", profileName)
|
fmt.Fprintf(d.writer, "\n✔️ Removed Profile: \"%s\" \n", profileName)
|
||||||
os.Remove(profileName)
|
|
||||||
|
|
||||||
fmt.Fprintf(d.writer, "\n🎊 Uninstall All Resources Complete!\n")
|
fmt.Fprintf(d.writer, "\n🎊 Uninstall All Resources Complete!\n")
|
||||||
return nil
|
return nil
|
||||||
@@ -92,10 +94,19 @@ func NewDockerInstaller(profile *helm.Profile, writer io.Writer, quiet bool) (*D
|
|||||||
return nil, fmt.Errorf("NewStandaloneComponent failed, err: %s", err)
|
return nil, fmt.Errorf("NewStandaloneComponent failed, err: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
profileInstalledPath, err1 := GetProfileInstalledPath()
|
||||||
|
if err1 != nil {
|
||||||
|
return nil, err1
|
||||||
|
}
|
||||||
|
profileStore, err2 := NewFileDirProfileStore(profileInstalledPath)
|
||||||
|
if err2 != nil {
|
||||||
|
return nil, err2
|
||||||
|
}
|
||||||
op := &DockerInstaller{
|
op := &DockerInstaller{
|
||||||
profile: profile,
|
profile: profile,
|
||||||
standalone: standaloneComponent,
|
standalone: standaloneComponent,
|
||||||
writer: writer,
|
writer: writer,
|
||||||
|
profileStore: profileStore,
|
||||||
}
|
}
|
||||||
return op, nil
|
return op, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/helm/object"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/helm/object"
|
||||||
@@ -27,11 +29,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type K8sInstaller struct {
|
type K8sInstaller struct {
|
||||||
started bool
|
started bool
|
||||||
components map[ComponentName]Component
|
components map[ComponentName]Component
|
||||||
kubeCli kubernetes.CLIClient
|
kubeCli kubernetes.CLIClient
|
||||||
profile *helm.Profile
|
profile *helm.Profile
|
||||||
writer io.Writer
|
writer io.Writer
|
||||||
|
profileStore ProfileStore
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *K8sInstaller) Install() error {
|
func (o *K8sInstaller) Install() error {
|
||||||
@@ -43,10 +46,6 @@ func (o *K8sInstaller) Install() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := GetProfileInstalledPath(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := o.Run(); err != nil {
|
if err := o.Run(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -61,11 +60,16 @@ func (o *K8sInstaller) Install() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
profileName, _ := GetInstalledYamlPath()
|
profileName, err1 := o.profileStore.Save(o.profile)
|
||||||
fmt.Fprintf(o.writer, "\n✔️ Wrote Profile: \"%s\" \n", profileName)
|
if err1 != nil {
|
||||||
if err := util.WriteFileString(profileName, util.ToYAML(o.profile), 0o644); err != nil {
|
return err1
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
fmt.Fprintf(o.writer, "\n✔️ Wrote Profile in kubernetes configmap: \"%s\" \n", profileName)
|
||||||
|
fmt.Fprintf(o.writer, "\n Use bellow kubectl command to edit profile for upgrade. \n")
|
||||||
|
fmt.Fprintf(o.writer, " ================================================================================== \n")
|
||||||
|
names := strings.Split(profileName, "/")
|
||||||
|
fmt.Fprintf(o.writer, " kubectl edit configmap %s -n %s \n", names[1], names[0])
|
||||||
|
fmt.Fprintf(o.writer, " ================================================================================== \n")
|
||||||
|
|
||||||
fmt.Fprintf(o.writer, "\n🎊 Install All Resources Complete!\n")
|
fmt.Fprintf(o.writer, "\n🎊 Install All Resources Complete!\n")
|
||||||
|
|
||||||
@@ -91,9 +95,11 @@ func (o *K8sInstaller) UnInstall() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
profileName, _ := GetInstalledYamlPath()
|
profileName, err1 := o.profileStore.Delete(o.profile)
|
||||||
|
if err1 != nil {
|
||||||
|
return err1
|
||||||
|
}
|
||||||
fmt.Fprintf(o.writer, "\n✔️ Removed Profile: \"%s\" \n", profileName)
|
fmt.Fprintf(o.writer, "\n✔️ Removed Profile: \"%s\" \n", profileName)
|
||||||
os.Remove(profileName)
|
|
||||||
|
|
||||||
fmt.Fprintf(o.writer, "\n🎊 Uninstall All Resources Complete!\n")
|
fmt.Fprintf(o.writer, "\n🎊 Uninstall All Resources Complete!\n")
|
||||||
|
|
||||||
@@ -202,6 +208,19 @@ func (o *K8sInstaller) DeleteManifests(manifestMap map[ComponentName]string) err
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WriteManifests write component manifests to local files
|
||||||
|
func (o *K8sInstaller) WriteManifests(manifestMap map[ComponentName]string) error {
|
||||||
|
if o.kubeCli == nil {
|
||||||
|
return errors.New("no injected k8s cli into K8sInstaller")
|
||||||
|
}
|
||||||
|
rootPath, _ := os.Getwd()
|
||||||
|
for name, manifest := range manifestMap {
|
||||||
|
fileName := filepath.Join(rootPath, string(name)+".yaml")
|
||||||
|
util.WriteFileString(fileName, manifest, 0o644)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// deleteManifest delete manifest to certain namespace
|
// deleteManifest delete manifest to certain namespace
|
||||||
func (o *K8sInstaller) deleteManifest(manifest string, ns string) error {
|
func (o *K8sInstaller) deleteManifest(manifest string, ns string) error {
|
||||||
objs, err := object.ParseK8sObjectsFromYAMLManifest(manifest)
|
objs, err := object.ParseK8sObjectsFromYAMLManifest(manifest)
|
||||||
@@ -235,23 +254,38 @@ func (o *K8sInstaller) isNamespacedObject(obj *object.K8sObject) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewK8sInstaller(profile *helm.Profile, cli kubernetes.CLIClient, writer io.Writer, quiet bool) (*K8sInstaller, error) {
|
func NewK8sInstaller(profile *helm.Profile, cli kubernetes.CLIClient, writer io.Writer, quiet bool, devel bool, installerMode InstallerMode) (*K8sInstaller, error) {
|
||||||
if profile == nil {
|
if profile == nil {
|
||||||
return nil, errors.New("install profile is empty")
|
return nil, errors.New("install profile is empty")
|
||||||
}
|
}
|
||||||
|
// initialize server info
|
||||||
|
serverInfo, _ := NewServerInfo(cli)
|
||||||
|
fmt.Fprintf(writer, "\n⌛️ Detecting kubernetes version ... ")
|
||||||
|
capabilities, err := serverInfo.GetCapabilities()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
fmt.Fprintf(writer, "%s\n", capabilities.KubeVersion.Version)
|
||||||
// initialize components
|
// initialize components
|
||||||
|
higressVersion := profile.Charts.Higress.Version
|
||||||
|
if installerMode == UninstallInstallerMode {
|
||||||
|
// uninstall
|
||||||
|
higressVersion = profile.HigressVersion
|
||||||
|
}
|
||||||
components := make(map[ComponentName]Component)
|
components := make(map[ComponentName]Component)
|
||||||
opts := []ComponentOption{
|
opts := []ComponentOption{
|
||||||
WithComponentNamespace(profile.Global.Namespace),
|
WithComponentNamespace(profile.Global.Namespace),
|
||||||
WithComponentChartPath(profile.InstallPackagePath),
|
WithComponentChartPath(profile.InstallPackagePath),
|
||||||
WithComponentVersion(profile.Charts.Higress.Version),
|
WithComponentVersion(higressVersion),
|
||||||
WithComponentRepoURL(profile.Charts.Higress.Url),
|
WithComponentRepoURL(profile.Charts.Higress.Url),
|
||||||
WithComponentChartName(profile.Charts.Higress.Name),
|
WithComponentChartName(profile.Charts.Higress.Name),
|
||||||
|
WithComponentCapabilities(capabilities),
|
||||||
|
WithDevel(devel),
|
||||||
}
|
}
|
||||||
if quiet {
|
if quiet {
|
||||||
opts = append(opts, WithQuiet())
|
opts = append(opts, WithQuiet())
|
||||||
}
|
}
|
||||||
higressComponent, err := NewHigressComponent(profile, writer, opts...)
|
higressComponent, err := NewHigressComponent(cli, profile, writer, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("NewHigressComponent failed, err: %s", err)
|
return nil, fmt.Errorf("NewHigressComponent failed, err: %s", err)
|
||||||
}
|
}
|
||||||
@@ -267,12 +301,13 @@ func NewK8sInstaller(profile *helm.Profile, cli kubernetes.CLIClient, writer io.
|
|||||||
WithComponentVersion("1.18.2"),
|
WithComponentVersion("1.18.2"),
|
||||||
WithComponentRepoURL("embed://istiobase"),
|
WithComponentRepoURL("embed://istiobase"),
|
||||||
WithComponentChartName("istio"),
|
WithComponentChartName("istio"),
|
||||||
|
WithComponentCapabilities(capabilities),
|
||||||
}
|
}
|
||||||
if quiet {
|
if quiet {
|
||||||
opts = append(opts, WithQuiet())
|
opts = append(opts, WithQuiet())
|
||||||
}
|
}
|
||||||
|
|
||||||
istioCRDComponent, err := NewIstioCRDComponent(profile, writer, opts...)
|
istioCRDComponent, err := NewIstioCRDComponent(cli, profile, writer, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("NewIstioCRDComponent failed, err: %s", err)
|
return nil, fmt.Errorf("NewIstioCRDComponent failed, err: %s", err)
|
||||||
}
|
}
|
||||||
@@ -285,23 +320,30 @@ func NewK8sInstaller(profile *helm.Profile, cli kubernetes.CLIClient, writer io.
|
|||||||
WithComponentVersion("1.0.0"),
|
WithComponentVersion("1.0.0"),
|
||||||
WithComponentRepoURL("embed://gatewayapi"),
|
WithComponentRepoURL("embed://gatewayapi"),
|
||||||
WithComponentChartName("gatewayAPI"),
|
WithComponentChartName("gatewayAPI"),
|
||||||
|
WithComponentCapabilities(capabilities),
|
||||||
}
|
}
|
||||||
if quiet {
|
if quiet {
|
||||||
opts = append(opts, WithQuiet())
|
opts = append(opts, WithQuiet())
|
||||||
}
|
}
|
||||||
|
|
||||||
gatewayAPIComponent, err := NewGatewayAPIComponent(profile, writer, opts...)
|
gatewayAPIComponent, err := NewGatewayAPIComponent(cli, profile, writer, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("NewGatewayAPIComponent failed, err: %s", err)
|
return nil, fmt.Errorf("NewGatewayAPIComponent failed, err: %s", err)
|
||||||
}
|
}
|
||||||
components[GatewayAPI] = gatewayAPIComponent
|
components[GatewayAPI] = gatewayAPIComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
profileStore, err := NewConfigmapProfileStore(cli)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
op := &K8sInstaller{
|
op := &K8sInstaller{
|
||||||
profile: profile,
|
profile: profile,
|
||||||
components: components,
|
components: components,
|
||||||
kubeCli: cli,
|
kubeCli: cli,
|
||||||
writer: writer,
|
writer: writer,
|
||||||
|
profileStore: profileStore,
|
||||||
}
|
}
|
||||||
return op, nil
|
return op, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/kubernetes"
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/manifests"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/manifests"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -33,9 +34,10 @@ type IstioCRDComponent struct {
|
|||||||
opts *ComponentOptions
|
opts *ComponentOptions
|
||||||
renderer helm.Renderer
|
renderer helm.Renderer
|
||||||
writer io.Writer
|
writer io.Writer
|
||||||
|
kubeCli kubernetes.CLIClient
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewIstioCRDComponent(profile *helm.Profile, writer io.Writer, opts ...ComponentOption) (Component, error) {
|
func NewIstioCRDComponent(kubeCli kubernetes.CLIClient, profile *helm.Profile, writer io.Writer, opts ...ComponentOption) (Component, error) {
|
||||||
newOpts := &ComponentOptions{}
|
newOpts := &ComponentOptions{}
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
opt(newOpts)
|
opt(newOpts)
|
||||||
@@ -54,6 +56,8 @@ func NewIstioCRDComponent(profile *helm.Profile, writer io.Writer, opts ...Compo
|
|||||||
helm.WithVersion(newOpts.Version),
|
helm.WithVersion(newOpts.Version),
|
||||||
helm.WithFS(manifests.BuiltinOrDir("")),
|
helm.WithFS(manifests.BuiltinOrDir("")),
|
||||||
helm.WithDir(chartDir),
|
helm.WithDir(chartDir),
|
||||||
|
helm.WithCapabilities(newOpts.Capabilities),
|
||||||
|
helm.WithRestConfig(kubeCli.RESTConfig()),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -64,6 +68,8 @@ func NewIstioCRDComponent(profile *helm.Profile, writer io.Writer, opts ...Compo
|
|||||||
helm.WithNamespace(newOpts.Namespace),
|
helm.WithNamespace(newOpts.Namespace),
|
||||||
helm.WithRepoURL(newOpts.RepoURL),
|
helm.WithRepoURL(newOpts.RepoURL),
|
||||||
helm.WithVersion(newOpts.Version),
|
helm.WithVersion(newOpts.Version),
|
||||||
|
helm.WithCapabilities(newOpts.Capabilities),
|
||||||
|
helm.WithRestConfig(kubeCli.RESTConfig()),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -75,6 +81,7 @@ func NewIstioCRDComponent(profile *helm.Profile, writer io.Writer, opts ...Compo
|
|||||||
renderer: renderer,
|
renderer: renderer,
|
||||||
opts: newOpts,
|
opts: newOpts,
|
||||||
writer: writer,
|
writer: writer,
|
||||||
|
kubeCli: kubeCli,
|
||||||
}
|
}
|
||||||
return istioComponent, nil
|
return istioComponent, nil
|
||||||
}
|
}
|
||||||
|
|||||||
247
pkg/cmd/hgctl/installer/profile_store.go
Normal file
247
pkg/cmd/hgctl/installer/profile_store.go
Normal file
@@ -0,0 +1,247 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
package installer
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/kubernetes"
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/util"
|
||||||
|
corev1 "k8s.io/api/core/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
ProfileConfigmapKey = "profile"
|
||||||
|
ProfileConfigmapName = "higress-profile"
|
||||||
|
ProfileConfigmapAnnotation = "higress.io/install"
|
||||||
|
ProfileFilePrefix = "install"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ProfileContext struct {
|
||||||
|
Profile *helm.Profile
|
||||||
|
SourceType string
|
||||||
|
Namespace string
|
||||||
|
PathOrName string
|
||||||
|
Install helm.InstallMode
|
||||||
|
HigressVersion string
|
||||||
|
}
|
||||||
|
|
||||||
|
type ProfileStore interface {
|
||||||
|
Save(profile *helm.Profile) (string, error)
|
||||||
|
List() ([]*ProfileContext, error)
|
||||||
|
Delete(profile *helm.Profile) (string, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type FileDirProfileStore struct {
|
||||||
|
profilesPath string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *FileDirProfileStore) Save(profile *helm.Profile) (string, error) {
|
||||||
|
namespace := profile.Global.Namespace
|
||||||
|
install := profile.Global.Install
|
||||||
|
var profileName = ""
|
||||||
|
if install == helm.InstallK8s || install == helm.InstallLocalK8s {
|
||||||
|
profileName = filepath.Join(f.profilesPath, fmt.Sprintf("%s-%s.yaml", ProfileFilePrefix, namespace))
|
||||||
|
} else {
|
||||||
|
profileName = filepath.Join(f.profilesPath, fmt.Sprintf("%s-%s.yaml", ProfileFilePrefix, install))
|
||||||
|
}
|
||||||
|
if err := util.WriteFileString(profileName, util.ToYAML(profile), 0o644); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return profileName, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *FileDirProfileStore) List() ([]*ProfileContext, error) {
|
||||||
|
profileContexts := make([]*ProfileContext, 0)
|
||||||
|
dir, err := os.ReadDir(f.profilesPath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
for _, file := range dir {
|
||||||
|
if !strings.HasSuffix(file.Name(), ".yaml") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if file.IsDir() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
fileName := filepath.Join(f.profilesPath, file.Name())
|
||||||
|
content, err2 := os.ReadFile(fileName)
|
||||||
|
if err2 != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
profile, err3 := helm.UnmarshalProfile(string(content))
|
||||||
|
if err3 != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
profileContext := &ProfileContext{
|
||||||
|
Profile: profile,
|
||||||
|
Namespace: profile.Global.Namespace,
|
||||||
|
Install: profile.Global.Install,
|
||||||
|
HigressVersion: profile.HigressVersion,
|
||||||
|
SourceType: "file",
|
||||||
|
PathOrName: fileName,
|
||||||
|
}
|
||||||
|
profileContexts = append(profileContexts, profileContext)
|
||||||
|
}
|
||||||
|
return profileContexts, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *FileDirProfileStore) Delete(profile *helm.Profile) (string, error) {
|
||||||
|
namespace := profile.Global.Namespace
|
||||||
|
install := profile.Global.Install
|
||||||
|
var profileName = ""
|
||||||
|
if install == helm.InstallK8s || install == helm.InstallLocalK8s {
|
||||||
|
profileName = filepath.Join(f.profilesPath, fmt.Sprintf("%s-%s.yaml", ProfileFilePrefix, namespace))
|
||||||
|
} else {
|
||||||
|
profileName = filepath.Join(f.profilesPath, fmt.Sprintf("%s-%s.yaml", ProfileFilePrefix, install))
|
||||||
|
}
|
||||||
|
if err := os.Remove(profileName); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return profileName, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFileDirProfileStore(profilesPath string) (ProfileStore, error) {
|
||||||
|
if _, err := os.Stat(profilesPath); os.IsNotExist(err) {
|
||||||
|
if err = os.MkdirAll(profilesPath, os.ModePerm); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
profileStore := &FileDirProfileStore{
|
||||||
|
profilesPath: profilesPath,
|
||||||
|
}
|
||||||
|
return profileStore, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type ConfigmapProfileStore struct {
|
||||||
|
kubeCli kubernetes.CLIClient
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ConfigmapProfileStore) Save(profile *helm.Profile) (string, error) {
|
||||||
|
bytes, err := json.Marshal(profile)
|
||||||
|
jsonProfile := ""
|
||||||
|
if err == nil {
|
||||||
|
jsonProfile = string(bytes)
|
||||||
|
}
|
||||||
|
annotation := make(map[string]string, 0)
|
||||||
|
annotation[ProfileConfigmapAnnotation] = jsonProfile
|
||||||
|
configmap := &corev1.ConfigMap{
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Namespace: profile.Global.Namespace,
|
||||||
|
Name: ProfileConfigmapName,
|
||||||
|
Annotations: annotation,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
configmap.Data = make(map[string]string, 0)
|
||||||
|
configmap.Data[ProfileConfigmapKey] = util.ToYAML(profile)
|
||||||
|
name := fmt.Sprintf("%s/%s", profile.Global.Namespace, ProfileConfigmapName)
|
||||||
|
if err := c.applyConfigmap(configmap); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return name, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ConfigmapProfileStore) List() ([]*ProfileContext, error) {
|
||||||
|
profileContexts := make([]*ProfileContext, 0)
|
||||||
|
configmapList, err := c.listConfigmaps(ProfileConfigmapName, "", 100)
|
||||||
|
if err != nil {
|
||||||
|
return profileContexts, err
|
||||||
|
}
|
||||||
|
for _, configmap := range configmapList.Items {
|
||||||
|
if data, ok := configmap.Data[ProfileConfigmapKey]; ok {
|
||||||
|
profile, err := helm.UnmarshalProfile(data)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
profileContext := &ProfileContext{
|
||||||
|
Profile: profile,
|
||||||
|
Namespace: profile.Global.Namespace,
|
||||||
|
Install: profile.Global.Install,
|
||||||
|
HigressVersion: profile.HigressVersion,
|
||||||
|
SourceType: "configmap",
|
||||||
|
PathOrName: fmt.Sprintf("%s/%s", profile.Global.Namespace, configmap.Name),
|
||||||
|
}
|
||||||
|
profileContexts = append(profileContexts, profileContext)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return profileContexts, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ConfigmapProfileStore) Delete(profile *helm.Profile) (string, error) {
|
||||||
|
configmap := &corev1.ConfigMap{
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Namespace: profile.Global.Namespace,
|
||||||
|
Name: ProfileConfigmapName,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
name := fmt.Sprintf("%s/%s", profile.Global.Namespace, ProfileConfigmapName)
|
||||||
|
if err := c.deleteConfigmap(configmap); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return name, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ConfigmapProfileStore) listConfigmaps(name string, namespace string, size int64) (*corev1.ConfigMapList, error) {
|
||||||
|
var result *corev1.ConfigMapList
|
||||||
|
var err error
|
||||||
|
if len(namespace) == 0 {
|
||||||
|
result, err = c.kubeCli.KubernetesInterface().CoreV1().ConfigMaps("").List(context.Background(), metav1.ListOptions{Limit: size, FieldSelector: fmt.Sprintf("metadata.name=%s", name)})
|
||||||
|
} else {
|
||||||
|
result, err = c.kubeCli.KubernetesInterface().CoreV1().ConfigMaps(namespace).List(context.Background(), metav1.ListOptions{Limit: size, FieldSelector: fmt.Sprintf("metadata.name=%s", name)})
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ConfigmapProfileStore) applyConfigmap(configmap *corev1.ConfigMap) error {
|
||||||
|
_, err := c.kubeCli.KubernetesInterface().CoreV1().ConfigMaps(configmap.Namespace).Get(context.Background(), configmap.Name, metav1.GetOptions{})
|
||||||
|
if err != nil && errors.IsNotFound(err) {
|
||||||
|
_, err = c.kubeCli.KubernetesInterface().CoreV1().ConfigMaps(configmap.Namespace).Create(context.Background(), configmap, metav1.CreateOptions{})
|
||||||
|
return err
|
||||||
|
} else if err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_, err = c.kubeCli.KubernetesInterface().CoreV1().ConfigMaps(configmap.Namespace).Update(context.Background(), configmap, metav1.UpdateOptions{})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ConfigmapProfileStore) deleteConfigmap(configmap *corev1.ConfigMap) error {
|
||||||
|
err := c.kubeCli.KubernetesInterface().CoreV1().ConfigMaps(configmap.Namespace).Delete(context.Background(), configmap.Name, metav1.DeleteOptions{})
|
||||||
|
if err != nil {
|
||||||
|
if !errors.IsNotFound(err) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewConfigmapProfileStore(kubeCli kubernetes.CLIClient) (ProfileStore, error) {
|
||||||
|
profileStore := &ConfigmapProfileStore{
|
||||||
|
kubeCli: kubeCli,
|
||||||
|
}
|
||||||
|
return profileStore, nil
|
||||||
|
}
|
||||||
66
pkg/cmd/hgctl/installer/server_info.go
Normal file
66
pkg/cmd/hgctl/installer/server_info.go
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
package installer
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/kubernetes"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"helm.sh/helm/v3/pkg/action"
|
||||||
|
"helm.sh/helm/v3/pkg/chartutil"
|
||||||
|
"k8s.io/client-go/discovery"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ServerInfo struct {
|
||||||
|
kubeCli kubernetes.CLIClient
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ServerInfo) GetCapabilities() (*chartutil.Capabilities, error) {
|
||||||
|
// force a discovery cache invalidation to always fetch the latest server version/capabilities.
|
||||||
|
dc := c.kubeCli.KubernetesInterface().Discovery()
|
||||||
|
|
||||||
|
kubeVersion, err := dc.ServerVersion()
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrap(err, "could not get server version from Kubernetes")
|
||||||
|
}
|
||||||
|
// Issue #6361:
|
||||||
|
// Client-Go emits an error when an API service is registered but unimplemented.
|
||||||
|
// We trap that error here and print a warning. But since the discovery client continues
|
||||||
|
// building the API object, it is correctly populated with all valid APIs.
|
||||||
|
// See https://github.com/kubernetes/kubernetes/issues/72051#issuecomment-521157642
|
||||||
|
apiVersions, err := action.GetVersionSet(dc)
|
||||||
|
if err != nil {
|
||||||
|
if discovery.IsGroupDiscoveryFailedError(err) {
|
||||||
|
} else {
|
||||||
|
return nil, errors.Wrap(err, "could not get apiVersions from Kubernetes")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
capabilities := &chartutil.Capabilities{
|
||||||
|
APIVersions: apiVersions,
|
||||||
|
KubeVersion: chartutil.KubeVersion{
|
||||||
|
Version: kubeVersion.GitVersion,
|
||||||
|
Major: kubeVersion.Major,
|
||||||
|
Minor: kubeVersion.Minor,
|
||||||
|
},
|
||||||
|
HelmVersion: chartutil.DefaultCapabilities.HelmVersion,
|
||||||
|
}
|
||||||
|
return capabilities, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewServerInfo(kubCli kubernetes.CLIClient) (*ServerInfo, error) {
|
||||||
|
serverInfo := &ServerInfo{
|
||||||
|
kubeCli: kubCli,
|
||||||
|
}
|
||||||
|
return serverInfo, nil
|
||||||
|
}
|
||||||
@@ -58,7 +58,10 @@ func (s *StandaloneComponent) Install() error {
|
|||||||
if err := s.agent.Install(); err != nil {
|
if err := s.agent.Install(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// Set Higress version
|
||||||
|
if version, err := s.agent.Version(); err == nil {
|
||||||
|
s.profile.HigressVersion = version
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +89,10 @@ func (s *StandaloneComponent) Upgrade() error {
|
|||||||
if err := s.agent.Upgrade(); err != nil {
|
if err := s.agent.Upgrade(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// Set Higress version
|
||||||
|
if version, err := s.agent.Version(); err != nil {
|
||||||
|
s.profile.HigressVersion = version
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,10 +118,6 @@ func NewStandaloneComponent(profile *helm.Profile, writer io.Writer, opts ...Com
|
|||||||
}
|
}
|
||||||
|
|
||||||
func prepareProfile(profile *helm.Profile) error {
|
func prepareProfile(profile *helm.Profile) error {
|
||||||
if _, err := GetProfileInstalledPath(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(profile.InstallPackagePath) == 0 {
|
if len(profile.InstallPackagePath) == 0 {
|
||||||
dir, err := GetDefaultInstallPackagePath()
|
dir, err := GetDefaultInstallPackagePath()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ type CLIClient interface {
|
|||||||
|
|
||||||
// CreateNamespace create namespace
|
// CreateNamespace create namespace
|
||||||
CreateNamespace(namespace string) error
|
CreateNamespace(namespace string) error
|
||||||
|
|
||||||
|
// KubernetesInterface get kubernetes interface
|
||||||
|
KubernetesInterface() kubernetes.Interface
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ CLIClient = &client{}
|
var _ CLIClient = &client{}
|
||||||
@@ -246,3 +249,9 @@ func (c *client) CreateNamespace(namespace string) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KubernetesInterface get kubernetes interface
|
||||||
|
func (c *client) KubernetesInterface() kubernetes.Interface {
|
||||||
|
return c.kube
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,12 +28,8 @@ import (
|
|||||||
"k8s.io/client-go/transport/spdy"
|
"k8s.io/client-go/transport/spdy"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
func LocalAvailablePort(localAddress string) (int, error) {
|
||||||
DefaultLocalAddress = "localhost"
|
l, err := net.Listen("tcp", fmt.Sprintf("%s:0", localAddress))
|
||||||
)
|
|
||||||
|
|
||||||
func LocalAvailablePort() (int, error) {
|
|
||||||
l, err := net.Listen("tcp", fmt.Sprintf("%s:0", DefaultLocalAddress))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@@ -59,23 +55,25 @@ type localForwarder struct {
|
|||||||
types.NamespacedName
|
types.NamespacedName
|
||||||
CLIClient
|
CLIClient
|
||||||
|
|
||||||
localPort int
|
localPort int
|
||||||
podPort int
|
podPort int
|
||||||
|
localAddress string
|
||||||
|
|
||||||
stopCh chan struct{}
|
stopCh chan struct{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewLocalPortForwarder(client CLIClient, namespacedName types.NamespacedName, localPort, podPort int) (PortForwarder, error) {
|
func NewLocalPortForwarder(client CLIClient, namespacedName types.NamespacedName, localPort, podPort int, bindAddress string) (PortForwarder, error) {
|
||||||
f := &localForwarder{
|
f := &localForwarder{
|
||||||
stopCh: make(chan struct{}),
|
stopCh: make(chan struct{}),
|
||||||
CLIClient: client,
|
CLIClient: client,
|
||||||
NamespacedName: namespacedName,
|
NamespacedName: namespacedName,
|
||||||
localPort: localPort,
|
localPort: localPort,
|
||||||
podPort: podPort,
|
podPort: podPort,
|
||||||
|
localAddress: bindAddress,
|
||||||
}
|
}
|
||||||
if f.localPort == 0 {
|
if f.localPort == 0 {
|
||||||
// get a random port
|
// get a random port
|
||||||
p, err := LocalAvailablePort()
|
p, err := LocalAvailablePort(bindAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to get a local available port")
|
return nil, errors.Wrapf(err, "failed to get a local available port")
|
||||||
}
|
}
|
||||||
@@ -136,7 +134,7 @@ func (f *localForwarder) buildKubernetesPortForwarder(readyCh chan struct{}) (*p
|
|||||||
|
|
||||||
dialer := spdy.NewDialer(upgrader, &http.Client{Transport: roundTripper}, http.MethodPost, serverURL)
|
dialer := spdy.NewDialer(upgrader, &http.Client{Transport: roundTripper}, http.MethodPost, serverURL)
|
||||||
fw, err := portforward.NewOnAddresses(dialer,
|
fw, err := portforward.NewOnAddresses(dialer,
|
||||||
[]string{DefaultLocalAddress},
|
[]string{f.localAddress},
|
||||||
[]string{fmt.Sprintf("%d:%d", f.localPort, f.podPort)},
|
[]string{fmt.Sprintf("%d:%d", f.localPort, f.podPort)},
|
||||||
f.stopCh,
|
f.stopCh,
|
||||||
readyCh,
|
readyCh,
|
||||||
@@ -154,7 +152,7 @@ func (f *localForwarder) Stop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *localForwarder) Address() string {
|
func (f *localForwarder) Address() string {
|
||||||
return fmt.Sprintf("%s:%d", DefaultLocalAddress, f.localPort)
|
return fmt.Sprintf("%s:%d", f.localAddress, f.localPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *localForwarder) WaitForStop() {
|
func (f *localForwarder) WaitForStop() {
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ type ManifestArgs struct {
|
|||||||
Set []string
|
Set []string
|
||||||
// ManifestsPath is a path to a ManifestsPath and profiles directory in the local filesystem with a release tgz.
|
// ManifestsPath is a path to a ManifestsPath and profiles directory in the local filesystem with a release tgz.
|
||||||
ManifestsPath string
|
ManifestsPath string
|
||||||
|
// Devel if set true when version is latest, it will get latest version, otherwise it will get latest stable version
|
||||||
|
Devel bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *ManifestArgs) String() string {
|
func (a *ManifestArgs) String() string {
|
||||||
@@ -70,6 +72,7 @@ func addManifestFlags(cmd *cobra.Command, args *ManifestArgs) {
|
|||||||
cmd.PersistentFlags().StringSliceVarP(&args.InFilenames, "filename", "f", nil, filenameFlagHelpStr)
|
cmd.PersistentFlags().StringSliceVarP(&args.InFilenames, "filename", "f", nil, filenameFlagHelpStr)
|
||||||
cmd.PersistentFlags().StringArrayVarP(&args.Set, "set", "s", nil, setFlagHelpStr)
|
cmd.PersistentFlags().StringArrayVarP(&args.Set, "set", "s", nil, setFlagHelpStr)
|
||||||
cmd.PersistentFlags().StringVarP(&args.ManifestsPath, "manifests", "d", "", manifestsFlagHelpStr)
|
cmd.PersistentFlags().StringVarP(&args.ManifestsPath, "manifests", "d", "", manifestsFlagHelpStr)
|
||||||
|
cmd.PersistentFlags().BoolVar(&args.Devel, "devel", false, "use development versions (alpha, beta, and release candidate releases), If version is set, this is ignored")
|
||||||
}
|
}
|
||||||
|
|
||||||
// newManifestGenerateCmd generates a higress install manifest and applies it to a cluster
|
// newManifestGenerateCmd generates a higress install manifest and applies it to a cluster
|
||||||
@@ -113,20 +116,20 @@ func generate(writer io.Writer, iArgs *ManifestArgs) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = genManifests(profile, writer)
|
err = genManifests(profile, writer, iArgs.Devel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to install manifests: %v", err)
|
return fmt.Errorf("failed to install manifests: %v", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func genManifests(profile *helm.Profile, writer io.Writer) error {
|
func genManifests(profile *helm.Profile, writer io.Writer, devel bool) error {
|
||||||
cliClient, err := kubernetes.NewCLIClient(options.DefaultConfigFlags.ToRawKubeConfigLoader())
|
cliClient, err := kubernetes.NewCLIClient(options.DefaultConfigFlags.ToRawKubeConfigLoader())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to build kubernetes client: %w", err)
|
return fmt.Errorf("failed to build kubernetes client: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
op, err := installer.NewK8sInstaller(profile, cliClient, writer, true)
|
op, err := installer.NewK8sInstaller(profile, cliClient, writer, true, devel, installer.InstallInstallerMode)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
|
||||||
"os/user"
|
"os/user"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
|
||||||
|
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/plugin/option"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/plugin/option"
|
||||||
ptypes "github.com/alibaba/higress/pkg/cmd/hgctl/plugin/types"
|
ptypes "github.com/alibaba/higress/pkg/cmd/hgctl/plugin/types"
|
||||||
@@ -633,11 +631,7 @@ func (b *Builder) config(f ConfigFunc) (err error) {
|
|||||||
b.w = os.Stdout
|
b.w = os.Stdout
|
||||||
}
|
}
|
||||||
|
|
||||||
b.sig = make(chan os.Signal, 1)
|
signalNotify(b)
|
||||||
b.stop = make(chan struct{}, 1)
|
|
||||||
b.done = make(chan struct{}, 1)
|
|
||||||
signal.Notify(b.sig, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM,
|
|
||||||
syscall.SIGUSR1, syscall.SIGUSR2, syscall.SIGQUIT, syscall.SIGTSTP)
|
|
||||||
|
|
||||||
if b.Debugger == nil {
|
if b.Debugger == nil {
|
||||||
b.Debugger = utils.NewDefaultDebugger(b.Debug, b.w)
|
b.Debugger = utils.NewDefaultDebugger(b.Debug, b.w)
|
||||||
|
|||||||
31
pkg/cmd/hgctl/plugin/build/signal.go
Normal file
31
pkg/cmd/hgctl/plugin/build/signal.go
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
//go:build linux || darwin || bsd
|
||||||
|
|
||||||
|
package build
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
)
|
||||||
|
|
||||||
|
func signalNotify(b *Builder) {
|
||||||
|
b.sig = make(chan os.Signal, 1)
|
||||||
|
b.stop = make(chan struct{}, 1)
|
||||||
|
b.done = make(chan struct{}, 1)
|
||||||
|
signal.Notify(b.sig, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM,
|
||||||
|
syscall.SIGUSR1, syscall.SIGUSR2, syscall.SIGQUIT, syscall.SIGTSTP)
|
||||||
|
}
|
||||||
31
pkg/cmd/hgctl/plugin/build/signal_windows.go
Normal file
31
pkg/cmd/hgctl/plugin/build/signal_windows.go
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
//go:build windows
|
||||||
|
|
||||||
|
package build
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
)
|
||||||
|
|
||||||
|
func signalNotify(b *Builder) {
|
||||||
|
b.sig = make(chan os.Signal, 1)
|
||||||
|
b.stop = make(chan struct{}, 1)
|
||||||
|
b.done = make(chan struct{}, 1)
|
||||||
|
signal.Notify(b.sig, syscall.SIGHUP, syscall.SIGINT,
|
||||||
|
syscall.SIGTERM, syscall.SIGQUIT)
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ package hgctl
|
|||||||
import (
|
import (
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/plugin"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/plugin"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetRootCommand returns the root cobra command to be executed
|
// GetRootCommand returns the root cobra command to be executed
|
||||||
@@ -38,6 +39,8 @@ func GetRootCommand() *cobra.Command {
|
|||||||
rootCmd.AddCommand(newDashboardCmd())
|
rootCmd.AddCommand(newDashboardCmd())
|
||||||
rootCmd.AddCommand(newManifestCmd())
|
rootCmd.AddCommand(newManifestCmd())
|
||||||
rootCmd.AddCommand(plugin.NewCommand())
|
rootCmd.AddCommand(plugin.NewCommand())
|
||||||
|
rootCmd.AddCommand(newCompletionCmd(os.Stdout))
|
||||||
|
rootCmd.AddCommand(newCodeDebugCmd())
|
||||||
|
|
||||||
return rootCmd
|
return rootCmd
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,22 +17,24 @@ package hgctl
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/installer"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/installer"
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/util"
|
||||||
"github.com/alibaba/higress/pkg/cmd/options"
|
"github.com/alibaba/higress/pkg/cmd/options"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
type uninstallArgs struct {
|
type uninstallArgs struct {
|
||||||
// purgeIstioCRD delete all of Istio resources.
|
// purgeResources delete all of installed resources.
|
||||||
purgeIstioCRD bool
|
purgeResources bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func addUninstallFlags(cmd *cobra.Command, args *uninstallArgs) {
|
func addUninstallFlags(cmd *cobra.Command, args *uninstallArgs) {
|
||||||
cmd.PersistentFlags().BoolVarP(&args.purgeIstioCRD, "purge-istio-crd", "", false,
|
cmd.PersistentFlags().BoolVarP(&args.purgeResources, "purge-resources", "", false,
|
||||||
"Delete all of Istio resources")
|
"Delete all of IstioAPI,GatewayAPI resources")
|
||||||
}
|
}
|
||||||
|
|
||||||
// newUninstallCmd command uninstalls Istio from a cluster
|
// newUninstallCmd command uninstalls Istio from a cluster
|
||||||
@@ -42,11 +44,11 @@ func newUninstallCmd() *cobra.Command {
|
|||||||
Use: "uninstall",
|
Use: "uninstall",
|
||||||
Short: "Uninstall higress from a cluster",
|
Short: "Uninstall higress from a cluster",
|
||||||
Long: "The uninstall command uninstalls higress from a cluster or local environment",
|
Long: "The uninstall command uninstalls higress from a cluster or local environment",
|
||||||
Example: ` # Uninstall higress
|
Example: `# Uninstall higress
|
||||||
hgctl uninstal
|
hgctl uninstal
|
||||||
|
|
||||||
# Uninstall higress and istio CRD from a cluster
|
# Uninstall higress, istioAPI and GatewayAPI from a cluster
|
||||||
hgctl uninstall --purge-istio-crd
|
hgctl uninstall --purge-resources
|
||||||
`,
|
`,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
return uninstall(cmd.OutOrStdout(), uiArgs)
|
return uninstall(cmd.OutOrStdout(), uiArgs)
|
||||||
@@ -60,18 +62,22 @@ func newUninstallCmd() *cobra.Command {
|
|||||||
|
|
||||||
// uninstall uninstalls control plane by either pruning by target revision or deleting specified manifests.
|
// uninstall uninstalls control plane by either pruning by target revision or deleting specified manifests.
|
||||||
func uninstall(writer io.Writer, uiArgs *uninstallArgs) error {
|
func uninstall(writer io.Writer, uiArgs *uninstallArgs) error {
|
||||||
profileName, ok := installer.GetInstalledYamlPath()
|
fmt.Fprintf(writer, "⌛️ Checking higress installed profiles...\n")
|
||||||
if !ok {
|
profileContexts, _ := getAllProfiles()
|
||||||
|
if len(profileContexts) == 0 {
|
||||||
fmt.Fprintf(writer, "\nHigress hasn't been installed yet!\n")
|
fmt.Fprintf(writer, "\nHigress hasn't been installed yet!\n")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
setFlags := make([]string, 0)
|
setFlags := make([]string, 0)
|
||||||
_, profile, err := helm.GenProfile(profileName, "", setFlags)
|
|
||||||
|
profileContext := promptProfileContexts(writer, profileContexts)
|
||||||
|
_, profile, err := helm.GenProfileFromProfileContent(util.ToYAML(profileContext.Profile), "", setFlags)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(writer, "🧐 Validating Profile: \"%s\" \n", profileName)
|
fmt.Fprintf(writer, "\n🧐 Validating Profile: \"%s\" \n", profileContext.PathOrName)
|
||||||
err = profile.Validate()
|
err = profile.Validate()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -82,7 +88,12 @@ func uninstall(writer io.Writer, uiArgs *uninstallArgs) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if profile.Global.Install == helm.InstallK8s || profile.Global.Install == helm.InstallLocalK8s {
|
if profile.Global.Install == helm.InstallK8s || profile.Global.Install == helm.InstallLocalK8s {
|
||||||
profile.Global.EnableIstioAPI = uiArgs.purgeIstioCRD
|
if profile.Global.EnableIstioAPI {
|
||||||
|
profile.Global.EnableIstioAPI = uiArgs.purgeResources
|
||||||
|
}
|
||||||
|
if profile.Global.EnableGatewayAPI {
|
||||||
|
profile.Global.EnableGatewayAPI = uiArgs.purgeResources
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = uninstallManifests(profile, writer, uiArgs)
|
err = uninstallManifests(profile, writer, uiArgs)
|
||||||
@@ -90,6 +101,11 @@ func uninstall(writer io.Writer, uiArgs *uninstallArgs) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove "~/.hgctl/profiles/install.yaml"
|
||||||
|
if oldProfileName, isExisted := installer.GetInstalledYamlPath(); isExisted {
|
||||||
|
_ = os.Remove(oldProfileName)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +126,7 @@ func promptUninstall(writer io.Writer) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func uninstallManifests(profile *helm.Profile, writer io.Writer, uiArgs *uninstallArgs) error {
|
func uninstallManifests(profile *helm.Profile, writer io.Writer, uiArgs *uninstallArgs) error {
|
||||||
installer, err := installer.NewInstaller(profile, writer, false)
|
installer, err := installer.NewInstaller(profile, writer, false, false, installer.UninstallInstallerMode)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,14 @@ package hgctl
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"os"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
||||||
"github.com/alibaba/higress/pkg/cmd/hgctl/installer"
|
"github.com/alibaba/higress/pkg/cmd/hgctl/installer"
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/kubernetes"
|
||||||
|
"github.com/alibaba/higress/pkg/cmd/hgctl/util"
|
||||||
"github.com/alibaba/higress/pkg/cmd/options"
|
"github.com/alibaba/higress/pkg/cmd/options"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@@ -33,6 +37,7 @@ func addUpgradeFlags(cmd *cobra.Command, args *upgradeArgs) {
|
|||||||
cmd.PersistentFlags().StringSliceVarP(&args.InFilenames, "filename", "f", nil, filenameFlagHelpStr)
|
cmd.PersistentFlags().StringSliceVarP(&args.InFilenames, "filename", "f", nil, filenameFlagHelpStr)
|
||||||
cmd.PersistentFlags().StringArrayVarP(&args.Set, "set", "s", nil, setFlagHelpStr)
|
cmd.PersistentFlags().StringArrayVarP(&args.Set, "set", "s", nil, setFlagHelpStr)
|
||||||
cmd.PersistentFlags().StringVarP(&args.ManifestsPath, "manifests", "d", "", manifestsFlagHelpStr)
|
cmd.PersistentFlags().StringVarP(&args.ManifestsPath, "manifests", "d", "", manifestsFlagHelpStr)
|
||||||
|
cmd.PersistentFlags().BoolVar(&args.Devel, "devel", false, "use development versions (alpha, beta, and release candidate releases), If version is set, this is ignored")
|
||||||
}
|
}
|
||||||
|
|
||||||
// newUpgradeCmd upgrades Istio control plane in-place with eligibility checks.
|
// newUpgradeCmd upgrades Istio control plane in-place with eligibility checks.
|
||||||
@@ -58,8 +63,9 @@ func newUpgradeCmd() *cobra.Command {
|
|||||||
// upgrade upgrade higress resources from the cluster.
|
// upgrade upgrade higress resources from the cluster.
|
||||||
func upgrade(writer io.Writer, iArgs *InstallArgs) error {
|
func upgrade(writer io.Writer, iArgs *InstallArgs) error {
|
||||||
setFlags := applyFlagAliases(iArgs.Set, iArgs.ManifestsPath)
|
setFlags := applyFlagAliases(iArgs.Set, iArgs.ManifestsPath)
|
||||||
profileName, ok := installer.GetInstalledYamlPath()
|
fmt.Fprintf(writer, "⌛️ Checking higress installed profiles...\n")
|
||||||
if !ok {
|
profileContexts, _ := getAllProfiles()
|
||||||
|
if len(profileContexts) == 0 {
|
||||||
fmt.Fprintf(writer, "\nHigress hasn't been installed yet!\n")
|
fmt.Fprintf(writer, "\nHigress hasn't been installed yet!\n")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -69,12 +75,14 @@ func upgrade(writer io.Writer, iArgs *InstallArgs) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, profile, err := helm.GenProfile(profileName, valuesOverlay, setFlags)
|
profileContext := promptProfileContexts(writer, profileContexts)
|
||||||
|
|
||||||
|
_, profile, err := helm.GenProfileFromProfileContent(util.ToYAML(profileContext.Profile), valuesOverlay, setFlags)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(writer, "🧐 Validating Profile: \"%s\" \n", profileName)
|
fmt.Fprintf(writer, "\n🧐 Validating Profile: \"%s\" \n", profileContext.PathOrName)
|
||||||
err = profile.Validate()
|
err = profile.Validate()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -84,11 +92,16 @@ func upgrade(writer io.Writer, iArgs *InstallArgs) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
err = upgradeManifests(profile, writer)
|
err = upgradeManifests(profile, writer, iArgs.Devel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove "~/.hgctl/profiles/install.yaml"
|
||||||
|
if oldProfileName, isExisted := installer.GetInstalledYamlPath(); isExisted {
|
||||||
|
_ = os.Remove(oldProfileName)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,8 +121,8 @@ func promptUpgrade(writer io.Writer) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func upgradeManifests(profile *helm.Profile, writer io.Writer) error {
|
func upgradeManifests(profile *helm.Profile, writer io.Writer, devel bool) error {
|
||||||
installer, err := installer.NewInstaller(profile, writer, false)
|
installer, err := installer.NewInstaller(profile, writer, false, devel, installer.UpgradeInstallerMode)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -121,3 +134,71 @@ func upgradeManifests(profile *helm.Profile, writer io.Writer) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getAllProfiles() ([]*installer.ProfileContext, error) {
|
||||||
|
profileContexts := make([]*installer.ProfileContext, 0)
|
||||||
|
profileInstalledPath, err := installer.GetProfileInstalledPath()
|
||||||
|
if err != nil {
|
||||||
|
return profileContexts, nil
|
||||||
|
}
|
||||||
|
fileProfileStore, err := installer.NewFileDirProfileStore(profileInstalledPath)
|
||||||
|
if err != nil {
|
||||||
|
return profileContexts, nil
|
||||||
|
}
|
||||||
|
fileProfileContexts, err := fileProfileStore.List()
|
||||||
|
if err == nil {
|
||||||
|
profileContexts = append(profileContexts, fileProfileContexts...)
|
||||||
|
}
|
||||||
|
|
||||||
|
cliClient, err := kubernetes.NewCLIClient(options.DefaultConfigFlags.ToRawKubeConfigLoader())
|
||||||
|
if err != nil {
|
||||||
|
return profileContexts, nil
|
||||||
|
}
|
||||||
|
configmapProfileStore, err := installer.NewConfigmapProfileStore(cliClient)
|
||||||
|
if err != nil {
|
||||||
|
return profileContexts, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
configmapProfileContexts, err := configmapProfileStore.List()
|
||||||
|
if err == nil {
|
||||||
|
profileContexts = append(profileContexts, configmapProfileContexts...)
|
||||||
|
}
|
||||||
|
return profileContexts, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func promptProfileContexts(writer io.Writer, profileContexts []*installer.ProfileContext) *installer.ProfileContext {
|
||||||
|
if len(profileContexts) == 1 {
|
||||||
|
fmt.Fprintf(writer, "\nFound a profile:: ")
|
||||||
|
} else {
|
||||||
|
fmt.Fprintf(writer, "\nPlease select higress installed configration profiles:\n")
|
||||||
|
}
|
||||||
|
index := 1
|
||||||
|
for _, profileContext := range profileContexts {
|
||||||
|
if len(profileContexts) > 1 {
|
||||||
|
fmt.Fprintf(writer, "\n%d: ", index)
|
||||||
|
}
|
||||||
|
fmt.Fprintf(writer, "install mode: %s, profile location: %s", profileContext.Install, profileContext.PathOrName)
|
||||||
|
if len(profileContext.Namespace) > 0 {
|
||||||
|
fmt.Fprintf(writer, ", namespace: %s", profileContext.Namespace)
|
||||||
|
}
|
||||||
|
if len(profileContext.HigressVersion) > 0 {
|
||||||
|
fmt.Fprintf(writer, ", version: %s", profileContext.HigressVersion)
|
||||||
|
}
|
||||||
|
fmt.Fprintf(writer, "\n")
|
||||||
|
index++
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(profileContexts) == 1 {
|
||||||
|
return profileContexts[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
answer := ""
|
||||||
|
for {
|
||||||
|
fmt.Fprintf(writer, "\nPlease input 1 to %d select, input your selection:", len(profileContexts))
|
||||||
|
fmt.Scanln(&answer)
|
||||||
|
index, err := strconv.Atoi(answer)
|
||||||
|
if err == nil && index >= 1 && index <= len(profileContexts) {
|
||||||
|
return profileContexts[index-1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ func getServerCommand() *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
serveCmd.PersistentFlags().StringVar(&serverArgs.GatewaySelectorKey, "gatewaySelectorKey", "higress", "gateway resource selector label key")
|
serveCmd.PersistentFlags().StringVar(&serverArgs.GatewaySelectorKey, "gatewaySelectorKey", "higress", "gateway resource selector label key")
|
||||||
serveCmd.PersistentFlags().StringVar(&serverArgs.GatewaySelectorValue, "gatewaySelectorValue", "higress-gateway", "gateway resource selector label value")
|
serveCmd.PersistentFlags().StringVar(&serverArgs.GatewaySelectorValue, "gatewaySelectorValue", "higress-system-higress-gateway", "gateway resource selector label value")
|
||||||
serveCmd.PersistentFlags().BoolVar(&serverArgs.EnableStatus, "enableStatus", true, "enable the ingress status syncer which use to update the ip in ingress's status")
|
serveCmd.PersistentFlags().BoolVar(&serverArgs.EnableStatus, "enableStatus", true, "enable the ingress status syncer which use to update the ip in ingress's status")
|
||||||
serveCmd.PersistentFlags().StringVar(&serverArgs.IngressClass, "ingressClass", innerconstants.DefaultIngressClass, "if not empty, only watch the ingresses have the specified class, otherwise watch all ingresses")
|
serveCmd.PersistentFlags().StringVar(&serverArgs.IngressClass, "ingressClass", innerconstants.DefaultIngressClass, "if not empty, only watch the ingresses have the specified class, otherwise watch all ingresses")
|
||||||
serveCmd.PersistentFlags().StringVar(&serverArgs.WatchNamespace, "watchNamespace", "", "if not empty, only wath the ingresses in the specified namespace, otherwise watch in all namespacees")
|
serveCmd.PersistentFlags().StringVar(&serverArgs.WatchNamespace, "watchNamespace", "", "if not empty, only wath the ingresses in the specified namespace, otherwise watch in all namespacees")
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
@@ -140,8 +141,6 @@ type IngressConfig struct {
|
|||||||
|
|
||||||
annotationHandler annotations.AnnotationHandler
|
annotationHandler annotations.AnnotationHandler
|
||||||
|
|
||||||
globalGatewayName string
|
|
||||||
|
|
||||||
namespace string
|
namespace string
|
||||||
|
|
||||||
clusterId string
|
clusterId string
|
||||||
@@ -157,13 +156,11 @@ func NewIngressConfig(localKubeClient kube.Client, XDSUpdater model.XDSUpdater,
|
|||||||
XDSUpdater: XDSUpdater,
|
XDSUpdater: XDSUpdater,
|
||||||
annotationHandler: annotations.NewAnnotationHandlerManager(),
|
annotationHandler: annotations.NewAnnotationHandlerManager(),
|
||||||
clusterId: clusterId,
|
clusterId: clusterId,
|
||||||
globalGatewayName: namespace + "/" +
|
watchedSecretSet: sets.NewSet(),
|
||||||
common.CreateConvertedName(clusterId, "global"),
|
namespace: namespace,
|
||||||
watchedSecretSet: sets.NewSet(),
|
mcpbridgeReconciled: atomic.NewBool(false),
|
||||||
namespace: namespace,
|
wasmPlugins: make(map[string]*extensions.WasmPlugin),
|
||||||
mcpbridgeReconciled: atomic.NewBool(false),
|
http2rpcs: make(map[string]*higressv1.Http2Rpc),
|
||||||
wasmPlugins: make(map[string]*extensions.WasmPlugin),
|
|
||||||
http2rpcs: make(map[string]*higressv1.Http2Rpc),
|
|
||||||
}
|
}
|
||||||
mcpbridgeController := mcpbridge.NewController(localKubeClient, clusterId)
|
mcpbridgeController := mcpbridge.NewController(localKubeClient, clusterId)
|
||||||
mcpbridgeController.AddEventHandler(config.AddOrUpdateMcpBridge, config.DeleteMcpBridge)
|
mcpbridgeController.AddEventHandler(config.AddOrUpdateMcpBridge, config.DeleteMcpBridge)
|
||||||
@@ -478,9 +475,6 @@ func (m *IngressConfig) convertVirtualService(configs []common.WrapperConfig) []
|
|||||||
gateways := []string{m.namespace + "/" +
|
gateways := []string{m.namespace + "/" +
|
||||||
common.CreateConvertedName(m.clusterId, cleanHost),
|
common.CreateConvertedName(m.clusterId, cleanHost),
|
||||||
common.CreateConvertedName(constants.IstioIngressGatewayName, cleanHost)}
|
common.CreateConvertedName(constants.IstioIngressGatewayName, cleanHost)}
|
||||||
if host != "*" {
|
|
||||||
gateways = append(gateways, m.globalGatewayName)
|
|
||||||
}
|
|
||||||
|
|
||||||
wrapperVS, exist := convertOptions.VirtualServices[host]
|
wrapperVS, exist := convertOptions.VirtualServices[host]
|
||||||
if !exist {
|
if !exist {
|
||||||
@@ -530,7 +524,7 @@ func (m *IngressConfig) convertEnvoyFilter(convertOptions *common.ConvertOptions
|
|||||||
IngressLog.Infof("Found http2rpc for name %s", http2rpc.Name)
|
IngressLog.Infof("Found http2rpc for name %s", http2rpc.Name)
|
||||||
envoyFilter, err := m.constructHttp2RpcEnvoyFilter(http2rpc, route, m.namespace)
|
envoyFilter, err := m.constructHttp2RpcEnvoyFilter(http2rpc, route, m.namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
IngressLog.Errorf("Construct http2rpc EnvoyFilter error %v", err)
|
IngressLog.Infof("Construct http2rpc EnvoyFilter error %v", err)
|
||||||
} else {
|
} else {
|
||||||
IngressLog.Infof("Append http2rpc EnvoyFilter for name %s", http2rpc.Name)
|
IngressLog.Infof("Append http2rpc EnvoyFilter for name %s", http2rpc.Name)
|
||||||
envoyFilters = append(envoyFilters, *envoyFilter)
|
envoyFilters = append(envoyFilters, *envoyFilter)
|
||||||
@@ -573,6 +567,7 @@ func (m *IngressConfig) convertEnvoyFilter(convertOptions *common.ConvertOptions
|
|||||||
|
|
||||||
// TODO Support other envoy filters
|
// TODO Support other envoy filters
|
||||||
|
|
||||||
|
IngressLog.Infof("Found %d number of envoyFilters", len(envoyFilters))
|
||||||
m.mutex.Lock()
|
m.mutex.Lock()
|
||||||
m.cachedEnvoyFilters = envoyFilters
|
m.cachedEnvoyFilters = envoyFilters
|
||||||
m.mutex.Unlock()
|
m.mutex.Unlock()
|
||||||
@@ -676,6 +671,18 @@ func (m *IngressConfig) convertDestinationRule(configs []common.WrapperConfig) [
|
|||||||
|
|
||||||
out := make([]config.Config, 0, len(destinationRules))
|
out := make([]config.Config, 0, len(destinationRules))
|
||||||
for _, dr := range destinationRules {
|
for _, dr := range destinationRules {
|
||||||
|
sort.SliceStable(dr.DestinationRule.TrafficPolicy.PortLevelSettings, func(i, j int) bool {
|
||||||
|
portI := dr.DestinationRule.TrafficPolicy.PortLevelSettings[i].Port
|
||||||
|
portJ := dr.DestinationRule.TrafficPolicy.PortLevelSettings[j].Port
|
||||||
|
if portI == nil && portJ == nil {
|
||||||
|
return true
|
||||||
|
} else if portI == nil {
|
||||||
|
return true
|
||||||
|
} else if portJ == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return portI.Number < portJ.Number
|
||||||
|
})
|
||||||
drName := util.CreateDestinationRuleName(m.clusterId, dr.ServiceKey.Namespace, dr.ServiceKey.Name)
|
drName := util.CreateDestinationRuleName(m.clusterId, dr.ServiceKey.Namespace, dr.ServiceKey.Name)
|
||||||
out = append(out, config.Config{
|
out = append(out, config.Config{
|
||||||
Meta: config.Meta{
|
Meta: config.Meta{
|
||||||
@@ -1003,9 +1010,23 @@ func (m *IngressConfig) AddOrUpdateHttp2Rpc(clusterNamespacedName util.ClusterNa
|
|||||||
m.http2rpcs[clusterNamespacedName.Name] = &http2rpc.Spec
|
m.http2rpcs[clusterNamespacedName.Name] = &http2rpc.Spec
|
||||||
m.mutex.Unlock()
|
m.mutex.Unlock()
|
||||||
IngressLog.Infof("AddOrUpdateHttp2Rpc http2rpc ingress name %s", clusterNamespacedName.Name)
|
IngressLog.Infof("AddOrUpdateHttp2Rpc http2rpc ingress name %s", clusterNamespacedName.Name)
|
||||||
|
push := func(kind config.GroupVersionKind) {
|
||||||
|
m.XDSUpdater.ConfigUpdate(&model.PushRequest{
|
||||||
|
Full: true,
|
||||||
|
ConfigsUpdated: map[model.ConfigKey]struct{}{{
|
||||||
|
Kind: kind,
|
||||||
|
Name: clusterNamespacedName.Name,
|
||||||
|
Namespace: clusterNamespacedName.Namespace,
|
||||||
|
}: {}},
|
||||||
|
Reason: []model.TriggerReason{"Http2Rpc-AddOrUpdate"},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
push(gvk.VirtualService)
|
||||||
|
push(gvk.EnvoyFilter)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *IngressConfig) DeleteHttp2Rpc(clusterNamespacedName util.ClusterNamespacedName) {
|
func (m *IngressConfig) DeleteHttp2Rpc(clusterNamespacedName util.ClusterNamespacedName) {
|
||||||
|
IngressLog.Infof("Http2Rpc triggerd deleted event %s", clusterNamespacedName.Name)
|
||||||
if clusterNamespacedName.Namespace != m.namespace {
|
if clusterNamespacedName.Namespace != m.namespace {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -1017,7 +1038,20 @@ func (m *IngressConfig) DeleteHttp2Rpc(clusterNamespacedName util.ClusterNamespa
|
|||||||
}
|
}
|
||||||
m.mutex.Unlock()
|
m.mutex.Unlock()
|
||||||
if hit {
|
if hit {
|
||||||
IngressLog.Debugf("Http2Rpc triggerd deleted %s", clusterNamespacedName.Name)
|
IngressLog.Infof("Http2Rpc triggerd deleted event executed %s", clusterNamespacedName.Name)
|
||||||
|
push := func(kind config.GroupVersionKind) {
|
||||||
|
m.XDSUpdater.ConfigUpdate(&model.PushRequest{
|
||||||
|
Full: true,
|
||||||
|
ConfigsUpdated: map[model.ConfigKey]struct{}{{
|
||||||
|
Kind: kind,
|
||||||
|
Name: clusterNamespacedName.Name,
|
||||||
|
Namespace: clusterNamespacedName.Namespace,
|
||||||
|
}: {}},
|
||||||
|
Reason: []model.TriggerReason{"Http2Rpc-Deleted"},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
push(gvk.VirtualService)
|
||||||
|
push(gvk.EnvoyFilter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1241,12 +1275,21 @@ func (m *IngressConfig) constructHttp2RpcMethods(dubbo *higressv1.DubboService)
|
|||||||
var method = make(map[string]interface{})
|
var method = make(map[string]interface{})
|
||||||
method["name"] = serviceMethod.GetServiceMethod()
|
method["name"] = serviceMethod.GetServiceMethod()
|
||||||
var params []interface{}
|
var params []interface{}
|
||||||
for _, methodParam := range serviceMethod.GetParams() {
|
// paramFromEntireBody is for methods with single parameter. So when paramFromEntireBody exists, we just ignore parmas.
|
||||||
|
var paramFromEntireBody = serviceMethod.GetParamFromEntireBody()
|
||||||
|
if paramFromEntireBody != nil {
|
||||||
var param = make(map[string]interface{})
|
var param = make(map[string]interface{})
|
||||||
param["extract_key"] = methodParam.GetParamKey()
|
param["extract_key_spec"] = Http2RpcParamSourceMap()["BODY"]
|
||||||
param["extract_key_spec"] = Http2RpcParamSourceMap()[methodParam.GetParamSource()]
|
param["mapping_type"] = paramFromEntireBody.GetParamType()
|
||||||
param["mapping_type"] = methodParam.GetParamType()
|
|
||||||
params = append(params, param)
|
params = append(params, param)
|
||||||
|
} else {
|
||||||
|
for _, methodParam := range serviceMethod.GetParams() {
|
||||||
|
var param = make(map[string]interface{})
|
||||||
|
param["extract_key"] = methodParam.GetParamKey()
|
||||||
|
param["extract_key_spec"] = Http2RpcParamSourceMap()[methodParam.GetParamSource()]
|
||||||
|
param["mapping_type"] = methodParam.GetParamType()
|
||||||
|
params = append(params, param)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
method["parameter_mapping"] = params
|
method["parameter_mapping"] = params
|
||||||
var path_matcher = make(map[string]interface{})
|
var path_matcher = make(map[string]interface{})
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
"foo.com": {
|
"foo.com": {
|
||||||
Meta: config.Meta{
|
Meta: config.Meta{
|
||||||
GroupVersionKind: gvk.Gateway,
|
GroupVersionKind: gvk.Gateway,
|
||||||
Name: "istio-autogenerated-k8s-ingress-foo-com",
|
Name: "istio-autogenerated-k8s-ingress-" + common.CleanHost("foo.com"),
|
||||||
Namespace: "wakanda",
|
Namespace: "wakanda",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
common.ClusterIdAnnotation: "ingress-v1beta1",
|
common.ClusterIdAnnotation: "ingress-v1beta1",
|
||||||
@@ -270,7 +270,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 80,
|
Number: 80,
|
||||||
Protocol: "HTTP",
|
Protocol: "HTTP",
|
||||||
Name: "http-80-ingress-ingress-v1beta1-wakanda-test-1-foo-com",
|
Name: "http-80-ingress-ingress-v1beta1",
|
||||||
},
|
},
|
||||||
Hosts: []string{"foo.com"},
|
Hosts: []string{"foo.com"},
|
||||||
},
|
},
|
||||||
@@ -278,7 +278,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 443,
|
Number: 443,
|
||||||
Protocol: "HTTPS",
|
Protocol: "HTTPS",
|
||||||
Name: "https-443-ingress-ingress-v1beta1-wakanda-test-2-foo-com",
|
Name: "https-443-ingress-ingress-v1beta1",
|
||||||
},
|
},
|
||||||
Hosts: []string{"foo.com"},
|
Hosts: []string{"foo.com"},
|
||||||
Tls: &networking.ServerTLSSettings{
|
Tls: &networking.ServerTLSSettings{
|
||||||
@@ -293,7 +293,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
"test.com": {
|
"test.com": {
|
||||||
Meta: config.Meta{
|
Meta: config.Meta{
|
||||||
GroupVersionKind: gvk.Gateway,
|
GroupVersionKind: gvk.Gateway,
|
||||||
Name: "istio-autogenerated-k8s-ingress-test-com",
|
Name: "istio-autogenerated-k8s-ingress-" + common.CleanHost("test.com"),
|
||||||
Namespace: "wakanda",
|
Namespace: "wakanda",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
common.ClusterIdAnnotation: "ingress-v1beta1",
|
common.ClusterIdAnnotation: "ingress-v1beta1",
|
||||||
@@ -306,7 +306,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 80,
|
Number: 80,
|
||||||
Protocol: "HTTP",
|
Protocol: "HTTP",
|
||||||
Name: "http-80-ingress-ingress-v1beta1-wakanda-test-1-test-com",
|
Name: "http-80-ingress-ingress-v1beta1",
|
||||||
},
|
},
|
||||||
Hosts: []string{"test.com"},
|
Hosts: []string{"test.com"},
|
||||||
},
|
},
|
||||||
@@ -314,7 +314,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 443,
|
Number: 443,
|
||||||
Protocol: "HTTPS",
|
Protocol: "HTTPS",
|
||||||
Name: "https-443-ingress-ingress-v1beta1-wakanda-test-1-test-com",
|
Name: "https-443-ingress-ingress-v1beta1",
|
||||||
},
|
},
|
||||||
Hosts: []string{"test.com"},
|
Hosts: []string{"test.com"},
|
||||||
Tls: &networking.ServerTLSSettings{
|
Tls: &networking.ServerTLSSettings{
|
||||||
@@ -329,7 +329,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
"bar.com": {
|
"bar.com": {
|
||||||
Meta: config.Meta{
|
Meta: config.Meta{
|
||||||
GroupVersionKind: gvk.Gateway,
|
GroupVersionKind: gvk.Gateway,
|
||||||
Name: "istio-autogenerated-k8s-ingress-bar-com",
|
Name: "istio-autogenerated-k8s-ingress-" + common.CleanHost("bar.com"),
|
||||||
Namespace: "wakanda",
|
Namespace: "wakanda",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
common.ClusterIdAnnotation: "ingress-v1beta1",
|
common.ClusterIdAnnotation: "ingress-v1beta1",
|
||||||
@@ -342,7 +342,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 80,
|
Number: 80,
|
||||||
Protocol: "HTTP",
|
Protocol: "HTTP",
|
||||||
Name: "http-80-ingress-ingress-v1beta1-wakanda-test-2-bar-com",
|
Name: "http-80-ingress-ingress-v1beta1",
|
||||||
},
|
},
|
||||||
Hosts: []string{"bar.com"},
|
Hosts: []string{"bar.com"},
|
||||||
},
|
},
|
||||||
@@ -471,7 +471,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
"foo.com": {
|
"foo.com": {
|
||||||
Meta: config.Meta{
|
Meta: config.Meta{
|
||||||
GroupVersionKind: gvk.Gateway,
|
GroupVersionKind: gvk.Gateway,
|
||||||
Name: "istio-autogenerated-k8s-ingress-foo-com",
|
Name: "istio-autogenerated-k8s-ingress-" + common.CleanHost("foo.com"),
|
||||||
Namespace: "wakanda",
|
Namespace: "wakanda",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
common.ClusterIdAnnotation: "ingress-v1",
|
common.ClusterIdAnnotation: "ingress-v1",
|
||||||
@@ -484,7 +484,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 80,
|
Number: 80,
|
||||||
Protocol: "HTTP",
|
Protocol: "HTTP",
|
||||||
Name: "http-80-ingress-ingress-v1-wakanda-test-1-foo-com",
|
Name: "http-80-ingress-ingress-v1",
|
||||||
},
|
},
|
||||||
Hosts: []string{"foo.com"},
|
Hosts: []string{"foo.com"},
|
||||||
},
|
},
|
||||||
@@ -492,7 +492,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 443,
|
Number: 443,
|
||||||
Protocol: "HTTPS",
|
Protocol: "HTTPS",
|
||||||
Name: "https-443-ingress-ingress-v1-wakanda-test-2-foo-com",
|
Name: "https-443-ingress-ingress-v1",
|
||||||
},
|
},
|
||||||
Hosts: []string{"foo.com"},
|
Hosts: []string{"foo.com"},
|
||||||
Tls: &networking.ServerTLSSettings{
|
Tls: &networking.ServerTLSSettings{
|
||||||
@@ -507,7 +507,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
"test.com": {
|
"test.com": {
|
||||||
Meta: config.Meta{
|
Meta: config.Meta{
|
||||||
GroupVersionKind: gvk.Gateway,
|
GroupVersionKind: gvk.Gateway,
|
||||||
Name: "istio-autogenerated-k8s-ingress-test-com",
|
Name: "istio-autogenerated-k8s-ingress-" + common.CleanHost("test.com"),
|
||||||
Namespace: "wakanda",
|
Namespace: "wakanda",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
common.ClusterIdAnnotation: "ingress-v1",
|
common.ClusterIdAnnotation: "ingress-v1",
|
||||||
@@ -520,7 +520,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 80,
|
Number: 80,
|
||||||
Protocol: "HTTP",
|
Protocol: "HTTP",
|
||||||
Name: "http-80-ingress-ingress-v1-wakanda-test-1-test-com",
|
Name: "http-80-ingress-ingress-v1",
|
||||||
},
|
},
|
||||||
Hosts: []string{"test.com"},
|
Hosts: []string{"test.com"},
|
||||||
},
|
},
|
||||||
@@ -528,7 +528,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 443,
|
Number: 443,
|
||||||
Protocol: "HTTPS",
|
Protocol: "HTTPS",
|
||||||
Name: "https-443-ingress-ingress-v1-wakanda-test-1-test-com",
|
Name: "https-443-ingress-ingress-v1",
|
||||||
},
|
},
|
||||||
Hosts: []string{"test.com"},
|
Hosts: []string{"test.com"},
|
||||||
Tls: &networking.ServerTLSSettings{
|
Tls: &networking.ServerTLSSettings{
|
||||||
@@ -543,7 +543,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
"bar.com": {
|
"bar.com": {
|
||||||
Meta: config.Meta{
|
Meta: config.Meta{
|
||||||
GroupVersionKind: gvk.Gateway,
|
GroupVersionKind: gvk.Gateway,
|
||||||
Name: "istio-autogenerated-k8s-ingress-bar-com",
|
Name: "istio-autogenerated-k8s-ingress-" + common.CleanHost("bar.com"),
|
||||||
Namespace: "wakanda",
|
Namespace: "wakanda",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
common.ClusterIdAnnotation: "ingress-v1",
|
common.ClusterIdAnnotation: "ingress-v1",
|
||||||
@@ -556,7 +556,7 @@ func TestConvertGatewaysForIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 80,
|
Number: 80,
|
||||||
Protocol: "HTTP",
|
Protocol: "HTTP",
|
||||||
Name: "http-80-ingress-ingress-v1-wakanda-test-2-bar-com",
|
Name: "http-80-ingress-ingress-v1",
|
||||||
},
|
},
|
||||||
Hosts: []string{"bar.com"},
|
Hosts: []string{"bar.com"},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -66,8 +66,6 @@ type KIngressConfig struct {
|
|||||||
|
|
||||||
annotationHandler annotations.AnnotationHandler
|
annotationHandler annotations.AnnotationHandler
|
||||||
|
|
||||||
globalGatewayName string
|
|
||||||
|
|
||||||
namespace string
|
namespace string
|
||||||
|
|
||||||
clusterId string
|
clusterId string
|
||||||
@@ -86,10 +84,8 @@ func NewKIngressConfig(localKubeClient kube.Client, XDSUpdater model.XDSUpdater,
|
|||||||
XDSUpdater: XDSUpdater,
|
XDSUpdater: XDSUpdater,
|
||||||
annotationHandler: annotations.NewAnnotationHandlerManager(),
|
annotationHandler: annotations.NewAnnotationHandlerManager(),
|
||||||
clusterId: clusterId,
|
clusterId: clusterId,
|
||||||
globalGatewayName: namespace + "/" +
|
watchedSecretSet: sets.NewSet(),
|
||||||
common.CreateConvertedName(clusterId, "global"),
|
namespace: namespace,
|
||||||
watchedSecretSet: sets.NewSet(),
|
|
||||||
namespace: namespace,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return config
|
return config
|
||||||
@@ -318,9 +314,6 @@ func (m *KIngressConfig) convertVirtualService(configs []common.WrapperConfig) [
|
|||||||
gateways := []string{m.namespace + "/" +
|
gateways := []string{m.namespace + "/" +
|
||||||
common.CreateConvertedName(m.clusterId, cleanHost),
|
common.CreateConvertedName(m.clusterId, cleanHost),
|
||||||
common.CreateConvertedName(constants.IstioIngressGatewayName, cleanHost)}
|
common.CreateConvertedName(constants.IstioIngressGatewayName, cleanHost)}
|
||||||
if host != "*" {
|
|
||||||
gateways = append(gateways, m.globalGatewayName)
|
|
||||||
}
|
|
||||||
|
|
||||||
wrapperVS, exist := convertOptions.VirtualServices[host]
|
wrapperVS, exist := convertOptions.VirtualServices[host]
|
||||||
if !exist {
|
if !exist {
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ func TestConvertGatewaysForKIngress(t *testing.T) {
|
|||||||
"foo.com": {
|
"foo.com": {
|
||||||
Meta: config.Meta{
|
Meta: config.Meta{
|
||||||
GroupVersionKind: gvk.Gateway,
|
GroupVersionKind: gvk.Gateway,
|
||||||
Name: "istio-autogenerated-k8s-ingress-foo-com",
|
Name: "istio-autogenerated-k8s-ingress-" + common.CleanHost("foo.com"),
|
||||||
Namespace: "wakanda",
|
Namespace: "wakanda",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
common.ClusterIdAnnotation: "kingress",
|
common.ClusterIdAnnotation: "kingress",
|
||||||
@@ -376,7 +376,7 @@ func TestConvertGatewaysForKIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 80,
|
Number: 80,
|
||||||
Protocol: "HTTP",
|
Protocol: "HTTP",
|
||||||
Name: "http-80-ingress-kingress-wakanda-test-1-foo-com",
|
Name: "http-80-ingress-kingress",
|
||||||
},
|
},
|
||||||
Hosts: []string{"foo.com"},
|
Hosts: []string{"foo.com"},
|
||||||
//Tls: &networking.ServerTLSSettings{
|
//Tls: &networking.ServerTLSSettings{
|
||||||
@@ -387,7 +387,7 @@ func TestConvertGatewaysForKIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 443,
|
Number: 443,
|
||||||
Protocol: "HTTPS",
|
Protocol: "HTTPS",
|
||||||
Name: "https-443-ingress-kingress-wakanda-test-2-foo-com",
|
Name: "https-443-ingress-kingress",
|
||||||
},
|
},
|
||||||
Hosts: []string{"foo.com"},
|
Hosts: []string{"foo.com"},
|
||||||
Tls: &networking.ServerTLSSettings{
|
Tls: &networking.ServerTLSSettings{
|
||||||
@@ -402,7 +402,7 @@ func TestConvertGatewaysForKIngress(t *testing.T) {
|
|||||||
"test.com": {
|
"test.com": {
|
||||||
Meta: config.Meta{
|
Meta: config.Meta{
|
||||||
GroupVersionKind: gvk.Gateway,
|
GroupVersionKind: gvk.Gateway,
|
||||||
Name: "istio-autogenerated-k8s-ingress-test-com",
|
Name: "istio-autogenerated-k8s-ingress-" + common.CleanHost("test.com"),
|
||||||
Namespace: "wakanda",
|
Namespace: "wakanda",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
common.ClusterIdAnnotation: "kingress",
|
common.ClusterIdAnnotation: "kingress",
|
||||||
@@ -415,7 +415,7 @@ func TestConvertGatewaysForKIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 80,
|
Number: 80,
|
||||||
Protocol: "HTTP",
|
Protocol: "HTTP",
|
||||||
Name: "http-80-ingress-kingress-wakanda-test-1-test-com",
|
Name: "http-80-ingress-kingress",
|
||||||
},
|
},
|
||||||
Hosts: []string{"test.com"},
|
Hosts: []string{"test.com"},
|
||||||
//Tls: &networking.ServerTLSSettings{
|
//Tls: &networking.ServerTLSSettings{
|
||||||
@@ -426,7 +426,7 @@ func TestConvertGatewaysForKIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 443,
|
Number: 443,
|
||||||
Protocol: "HTTPS",
|
Protocol: "HTTPS",
|
||||||
Name: "https-443-ingress-kingress-wakanda-test-1-test-com",
|
Name: "https-443-ingress-kingress",
|
||||||
},
|
},
|
||||||
Hosts: []string{"test.com"},
|
Hosts: []string{"test.com"},
|
||||||
Tls: &networking.ServerTLSSettings{
|
Tls: &networking.ServerTLSSettings{
|
||||||
@@ -441,7 +441,7 @@ func TestConvertGatewaysForKIngress(t *testing.T) {
|
|||||||
"bar.com": {
|
"bar.com": {
|
||||||
Meta: config.Meta{
|
Meta: config.Meta{
|
||||||
GroupVersionKind: gvk.Gateway,
|
GroupVersionKind: gvk.Gateway,
|
||||||
Name: "istio-autogenerated-k8s-ingress-bar-com",
|
Name: "istio-autogenerated-k8s-ingress-" + common.CleanHost("bar.com"),
|
||||||
Namespace: "wakanda",
|
Namespace: "wakanda",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
common.ClusterIdAnnotation: "kingress",
|
common.ClusterIdAnnotation: "kingress",
|
||||||
@@ -454,7 +454,7 @@ func TestConvertGatewaysForKIngress(t *testing.T) {
|
|||||||
Port: &networking.Port{
|
Port: &networking.Port{
|
||||||
Number: 80,
|
Number: 80,
|
||||||
Protocol: "HTTP",
|
Protocol: "HTTP",
|
||||||
Name: "http-80-ingress-kingress-wakanda-test-2-bar-com",
|
Name: "http-80-ingress-kingress",
|
||||||
},
|
},
|
||||||
Hosts: []string{"bar.com"},
|
Hosts: []string{"bar.com"},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
package annotations
|
package annotations
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
networking "istio.io/api/networking/v1alpha3"
|
networking "istio.io/api/networking/v1alpha3"
|
||||||
"istio.io/istio/pilot/pkg/util/sets"
|
"istio.io/istio/pilot/pkg/util/sets"
|
||||||
listersv1 "k8s.io/client-go/listers/core/v1"
|
listersv1 "k8s.io/client-go/listers/core/v1"
|
||||||
@@ -54,10 +56,14 @@ type Ingress struct {
|
|||||||
|
|
||||||
IPAccessControl *IPAccessControlConfig
|
IPAccessControl *IPAccessControlConfig
|
||||||
|
|
||||||
|
Timeout *TimeoutConfig
|
||||||
|
|
||||||
Retry *RetryConfig
|
Retry *RetryConfig
|
||||||
|
|
||||||
LoadBalance *LoadBalanceConfig
|
LoadBalance *LoadBalanceConfig
|
||||||
|
|
||||||
|
localRateLimit *localRateLimitConfig
|
||||||
|
|
||||||
Fallback *FallbackConfig
|
Fallback *FallbackConfig
|
||||||
|
|
||||||
Auth *AuthConfig
|
Auth *AuthConfig
|
||||||
@@ -73,12 +79,17 @@ type Ingress struct {
|
|||||||
Http2Rpc *Http2RpcConfig
|
Http2Rpc *Http2RpcConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Ingress) NeedRegexMatch() bool {
|
func (i *Ingress) NeedRegexMatch(path string) bool {
|
||||||
if i.Rewrite == nil {
|
if i.Rewrite == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if i.Rewrite.RewriteTarget != "" && strings.ContainsAny(path, `\.+*?()|[]{}^$`) {
|
||||||
return i.Rewrite.RewriteTarget != "" || i.IsPrefixRegexMatch() || i.IsFullPathRegexMatch()
|
return true
|
||||||
|
}
|
||||||
|
if strings.ContainsAny(i.Rewrite.RewriteTarget, `$\`) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return i.IsPrefixRegexMatch() || i.IsFullPathRegexMatch()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Ingress) IsPrefixRegexMatch() bool {
|
func (i *Ingress) IsPrefixRegexMatch() bool {
|
||||||
@@ -143,8 +154,10 @@ func NewAnnotationHandlerManager() AnnotationHandler {
|
|||||||
rewrite{},
|
rewrite{},
|
||||||
upstreamTLS{},
|
upstreamTLS{},
|
||||||
ipAccessControl{},
|
ipAccessControl{},
|
||||||
|
timeout{},
|
||||||
retry{},
|
retry{},
|
||||||
loadBalance{},
|
loadBalance{},
|
||||||
|
localRateLimit{},
|
||||||
fallback{},
|
fallback{},
|
||||||
auth{},
|
auth{},
|
||||||
destination{},
|
destination{},
|
||||||
@@ -164,7 +177,9 @@ func NewAnnotationHandlerManager() AnnotationHandler {
|
|||||||
redirect{},
|
redirect{},
|
||||||
rewrite{},
|
rewrite{},
|
||||||
ipAccessControl{},
|
ipAccessControl{},
|
||||||
|
timeout{},
|
||||||
retry{},
|
retry{},
|
||||||
|
localRateLimit{},
|
||||||
fallback{},
|
fallback{},
|
||||||
ignoreCaseMatching{},
|
ignoreCaseMatching{},
|
||||||
match{},
|
match{},
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ import "testing"
|
|||||||
|
|
||||||
func TestNeedRegexMatch(t *testing.T) {
|
func TestNeedRegexMatch(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
input *Ingress
|
input *Ingress
|
||||||
expect bool
|
inputPath string
|
||||||
|
expect bool
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
input: &Ingress{},
|
input: &Ingress{},
|
||||||
@@ -34,7 +35,7 @@ func TestNeedRegexMatch(t *testing.T) {
|
|||||||
{
|
{
|
||||||
input: &Ingress{
|
input: &Ingress{
|
||||||
Rewrite: &RewriteConfig{
|
Rewrite: &RewriteConfig{
|
||||||
RewriteTarget: "/test",
|
UseRegex: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expect: true,
|
expect: true,
|
||||||
@@ -42,17 +43,55 @@ func TestNeedRegexMatch(t *testing.T) {
|
|||||||
{
|
{
|
||||||
input: &Ingress{
|
input: &Ingress{
|
||||||
Rewrite: &RewriteConfig{
|
Rewrite: &RewriteConfig{
|
||||||
UseRegex: true,
|
UseRegex: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expect: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: &Ingress{
|
||||||
|
Rewrite: &RewriteConfig{
|
||||||
|
UseRegex: false,
|
||||||
|
RewriteTarget: "/$1",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expect: true,
|
expect: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
input: &Ingress{
|
||||||
|
Rewrite: &RewriteConfig{
|
||||||
|
UseRegex: false,
|
||||||
|
RewriteTarget: "/",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
inputPath: "/.*",
|
||||||
|
expect: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: &Ingress{
|
||||||
|
Rewrite: &RewriteConfig{
|
||||||
|
UseRegex: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
inputPath: "/.",
|
||||||
|
expect: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: &Ingress{
|
||||||
|
Rewrite: &RewriteConfig{
|
||||||
|
UseRegex: false,
|
||||||
|
RewriteTarget: "/",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
inputPath: "/",
|
||||||
|
expect: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, testCase := range testCases {
|
for _, testCase := range testCases {
|
||||||
t.Run("", func(t *testing.T) {
|
t.Run("", func(t *testing.T) {
|
||||||
if testCase.input.NeedRegexMatch() != testCase.expect {
|
if testCase.input.NeedRegexMatch(testCase.inputPath) != testCase.expect {
|
||||||
t.Fatalf("Should be %t, but actual is %t", testCase.expect, testCase.input.NeedRegexMatch())
|
t.Fatalf("Should be %t, but actual is %t", testCase.expect, !testCase.expect)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ func ApplyByWeight(canary, route *networking.HTTPRoute, canaryIngress *Ingress)
|
|||||||
|
|
||||||
// canary route use the header control applied on itself.
|
// canary route use the header control applied on itself.
|
||||||
headerControl{}.ApplyRoute(canary, canaryIngress)
|
headerControl{}.ApplyRoute(canary, canaryIngress)
|
||||||
|
// reset
|
||||||
|
canary.Route[0].FallbackClusters = nil
|
||||||
// Move route level to destination level
|
// Move route level to destination level
|
||||||
canary.Route[0].Headers = canary.Headers
|
canary.Route[0].Headers = canary.Headers
|
||||||
|
|
||||||
@@ -127,8 +129,6 @@ func ApplyByHeader(canary, route *networking.HTTPRoute, canaryIngress *Ingress)
|
|||||||
|
|
||||||
// Inherit configuration from non-canary rule
|
// Inherit configuration from non-canary rule
|
||||||
route.DeepCopyInto(canary)
|
route.DeepCopyInto(canary)
|
||||||
// Assign temp copied canary route match
|
|
||||||
canary.Match = temp.Match
|
|
||||||
// Assign temp copied canary route destination
|
// Assign temp copied canary route destination
|
||||||
canary.Route = temp.Route
|
canary.Route = temp.Route
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ func ApplyByHeader(canary, route *networking.HTTPRoute, canaryIngress *Ingress)
|
|||||||
match.Headers = map[string]*networking.StringMatch{
|
match.Headers = map[string]*networking.StringMatch{
|
||||||
canaryConfig.Header: {
|
canaryConfig.Header: {
|
||||||
MatchType: &networking.StringMatch_Regex{
|
MatchType: &networking.StringMatch_Regex{
|
||||||
Regex: canaryConfig.HeaderPattern,
|
Regex: ".*" + canaryConfig.HeaderPattern + ".*",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ func ApplyByHeader(canary, route *networking.HTTPRoute, canaryIngress *Ingress)
|
|||||||
match.Headers = map[string]*networking.StringMatch{
|
match.Headers = map[string]*networking.StringMatch{
|
||||||
"cookie": {
|
"cookie": {
|
||||||
MatchType: &networking.StringMatch_Regex{
|
MatchType: &networking.StringMatch_Regex{
|
||||||
Regex: "^(.\\*?;)?(" + canaryConfig.Cookie + "=always)(;.\\*)?$",
|
Regex: "^(.*?;\\s*)?(" + canaryConfig.Cookie + "=always)(;.*)?$",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
package annotations
|
package annotations
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
networking "istio.io/api/networking/v1alpha3"
|
networking "istio.io/api/networking/v1alpha3"
|
||||||
@@ -37,6 +38,8 @@ const (
|
|||||||
var (
|
var (
|
||||||
_ Parser = headerControl{}
|
_ Parser = headerControl{}
|
||||||
_ RouteHandler = headerControl{}
|
_ RouteHandler = headerControl{}
|
||||||
|
|
||||||
|
pattern = regexp.MustCompile(`\s+`)
|
||||||
)
|
)
|
||||||
|
|
||||||
type HeaderOperation struct {
|
type HeaderOperation struct {
|
||||||
@@ -138,6 +141,18 @@ func needHeaderControlConfig(annotations Annotations) bool {
|
|||||||
annotations.HasHigress(responseHeaderRemove)
|
annotations.HasHigress(responseHeaderRemove)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func trimQuotes(s string) string {
|
||||||
|
if len(s) >= 2 {
|
||||||
|
if s[0] == '"' && s[len(s)-1] == '"' {
|
||||||
|
return s[1 : len(s)-1]
|
||||||
|
}
|
||||||
|
if s[0] == '\'' && s[len(s)-1] == '\'' {
|
||||||
|
return s[1 : len(s)-1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
|
||||||
func convertAddOrUpdate(headers string) map[string]string {
|
func convertAddOrUpdate(headers string) map[string]string {
|
||||||
result := map[string]string{}
|
result := map[string]string{}
|
||||||
parts := strings.Split(headers, "\n")
|
parts := strings.Split(headers, "\n")
|
||||||
@@ -147,13 +162,13 @@ func convertAddOrUpdate(headers string) map[string]string {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
keyValue := strings.Fields(part)
|
keyValue := pattern.Split(part, 2)
|
||||||
if len(keyValue) != 2 {
|
if len(keyValue) != 2 {
|
||||||
IngressLog.Errorf("Header format %s is invalid.", keyValue)
|
IngressLog.Errorf("Header format %s is invalid.", keyValue)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
key := strings.TrimSpace(keyValue[0])
|
key := trimQuotes(strings.TrimSpace(keyValue[0]))
|
||||||
value := strings.TrimSpace(keyValue[1])
|
value := trimQuotes(strings.TrimSpace(keyValue[1]))
|
||||||
result[key] = value
|
result[key] = value
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ func TestHeaderControlParse(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: map[string]string{
|
input: map[string]string{
|
||||||
buildHigressAnnotationKey(requestHeaderAdd): "one 1\n two 2\nthree 3 \n",
|
buildHigressAnnotationKey(requestHeaderAdd): "one 1\n two 2\nthree 3 \nx-test mse; test=true\nx-pro mse; pro=true\n",
|
||||||
buildHigressAnnotationKey(requestHeaderUpdate): "two 2",
|
buildHigressAnnotationKey(requestHeaderUpdate): "two 2\n set-cookie name=test; sameage=111\nset-stage name=stage; stage=true\n",
|
||||||
buildHigressAnnotationKey(requestHeaderRemove): "one, two,three\n",
|
buildHigressAnnotationKey(requestHeaderRemove): "one, two,three\n",
|
||||||
buildHigressAnnotationKey(responseHeaderAdd): "A a\nB b\n",
|
buildHigressAnnotationKey(responseHeaderAdd): "A a\nB b\n",
|
||||||
buildHigressAnnotationKey(responseHeaderUpdate): "X x\nY y\n",
|
buildHigressAnnotationKey(responseHeaderUpdate): "X x\nY y\n",
|
||||||
@@ -58,12 +58,16 @@ func TestHeaderControlParse(t *testing.T) {
|
|||||||
expect: &HeaderControlConfig{
|
expect: &HeaderControlConfig{
|
||||||
Request: &HeaderOperation{
|
Request: &HeaderOperation{
|
||||||
Add: map[string]string{
|
Add: map[string]string{
|
||||||
"one": "1",
|
"one": "1",
|
||||||
"two": "2",
|
"two": "2",
|
||||||
"three": "3",
|
"three": "3",
|
||||||
|
"x-test": "mse; test=true",
|
||||||
|
"x-pro": "mse; pro=true",
|
||||||
},
|
},
|
||||||
Update: map[string]string{
|
Update: map[string]string{
|
||||||
"two": "2",
|
"two": "2",
|
||||||
|
"set-cookie": "name=test; sameage=111",
|
||||||
|
"set-stage": "name=stage; stage=true",
|
||||||
},
|
},
|
||||||
Remove: []string{"one", "two", "three"},
|
Remove: []string{"one", "two", "three"},
|
||||||
},
|
},
|
||||||
@@ -122,12 +126,16 @@ func TestHeaderControlApplyRoute(t *testing.T) {
|
|||||||
HeaderControl: &HeaderControlConfig{
|
HeaderControl: &HeaderControlConfig{
|
||||||
Request: &HeaderOperation{
|
Request: &HeaderOperation{
|
||||||
Add: map[string]string{
|
Add: map[string]string{
|
||||||
"one": "1",
|
"one": "1",
|
||||||
"two": "2",
|
"two": "2",
|
||||||
"three": "3",
|
"three": "3",
|
||||||
|
"x-test": "mse; test=true",
|
||||||
|
"x-pro": "mse; pro=true",
|
||||||
},
|
},
|
||||||
Update: map[string]string{
|
Update: map[string]string{
|
||||||
"two": "2",
|
"two": "2",
|
||||||
|
"set-cookie": "name=test; sameage=111",
|
||||||
|
"set-stage": "name=stage; sameage=111",
|
||||||
},
|
},
|
||||||
Remove: []string{"one", "two", "three"},
|
Remove: []string{"one", "two", "three"},
|
||||||
},
|
},
|
||||||
@@ -138,12 +146,16 @@ func TestHeaderControlApplyRoute(t *testing.T) {
|
|||||||
Headers: &networking.Headers{
|
Headers: &networking.Headers{
|
||||||
Request: &networking.Headers_HeaderOperations{
|
Request: &networking.Headers_HeaderOperations{
|
||||||
Add: map[string]string{
|
Add: map[string]string{
|
||||||
"one": "1",
|
"one": "1",
|
||||||
"two": "2",
|
"two": "2",
|
||||||
"three": "3",
|
"three": "3",
|
||||||
|
"x-test": "mse; test=true",
|
||||||
|
"x-pro": "mse; pro=true",
|
||||||
},
|
},
|
||||||
Set: map[string]string{
|
Set: map[string]string{
|
||||||
"two": "2",
|
"two": "2",
|
||||||
|
"set-cookie": "name=test; sameage=111",
|
||||||
|
"set-stage": "name=stage; sameage=111",
|
||||||
},
|
},
|
||||||
Remove: []string{"one", "two", "three"},
|
Remove: []string{"one", "two", "three"},
|
||||||
},
|
},
|
||||||
|
|||||||
110
pkg/ingress/kube/annotations/local_rate_limit.go
Normal file
110
pkg/ingress/kube/annotations/local_rate_limit.go
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
package annotations
|
||||||
|
|
||||||
|
import (
|
||||||
|
types "github.com/gogo/protobuf/types"
|
||||||
|
|
||||||
|
networking "istio.io/api/networking/v1alpha3"
|
||||||
|
"istio.io/istio/pilot/pkg/networking/core/v1alpha3/mseingress"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
limitRPM = "route-limit-rpm"
|
||||||
|
limitRPS = "route-limit-rps"
|
||||||
|
limitBurstMultiplier = "route-limit-burst-multiplier"
|
||||||
|
|
||||||
|
defaultBurstMultiplier = 5
|
||||||
|
defaultStatusCode = 429
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_ Parser = localRateLimit{}
|
||||||
|
_ RouteHandler = localRateLimit{}
|
||||||
|
|
||||||
|
second = &types.Duration{
|
||||||
|
Seconds: 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
minute = &types.Duration{
|
||||||
|
Seconds: 60,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
type localRateLimitConfig struct {
|
||||||
|
TokensPerFill uint32
|
||||||
|
MaxTokens uint32
|
||||||
|
FillInterval *types.Duration
|
||||||
|
}
|
||||||
|
|
||||||
|
type localRateLimit struct{}
|
||||||
|
|
||||||
|
func (l localRateLimit) Parse(annotations Annotations, config *Ingress, _ *GlobalContext) error {
|
||||||
|
if !needLocalRateLimitConfig(annotations) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var local *localRateLimitConfig
|
||||||
|
defer func() {
|
||||||
|
config.localRateLimit = local
|
||||||
|
}()
|
||||||
|
|
||||||
|
multiplier := defaultBurstMultiplier
|
||||||
|
if m, err := annotations.ParseIntForHigress(limitBurstMultiplier); err == nil {
|
||||||
|
multiplier = m
|
||||||
|
}
|
||||||
|
|
||||||
|
if rpm, err := annotations.ParseIntForHigress(limitRPM); err == nil {
|
||||||
|
local = &localRateLimitConfig{
|
||||||
|
MaxTokens: uint32(rpm * multiplier),
|
||||||
|
TokensPerFill: uint32(rpm),
|
||||||
|
FillInterval: minute,
|
||||||
|
}
|
||||||
|
} else if rps, err := annotations.ParseIntForHigress(limitRPS); err == nil {
|
||||||
|
local = &localRateLimitConfig{
|
||||||
|
MaxTokens: uint32(rps * multiplier),
|
||||||
|
TokensPerFill: uint32(rps),
|
||||||
|
FillInterval: second,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l localRateLimit) ApplyRoute(route *networking.HTTPRoute, config *Ingress) {
|
||||||
|
localRateLimitConfig := config.localRateLimit
|
||||||
|
if localRateLimitConfig == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
route.RouteHTTPFilters = append(route.RouteHTTPFilters, &networking.HTTPFilter{
|
||||||
|
Name: mseingress.LocalRateLimit,
|
||||||
|
Filter: &networking.HTTPFilter_LocalRateLimit{
|
||||||
|
LocalRateLimit: &networking.LocalRateLimit{
|
||||||
|
TokenBucket: &networking.TokenBucket{
|
||||||
|
MaxTokens: localRateLimitConfig.MaxTokens,
|
||||||
|
TokensPefFill: localRateLimitConfig.TokensPerFill,
|
||||||
|
FillInterval: localRateLimitConfig.FillInterval,
|
||||||
|
},
|
||||||
|
StatusCode: defaultStatusCode,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func needLocalRateLimitConfig(annotations Annotations) bool {
|
||||||
|
return annotations.HasHigress(limitRPM) ||
|
||||||
|
annotations.HasHigress(limitRPS)
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user