diff --git a/.licenserc.yaml b/.licenserc.yaml index 070b515a86..2c8a7edc44 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -21,6 +21,7 @@ header: paths-ignore: - 'dist' + - 'vendor' - 'licenses' - '**/*.md' - '**/testdata/**' diff --git a/CHANGELOG.md b/CHANGELOG.md index 939b04e685..85107552ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,7 +56,7 @@ In next release(v1.5), custom resource's API version v2 will be GA released. Ple * We can update the load balancing IP of the Ingress, and it can work in various public cloud environments [#740](https://github.com/apache/apisix-ingress-controller/pull/740) Please try out the release binaries and report any issues at -https://github.com/apache/apisix-ingress-controller/issues. + ### Contributors @@ -81,6 +81,7 @@ https://github.com/apache/apisix-ingress-controller/issues. * zhang lun hai ### Changes +
40 commits

@@ -124,6 +125,7 @@ https://github.com/apache/apisix-ingress-controller/issues. * [`97fdc90`](https://github.com/apache/apisix-ingress-controller/commit/97fdc90e313a71436f016f5c2e6a849495399ff9) fix: ignore delete pod cache error msg (#714) * [`fa27b03`](https://github.com/apache/apisix-ingress-controller/commit/fa27b0318468c0ffab40b8c384a8a6abc056748c) chore: fix spelling error in modules.png (#717) * [`68125e3`](https://github.com/apache/apisix-ingress-controller/commit/68125e3557428dd0e9424a273c977c85fcffc374) chore: v1.3 release (#716) +

