Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
localvar committed Apr 20, 2022
2 parents d88df64 + b92261f commit 02972f1
Show file tree
Hide file tree
Showing 41 changed files with 808 additions and 204 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code.analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
go-version: ${{ env.GO_VERSION }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Revive Action
uses: morphy2k/revive-action@v2.2.0
uses: morphy2k/revive-action@v2.3.0

- name: Check formatting
run: test -z $(gofmt -l .) || (gofmt -l . && exit 1)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/license-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check License Header
uses: apache/skywalking-eyes@main
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
go-version: ${{ env.GO_VERSION }}

- name: Checkout codebase
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Test
shell: bash
Expand All @@ -42,7 +42,7 @@ jobs:
go-version: ${{ env.GO_VERSION }}

- name: Checkout codebase
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Test
run: |
Expand All @@ -61,7 +61,7 @@ jobs:
go-version: ${{ env.GO_VERSION }}

- name: Checkout codebase
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Test
run: |
Expand All @@ -70,7 +70,7 @@ jobs:
runs-on: ubuntu-latest
needs: integration-test-ubuntu
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
go-version: ${{ env.GO_VERSION }}

- name: Checkout codebase
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Test
shell: bash
Expand All @@ -60,7 +60,7 @@ jobs:
go-version: ${{ env.GO_VERSION }}

- name: Checkout codebase
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Test
run: |
Expand All @@ -79,7 +79,7 @@ jobs:
go-version: ${{ env.GO_VERSION }}

- name: Checkout codebase
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Test
run: |
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## [v1.5.1](https://github.com/megaease/easegress/tree/v1.5.1) (2022-04-06)

[Full Changelog](https://github.com/megaease/easegress/compare/v1.5.0...v1.5.1)

**Significant changes:**

- Turn profiling on/off runtime [\#543](https://github.com/megaease/easegress/pull/543)

**Implemented enhancements:**

- Change the way StatusSyncController stores statuses to reduce memory usage [\#542](https://github.com/megaease/easegress/pull/542)
- Support custom image name [\#545](https://github.com/megaease/easegress/pull/545)
- HTTPServer prefix and fullpath support rewrite_target [\#553](https://github.com/megaease/easegress/pull/553)
- Refactor the Docker entrypoint.sh [\#569](https://github.com/megaease/easegress/pull/569)

**Fixed bugs:**

- Fix proxy fallback [\#537](https://github.com/megaease/easegress/pull/537)
- Resolve inconsistent path selection [\#536](https://github.com/megaease/easegress/pull/536)
- Validate CircuitBreaker filter [\#551](https://github.com/megaease/easegress/pull/551)



## [v1.5.0](https://github.com/megaease/easegress/tree/v1.5.0) (2022-03-03)

[Full Changelog](https://github.com/megaease/easegress/compare/v1.4.1...v1.5.0)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ HTTPSERVER_TEST_PATH := build/test
IMAGE_NAME?=megaease/easegress

# Version
RELEASE?=v1.5.0
RELEASE?=v1.5.1

# Git Related
GIT_REPO_INFO=$(shell cd ${MKFILE_DIR} && git config --get remote.origin.url)
Expand Down
6 changes: 3 additions & 3 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
- **高性能:** 基础功能采用轻量级方法实现,性能优异。
- **可观察性:** 周期性报告多种统计数据,系统状态尽在掌握。
- **可扩展性:** 良好的 API 设计,不必知道底层细节,也能自己开发过滤器和控制器。
- **集成性:** 接口简单,易于与其他系统集成,如 Kubernetes 入口控制器[EaseMesh](https://github.com/megaease/easemesh) 边车、工作流等。
- **集成性:** 接口简单,易于与其他系统集成,如: Kubernetes Ingress Controller[EaseMesh](https://github.com/megaease/easemesh) 边车、工作流等。

下面是其架构图:

Expand Down Expand Up @@ -147,7 +147,7 @@ make
> **注意事项**
>
> - 我们需要 Go 1.17 以上版本的编译器
> - 如果需要支持 WebAssembbly 的版本,你需要运行 `make wasm`
> - 如果需要支持 WebAssembly 的版本,你需要运行 `make wasm`
然后把二进制所在目录添加到 `PATH` 中,并启动服务:

Expand Down Expand Up @@ -188,7 +188,7 @@ $ egctl member list | grep "id"
id: 689e371e88f78b6a
```

成功启动后,我们可以用上述命令检查单节点集群的状态,它展示示了系统的静态选项,以及心跳和etcd的动态状态
成功启动后,我们可以用上述命令检查单节点集群的状态,它展示示了系统的静态选项,以及心跳和 etcd 的动态状态

### 创建 HTTPServer 和 Pipeline

Expand Down
2 changes: 0 additions & 2 deletions build/package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ RUN apk --no-cache add tini tzdata && \
ENV PATH /opt/easegress/bin:$PATH

ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]

CMD ["easegress-server"]
2 changes: 0 additions & 2 deletions build/package/Dockerfile.goreleaser
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ RUN apk --no-cache add tini tzdata && \
ENV PATH /opt/easegress/bin:$PATH

ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]

CMD ["easegress-server"]
20 changes: 15 additions & 5 deletions build/package/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#!/bin/sh

if [ "$(echo $1 | head -c 1)" != "-" ] ; then
exec "$@"
else
exec /opt/easegress/bin/easegress-server "$@"
fi
# Support the following running mode
# 1) run easegress without any arguments
# 2) run easegress with easegress argumetns
# 3) run the command in easegress container

# docker run megaease/easegress
if [ "$#" -eq 0 ]; then
exec /opt/easegress/bin/easegress-server
# docker run megaease/easegress -f config.yaml
elif [ "$1" != "--" ] && [ "$(echo $1 | head -c 1)" == "-" ] ; then
exec /opt/easegress/bin/easegress-server "$@"
# docker run -it --rm megaease/easegress /bin/sh
# docker run -it --rm megaease/easegress /bin/echo hello world
else
exec "$@"
fi
1 change: 0 additions & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ It could be created, updated, deleted by admin operation. They control various r

- [API Aggregator](./reference/filters.md#APIAggregator) - The API Aggregator forwards one request to multiple API HTTP Pipelines in the same namespace and aggregates responses.
- [Proxy](./reference/filters.md#Proxy) - The Proxy filter is a proxy of backend service.
- [Bridge](./reference/filters.md#Bridge) - The Bridge filter route requests from one pipeline to other pipelines or HTTP proxies under an HTTP server.
- [CORSAdaptor](./reference/filters.md#CORSAdaptor) - The CORSAdaptor handles the CORS preflight request for backend service.
- [Fallback](./reference/filters.md#Fallback) - The Fallback filter mocks a response as fallback action of other filters.
- [Mock](./reference/filters.md#Mock) - The Mock filter mocks responses according to configured rules, mainly for testing purposes.
Expand Down
2 changes: 1 addition & 1 deletion doc/reference/controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ domains:
| path | string | Exact path to match | No |
| pathPrefix | string | Prefix of the path to match | No |
| pathRegexp | string | Path in regular expression to match | No |
| rewriteTarget | string | Use pathRegexp.[ReplaceAllString](https://golang.org/pkg/regexp/#Regexp.ReplaceAllString)(path, rewriteTarget) to rewrite request path | No |
| rewriteTarget | string | Use pathRegexp.[ReplaceAllString](https://golang.org/pkg/regexp/#Regexp.ReplaceAllString)(path, rewriteTarget) or pathPrefix [strings.Replace](https://pkg.go.dev/strings#Replace) to rewrite request path | No |
| methods | []string | Methods to match, empty means to allow all methods | No |
| headers | [][httpserver.Header](#httpserverHeader) | Headers to match (the requests matching headers won't be put into cache) | No |
| backend | string | backend name (pipeline name in static config, service name in mesh) | Yes |
Expand Down
60 changes: 15 additions & 45 deletions doc/reference/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,50 @@
- [Proxy](#proxy)
- [Configuration](#configuration-1)
- [Results](#results-1)
- [Bridge](#bridge)
- [CORSAdaptor](#corsadaptor)
- [Configuration](#configuration-2)
- [Results](#results-2)
- [CORSAdaptor](#corsadaptor)
- [Fallback](#fallback)
- [Configuration](#configuration-3)
- [Results](#results-3)
- [Fallback](#fallback)
- [Mock](#mock)
- [Configuration](#configuration-4)
- [Results](#results-4)
- [Mock](#mock)
- [RemoteFilter](#remotefilter)
- [Configuration](#configuration-5)
- [Results](#results-5)
- [RemoteFilter](#remotefilter)
- [RequestAdaptor](#requestadaptor)
- [Configuration](#configuration-6)
- [Results](#results-6)
- [RequestAdaptor](#requestadaptor)
- [CircuitBreaker](#circuitbreaker)
- [Configuration](#configuration-7)
- [Results](#results-7)
- [CircuitBreaker](#circuitbreaker)
- [RateLimiter](#ratelimiter)
- [Configuration](#configuration-8)
- [Results](#results-8)
- [RateLimiter](#ratelimiter)
- [TimeLimiter](#timelimiter)
- [Configuration](#configuration-9)
- [Results](#results-9)
- [TimeLimiter](#timelimiter)
- [Retryer](#retryer)
- [Configuration](#configuration-10)
- [Results](#results-10)
- [Retryer](#retryer)
- [ResponseAdaptor](#responseadaptor)
- [Configuration](#configuration-11)
- [Results](#results-11)
- [ResponseAdaptor](#responseadaptor)
- [Validator](#validator)
- [Configuration](#configuration-12)
- [Results](#results-12)
- [Validator](#validator)
- [WasmHost](#wasmhost)
- [Configuration](#configuration-13)
- [Results](#results-13)
- [WasmHost](#wasmhost)
- [Kafka](#kafka)
- [Configuration](#configuration-14)
- [Results](#results-14)
- [Kafka](#kafka)
- [HeaderToJSON](#headertojson)
- [Configuration](#configuration-15)
- [Results](#results-15)
- [HeaderToJSON](#headertojson)
- [Configuration](#configuration-16)
- [Results](#results-16)
- [CertExtractor](#certextractor)
- [Configuration](#configuration-17)
- [Configuration](#configuration-16))
- [Common Types](#common-types)
- [apiaggregator.Pipeline](#apiaggregatorpipeline)
- [pathadaptor.Spec](#pathadaptorspec)
Expand Down Expand Up @@ -203,33 +200,6 @@ mainPool:
| clientError | Client-side(Easegress) network error |
| serverError | Server-side network error |

## Bridge

The Bridge filter route requests from one pipeline to other pipelines or HTTP proxies under an HTTP server.

The upstream filter set the target pipeline/proxy in request header `X-Easegress-Bridge-Dest`. Bridge extracts the header value and tries to match it in the configuration. It sends the request if a destination matched and aborts the process if no match. It selects the first destination from the filter configuration if there's no header named `X-Easegress-Bridge-Dest`.

Below is an example configuration with two destinations.

```yaml
kind: Bridge
name: bridge-example
destinations: ["pipeline1", "pipeline2"]
```

### Configuration

| Name | Type | Description | Required |
| ------------ | -------- | -------------------------------- | -------- |
| destinations | []string | Destination pipeline/proxy names | Yes |

### Results

| Value | Description |
| ----------------------- | ------------------------------------ |
| destinationNotFound | The desired destination is not found |
| invokeDestinationFailed | Failed to invoke the destination |

## CORSAdaptor

The CORSAdaptor handles the [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) preflight request for backend service.
Expand Down
1 change: 1 addition & 0 deletions example/config/cluster/legacy-cluster-1.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Deprecated: use ./cluster-1.yaml instead.
name: primary-1
cluster-name: cluster-test
cluster-role: primary
Expand Down
1 change: 1 addition & 0 deletions example/config/cluster/legacy-cluster-2.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Deprecated: use ./cluster-2.yaml instead.
name: primary-2
cluster-name: cluster-test
cluster-role: primary
Expand Down
1 change: 1 addition & 0 deletions example/config/cluster/legacy-cluster-3.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Deprecated: use ./cluster-3.yaml instead.
name: primary-3
cluster-name: cluster-test
cluster-role: primary
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ require (
github.com/ghodss/yaml v1.0.0
github.com/go-chi/chi/v5 v5.0.7
github.com/go-zookeeper/zk v1.0.2
github.com/goccy/go-json v0.9.4
github.com/goccy/go-json v0.9.6
github.com/golang-jwt/jwt v3.2.1+incompatible
github.com/google/uuid v1.3.0
github.com/gorilla/websocket v1.5.0
github.com/hashicorp/consul/api v1.12.0
github.com/hashicorp/golang-lru v0.5.4
github.com/json-iterator/go v1.1.12
github.com/klauspost/compress v1.14.4
github.com/klauspost/compress v1.15.1
github.com/libdns/alidns v1.0.2-x2
github.com/libdns/azure v0.2.0
github.com/libdns/cloudflare v0.1.0
Expand All @@ -43,7 +43,7 @@ require (
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
github.com/rs/cors v1.8.2
github.com/spf13/cobra v1.3.0
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.10.1
github.com/stretchr/testify v1.7.0
Expand All @@ -63,6 +63,7 @@ require (
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
k8s.io/api v0.22.5
k8s.io/apimachinery v0.22.5
k8s.io/client-go v0.22.5
Expand Down Expand Up @@ -242,7 +243,6 @@ require (
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gotest.tools/v3 v3.0.3 // indirect
k8s.io/apiextensions-apiserver v0.22.5 // indirect
k8s.io/cli-runtime v0.22.5 // indirect
Expand Down
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78
github.com/go-zookeeper/zk v1.0.2 h1:4mx0EYENAdX/B/rbunjlt5+4RTA/a9SMHBRuSKdGxPM=
github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=
github.com/gobuffalo/flect v0.2.4/go.mod h1:1ZyCLIbg0YD7sDkzvFdPoOydPtD8y9JQnrOROolUcM8=
github.com/goccy/go-json v0.9.4 h1:L8MLKG2mvVXiQu07qB6hmfqeSYQdOnqPot2GhsIwIaI=
github.com/goccy/go-json v0.9.4/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/goccy/go-json v0.9.6 h1:5/4CtRQdtsX0sal8fdVhTaiMN01Ri8BExZZ8iRmHQ6E=
github.com/goccy/go-json v0.9.6/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
Expand Down Expand Up @@ -877,8 +877,9 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4=
github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.15.1 h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A=
github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Expand Down Expand Up @@ -1266,8 +1267,9 @@ github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
github.com/spf13/cobra v1.3.0 h1:R7cSvGu+Vv+qX0gW5R/85dx2kmmJT5z5NM8ifdYjdn0=
github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4=
github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=
github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
Expand Down
Loading

0 comments on commit 02972f1

Please sign in to comment.