@@ -173,7 +175,7 @@ In next release(v1.4), all custom resource versions will be upgraded to version * Add new metrics `apisix_ingress_controller_check_cluster_health` and `apisix_ingress_controller_sync_success_total` [#627](https://github.com/apache/apisix-ingress-controller/pull/627) Please try out the release binaries and report any issues at -https://github.com/apache/apisix-ingress-controller/issues. + ### Contributors @@ -189,6 +191,7 @@ https://github.com/apache/apisix-ingress-controller/issues. * oliver ### Changes +
27 commits

@@ -219,6 +222,7 @@ https://github.com/apache/apisix-ingress-controller/issues. * [`d537ddc`](https://github.com/apache/apisix-ingress-controller/commit/d537ddc62bfabfe383c0bd402833377003a1d8dc) feat: add link check (#635) * [`d7128a1`](https://github.com/apache/apisix-ingress-controller/commit/d7128a1812053e9341f59f0e9c13c1c513c9db42) chore: skip CodeQL if go files have no changes (#636) * [`d8854c3`](https://github.com/apache/apisix-ingress-controller/commit/d8854c3bf7fefbc54c0d5b00b5ad669044f791f2) docs: fix config.json (#628) +

@@ -247,7 +251,7 @@ This is a **GA** release. * **Implement schema API** [#601](https://github.com/apache/apisix-ingress-controller/pull/601) Please try out the release binaries and report any issues at -https://github.com/apache/apisix-ingress-controller/issues. + ### Contributors @@ -261,6 +265,7 @@ https://github.com/apache/apisix-ingress-controller/issues. * 天使莫忆 ### Changes +
20 commits

@@ -284,6 +289,7 @@ https://github.com/apache/apisix-ingress-controller/issues. * [`c78c823`](https://github.com/apache/apisix-ingress-controller/commit/c78c8237b9c114e0e5564bd74a6729bdee04259c) chore: merge from v1.1 (#583) * [`e649c50`](https://github.com/apache/apisix-ingress-controller/commit/e649c503ca6ba4103a27fef729f8835b90078a93) chore: add udp usage & upgrade the verion of ApisixRoute (#585) * [`57ec6da`](https://github.com/apache/apisix-ingress-controller/commit/57ec6dafa7b96b8c2fe5c386eedfce74cb581441) fix: misspell in FAQ (#577) +

@@ -302,6 +308,7 @@ Previous release can be found at [1.1.0](https://github.com/apache/apisix-ingres Welcome to the 1.1.0 release of apisix-ingress-controller! This is a **GA** release. + - an available Kubernetes cluster (version >= 1.15) - an available Apache APISIX (version >= 2.7) @@ -313,7 +320,7 @@ This is a **GA** release. * **Support UDP definition** [#572](https://github.com/apache/apisix-ingress-controller/pull/572) [#576](https://github.com/apache/apisix-ingress-controller/pull/576) Please try out the release binaries and report any issues at -https://github.com/apache/apisix-ingress-controller/issues. + ### Contributors @@ -325,6 +332,7 @@ https://github.com/apache/apisix-ingress-controller/issues. * benson211 ### Changes +
11 commits

@@ -339,6 +347,7 @@ https://github.com/apache/apisix-ingress-controller/issues. * [`2122d76`](https://github.com/apache/apisix-ingress-controller/commit/2122d76fd28cc7bce54e8f52e2d4c9d04a1e852a) docs: clarify installation by Kustomize (#558) * [`b4a6889`](https://github.com/apache/apisix-ingress-controller/commit/b4a6889e1564be61de6736af32a2075579c9b51f) Update default version in Makefile (#556) * [`f5cc76e`](https://github.com/apache/apisix-ingress-controller/commit/f5cc76ec6ac671772063d38a09f508db71ac2e48) chore: remove cancel-workflow.yml since no use (#550) +

@@ -358,6 +367,7 @@ Previous release can be found at [1.0.0](https://github.com/apache/apisix-ingres Welcome to the 1.0.0 release of apisix-ingress-controller! This is the first **GA** release. + - an available Kubernetes cluster (version >= 1.14) - an available Apache APISIX (version >= 2.7) @@ -374,7 +384,7 @@ This is the first **GA** release. * **Support authentication for ApisixRoute** [#528](https://github.com/apache/apisix-ingress-controller/pull/528) Please try out the release binaries and report any issues at -https://github.com/apache/apisix-ingress-controller/issues. + ### Contributors @@ -393,6 +403,7 @@ https://github.com/apache/apisix-ingress-controller/issues. * 罗泽轩 ### Changes +
58 commits

@@ -454,6 +465,7 @@ https://github.com/apache/apisix-ingress-controller/issues. * [`f199cdb`](https://github.com/apache/apisix-ingress-controller/commit/f199cdb5f5bfe3cb5acb19dc1903b1f5f426a353) test: add e2e test cases for server-info plugin (#406) * [`b0a6f3e`](https://github.com/apache/apisix-ingress-controller/commit/b0a6f3edba8a80e10e831ceaf408e43f89632adb) fix: typo in apisix_route_v2alpha1.md (#438) * [`d269a01`](https://github.com/apache/apisix-ingress-controller/commit/d269a01fe69c287cf13a3574d8ce6566c18a306c) ci: introduce skywalking-eyes (#430) +

diff --git a/Makefile b/Makefile index 749477fae5..91a5541314 100644 --- a/Makefile +++ b/Makefile @@ -58,11 +58,6 @@ build-image: lint: golangci-lint run -### gofmt: Format all go codes -.PHONY: gofmt -gofmt: - find . -type f -name "*.go" | xargs gofmt -w -s - ### unit-test: Run unit test cases .PHONY: unit-test unit-test: @@ -193,8 +188,13 @@ update-license: ### update-mdlint: Update markdown files lint rules. .PHONY: update-mdlint update-mdlint: - docker run -it --rm -v $(PWD):/work tmknom/markdownlint '**/*.md' -f --ignore node_modules + docker run -it --rm -v $(PWD):/work tmknom/markdownlint '**/*.md' -f --ignore node_modules --ignore vendor + +### gofmt: Format all go codes +.PHONY: update-gofmt +update-gofmt: + ./utils/goimports-reviser.sh ### update-all: Update all update- rules. .PHONY: update-all -update-all: update-codegen update-license update-mdlint +update-all: update-codegen update-license update-mdlint update-gofmt diff --git a/pkg/apisix/resource_test.go b/pkg/apisix/resource_test.go index c640b971ae..2c9699605c 100644 --- a/pkg/apisix/resource_test.go +++ b/pkg/apisix/resource_test.go @@ -18,9 +18,9 @@ import ( "encoding/json" "testing" - v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1" - "github.com/stretchr/testify/assert" + + v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1" ) func TestItemUnmarshalJSON(t *testing.T) { diff --git a/pkg/apisix/route_test.go b/pkg/apisix/route_test.go index dfce794059..67793b3232 100644 --- a/pkg/apisix/route_test.go +++ b/pkg/apisix/route_test.go @@ -26,9 +26,8 @@ import ( "strings" "testing" - "golang.org/x/net/nettest" - "github.com/stretchr/testify/assert" + "golang.org/x/net/nettest" "github.com/apache/apisix-ingress-controller/pkg/metrics" v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1" diff --git a/pkg/apisix/ssl_test.go b/pkg/apisix/ssl_test.go index 8c2468b44d..ca62282fa1 100644 --- a/pkg/apisix/ssl_test.go +++ b/pkg/apisix/ssl_test.go @@ -27,11 +27,11 @@ import ( "strings" "testing" - "github.com/apache/apisix-ingress-controller/pkg/metrics" - v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1" - "github.com/stretchr/testify/assert" "golang.org/x/net/nettest" + + "github.com/apache/apisix-ingress-controller/pkg/metrics" + v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1" ) type fakeAPISIXSSLSrv struct { diff --git a/pkg/apisix/stream_route_test.go b/pkg/apisix/stream_route_test.go index 83326fc63a..dfa669d43e 100644 --- a/pkg/apisix/stream_route_test.go +++ b/pkg/apisix/stream_route_test.go @@ -26,11 +26,11 @@ import ( "strings" "testing" - "github.com/apache/apisix-ingress-controller/pkg/metrics" - v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1" - "github.com/stretchr/testify/assert" "golang.org/x/net/nettest" + + "github.com/apache/apisix-ingress-controller/pkg/metrics" + v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1" ) type fakeAPISIXStreamRouteSrv struct { diff --git a/pkg/apisix/upstream_test.go b/pkg/apisix/upstream_test.go index da3a3fc5f1..730f35fe26 100644 --- a/pkg/apisix/upstream_test.go +++ b/pkg/apisix/upstream_test.go @@ -26,12 +26,11 @@ import ( "strings" "testing" - "github.com/apache/apisix-ingress-controller/pkg/metrics" - v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1" - "github.com/stretchr/testify/assert" - "golang.org/x/net/nettest" + + "github.com/apache/apisix-ingress-controller/pkg/metrics" + v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1" ) type fakeAPISIXUpstreamSrv struct { diff --git a/pkg/types/pod_test.go b/pkg/types/pod_test.go index e9021a5145..d32b496368 100644 --- a/pkg/types/pod_test.go +++ b/pkg/types/pod_test.go @@ -18,7 +18,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/test/e2e/scaffold/httpbin.go b/test/e2e/scaffold/httpbin.go index eb15bb1289..b508e94b28 100644 --- a/test/e2e/scaffold/httpbin.go +++ b/test/e2e/scaffold/httpbin.go @@ -18,11 +18,10 @@ import ( "fmt" "time" - "github.com/onsi/ginkgo" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/gruntwork-io/terratest/modules/k8s" + "github.com/onsi/ginkgo" corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) var ( diff --git a/test/e2e/scaffold/k8s.go b/test/e2e/scaffold/k8s.go index d6fde3da20..09357cce73 100644 --- a/test/e2e/scaffold/k8s.go +++ b/test/e2e/scaffold/k8s.go @@ -18,7 +18,6 @@ import ( "context" "encoding/json" "fmt" - "github.com/apache/apisix-ingress-controller/pkg/metrics" "io/ioutil" "net/http" "net/url" @@ -27,6 +26,7 @@ import ( "time" "github.com/apache/apisix-ingress-controller/pkg/apisix" + "github.com/apache/apisix-ingress-controller/pkg/metrics" v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1" "github.com/gruntwork-io/terratest/modules/k8s" "github.com/gruntwork-io/terratest/modules/retry" diff --git a/utils/goimports-reviser.sh b/utils/goimports-reviser.sh new file mode 100755 index 0000000000..6221f93169 --- /dev/null +++ b/utils/goimports-reviser.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + +set -e + +go install github.com/incu6us/goimports-reviser/v2@latest + +PROJECT_NAME=github.com/apache/apisix-ingress-controller +while IFS= read -r -d '' file; do + goimports-reviser -file-path "$file" -project-name $PROJECT_NAME +done < <(find . -name '*.go' -not -path "./test/*" -not -path "./pkg/kube/apisix/*" -print0) + + +PROJECT_NAME=github.com/apache/apisix-ingress-controller/test/e2e +while IFS= read -r -d '' file; do + goimports-reviser -file-path "$file" -project-name $PROJECT_NAME +done < <(find . -name '*.go' -path "./test/*" -print0)