From de688461898f81e3cfdbaf3f04f303205c94c52b Mon Sep 17 00:00:00 2001 From: kwanhur Date: Thu, 28 Oct 2021 21:39:45 +0800 Subject: [PATCH 1/7] Fix license header Signed-off-by: kwanhur --- .github/workflows/ci.yml | 14 ++++++++++++++ .gitignore | 14 ++++++++++++++ .pre-commit-config.yaml | 14 ++++++++++++++ Dockerfile | 14 ++++++++++++++ build/build.sh | 14 ++++++++++++++ dist/bfe.ini | 14 ++++++++++++++ dist/start.sh | 14 ++++++++++++++ scripts/start.sh | 14 ++++++++++++++ 8 files changed, 112 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bec5cf4d..68fead83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,17 @@ +# Copyright 2021 The BFE 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. +# # This is a basic workflow to help you get started with Actions name: CI diff --git a/.gitignore b/.gitignore index afda73b8..e6060c10 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,17 @@ +# Copyright 2021 The BFE 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. +# # Binaries for programs and plugins *.exe *.exe~ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 89b29d86..2c716604 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,17 @@ +# Copyright 2021 The BFE 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. +# repos: - repo: git://github.com/dnephin/pre-commit-golang rev: v0.4.0 diff --git a/Dockerfile b/Dockerfile index 5f7e8c2f..4e953ccb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2021 The BFE 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. +# FROM golang:1.16-alpine3.14 AS build WORKDIR /bfe-ingress-controller diff --git a/build/build.sh b/build/build.sh index 906416f9..da22d42c 100755 --- a/build/build.sh +++ b/build/build.sh @@ -1,4 +1,18 @@ #!/bin/sh +# Copyright 2021 The BFE 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. +# set -e set -x diff --git a/dist/bfe.ini b/dist/bfe.ini index ec0cc2d8..c75f9a43 100644 --- a/dist/bfe.ini +++ b/dist/bfe.ini @@ -1,3 +1,17 @@ +; Copyright 2021 The BFE 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. +; [program:bfe] directory=/home/work/bfe/bin/ command=./bfe -c ../conf -l ../log -d diff --git a/dist/start.sh b/dist/start.sh index a021601a..424ac636 100644 --- a/dist/start.sh +++ b/dist/start.sh @@ -1,4 +1,18 @@ #!/bin/sh +# Copyright 2021 The BFE 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. +# set -x readonly BFE_BIN=bfe diff --git a/scripts/start.sh b/scripts/start.sh index ee9acfd5..df9aa78d 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1,4 +1,18 @@ #!/bin/sh +# Copyright 2021 The BFE 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. +# set -e if [ $# -lt 2 ]; then echo "error: number of argument should >= 2" From bd06cab40da2e880af1191fe0179b7fa2df945e5 Mon Sep 17 00:00:00 2001 From: Dai Ming Date: Wed, 17 Nov 2021 17:32:09 +0800 Subject: [PATCH 2/7] update helm repo url --- docs/en_us/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en_us/deployment.md b/docs/en_us/deployment.md index 3c87e13f..b63015db 100644 --- a/docs/en_us/deployment.md +++ b/docs/en_us/deployment.md @@ -18,7 +18,7 @@ kubectl apply -f https://raw.githubusercontent.com/bfenetworks/ingress-bfe/devel ### Helm ``` -helm upgrade --install bfe-ingress-controller bfe-ingress-controller --repo https://github.com/bfenetworks/ingress-bfe --namespace ingress-bfe --create-namespace +helm upgrade --install bfe-ingress-controller bfe-ingress-controller --repo https://bfenetworks.github.io/ingress-bfe --namespace ingress-bfe --create-namespace ``` - helm3 is required. From 2284b2fbe7e4f91d8b898b99efb2fde34ad9d1a5 Mon Sep 17 00:00:00 2001 From: Dai Ming Date: Wed, 17 Nov 2021 17:33:38 +0800 Subject: [PATCH 3/7] update helm repo url --- docs/zh_cn/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh_cn/deployment.md b/docs/zh_cn/deployment.md index b8284a94..98af5909 100644 --- a/docs/zh_cn/deployment.md +++ b/docs/zh_cn/deployment.md @@ -18,7 +18,7 @@ kubectl apply -f https://raw.githubusercontent.com/bfenetworks/ingress-bfe/devel ### Helm安装 ``` -helm upgrade --install bfe-ingress-controller bfe-ingress-controller --repo https://github.com/bfenetworks/ingress-bfe --namespace ingress-bfe --create-namespace +helm upgrade --install bfe-ingress-controller bfe-ingress-controller --repo https://bfenetworks.github.io/ingress-bfe --namespace ingress-bfe --create-namespace ``` - 要求helm3 From 48318dc1cf5e34e2699f0b706322e4824fbf4168 Mon Sep 17 00:00:00 2001 From: kwanhur Date: Sun, 16 Jan 2022 13:27:50 +0800 Subject: [PATCH 4/7] Fix license header declaration Signed-off-by: kwanhur --- .github/workflows/helm.yaml | 14 ++++++++++++++ charts/bfe-ingress-controller/.helmignore | 14 ++++++++++++++ charts/bfe-ingress-controller/Chart.yaml | 14 ++++++++++++++ .../templates/_helpers.tpl | 16 ++++++++++++++++ .../templates/deployment.yaml | 14 ++++++++++++++ charts/bfe-ingress-controller/templates/hpa.yaml | 14 ++++++++++++++ .../bfe-ingress-controller/templates/rbac.yaml | 14 ++++++++++++++ .../templates/service.yaml | 14 ++++++++++++++ .../templates/serviceaccount.yaml | 14 ++++++++++++++ charts/bfe-ingress-controller/values.yaml | 14 ++++++++++++++ 10 files changed, 142 insertions(+) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index de05675d..b56aba10 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -1,3 +1,17 @@ +# Copyright 2022 The BFE 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. +# name: Helm on: diff --git a/charts/bfe-ingress-controller/.helmignore b/charts/bfe-ingress-controller/.helmignore index 0e8a0eb3..6abdc1c9 100644 --- a/charts/bfe-ingress-controller/.helmignore +++ b/charts/bfe-ingress-controller/.helmignore @@ -1,3 +1,17 @@ +# # Copyright 2022 The BFE 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. +# # Patterns to ignore when building packages. # This supports shell glob matching, relative path matching, and # negation (prefixed with !). Only one pattern per line. diff --git a/charts/bfe-ingress-controller/Chart.yaml b/charts/bfe-ingress-controller/Chart.yaml index 7cd70b33..8dad6ee6 100644 --- a/charts/bfe-ingress-controller/Chart.yaml +++ b/charts/bfe-ingress-controller/Chart.yaml @@ -1,3 +1,17 @@ +# Copyright 2022 The BFE 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. +# apiVersion: v2 name: bfe-ingress-controller description: Helm chart for BFE Ingress Controller diff --git a/charts/bfe-ingress-controller/templates/_helpers.tpl b/charts/bfe-ingress-controller/templates/_helpers.tpl index 9fd5a56d..d6c2f714 100644 --- a/charts/bfe-ingress-controller/templates/_helpers.tpl +++ b/charts/bfe-ingress-controller/templates/_helpers.tpl @@ -1,3 +1,19 @@ +{* + Copyright 2022 The BFE 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. + +*} {{/* Expand the name of the chart. */}} diff --git a/charts/bfe-ingress-controller/templates/deployment.yaml b/charts/bfe-ingress-controller/templates/deployment.yaml index ebbfa5d0..ee8f2691 100644 --- a/charts/bfe-ingress-controller/templates/deployment.yaml +++ b/charts/bfe-ingress-controller/templates/deployment.yaml @@ -1,3 +1,17 @@ +# Copyright 2022 The BFE 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. +# apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/bfe-ingress-controller/templates/hpa.yaml b/charts/bfe-ingress-controller/templates/hpa.yaml index 5448f0e2..1e67b73a 100644 --- a/charts/bfe-ingress-controller/templates/hpa.yaml +++ b/charts/bfe-ingress-controller/templates/hpa.yaml @@ -1,3 +1,17 @@ +# Copyright 2022 The BFE 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. +# {{- if .Values.autoscaling.enabled }} apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler diff --git a/charts/bfe-ingress-controller/templates/rbac.yaml b/charts/bfe-ingress-controller/templates/rbac.yaml index cf61069b..f438104a 100644 --- a/charts/bfe-ingress-controller/templates/rbac.yaml +++ b/charts/bfe-ingress-controller/templates/rbac.yaml @@ -1,3 +1,17 @@ +# Copyright 2022 The BFE 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. +# {{- if .Values.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 diff --git a/charts/bfe-ingress-controller/templates/service.yaml b/charts/bfe-ingress-controller/templates/service.yaml index f0e9c969..d2a03f51 100644 --- a/charts/bfe-ingress-controller/templates/service.yaml +++ b/charts/bfe-ingress-controller/templates/service.yaml @@ -1,3 +1,17 @@ +# Copyright 2022 The BFE 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. +# apiVersion: v1 kind: Service metadata: diff --git a/charts/bfe-ingress-controller/templates/serviceaccount.yaml b/charts/bfe-ingress-controller/templates/serviceaccount.yaml index 5fe44224..9b761f07 100644 --- a/charts/bfe-ingress-controller/templates/serviceaccount.yaml +++ b/charts/bfe-ingress-controller/templates/serviceaccount.yaml @@ -1,3 +1,17 @@ +# Copyright 2022 The BFE 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. +# {{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount diff --git a/charts/bfe-ingress-controller/values.yaml b/charts/bfe-ingress-controller/values.yaml index 80626d11..4ef53622 100644 --- a/charts/bfe-ingress-controller/values.yaml +++ b/charts/bfe-ingress-controller/values.yaml @@ -1,3 +1,17 @@ +# Copyright 2022 The BFE 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. +# # Default values for bfe-ingress-controller. replicaCount: 1 From bf00e21516022c45c5d4026f2fa11d908980828c Mon Sep 17 00:00:00 2001 From: kwanhur Date: Tue, 18 Jan 2022 11:21:41 +0800 Subject: [PATCH 5/7] Add license-eye tool Signed-off-by: kwanhur --- .licenserc.yaml | 36 +++++++++++++++++++++++ Makefile | 13 ++++++++ docs/en_us/contribute/contribute-codes.md | 25 ++++++++++++---- docs/zh_cn/contribute/contribute-codes.md | 16 ++++++++-- 4 files changed, 82 insertions(+), 8 deletions(-) create mode 100644 .licenserc.yaml diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 00000000..c1bf5897 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,36 @@ +# Copyright (c) 2022 The BFE 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. + +header: + license: + spdx-id: Apache-2.0 + copyright-owner: The BFE Authors + + paths-ignore: + - '.idea' + - 'conf' + - 'docs/images' + - '**/go.mod' + - '**/go.sum' + - '**/*.md' + - '**/*.orig' + - 'examples/*' + - 'LICENSE' + - 'VERSION' + + comment: on-failure + + dependency: + files: + - go.mod diff --git a/Makefile b/Makefile index 2fc158bd..79c3b238 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ GOGEN := $(GO) generate GOCLEAN := $(GO) clean GOFLAGS := -race STATICCHECK := staticcheck +LICENSEEYE := license-eye # init arch ARCH := $(shell getconf LONG_BIT) @@ -70,6 +71,18 @@ check: $(GO) get honnef.co/go/tools/cmd/staticcheck $(STATICCHECK) ./... +# make license-eye-install +license-eye-install: + $(GO) install github.com/apache/skywalking-eyes/cmd/license-eye@latest + +# make license-check, check code file's license declaration +license-check: license-eye-install + $(LICENSEEYE) header check + +# make license-fix, fix code file's license declaration +license-fix: license-eye-install + $(LICENSEEYE) header fix + # make docker docker: docker build \ diff --git a/docs/en_us/contribute/contribute-codes.md b/docs/en_us/contribute/contribute-codes.md index 0c403388..2120526e 100644 --- a/docs/en_us/contribute/contribute-codes.md +++ b/docs/en_us/contribute/contribute-codes.md @@ -48,15 +48,28 @@ Below tutorial will guide you to submit code $ pre-commit install ``` 2. use `gofmt` to format code. + + +5. Use `license-eye` tool + + [license-eye](http://github.com/apache/skywalking-eyes) helps us check and fix file's license header declaration. All files' license header should be done before committing. + + The `license-eye` check is part of the Github-Action. A PR that check failed cannot be submitted to BFE. Install `license-eye` and do check or fix: + + ```bash + $ make license-eye-install + $ make license-check + $ make license-fix + ``` -5. Coding +6. Coding -6. Build and test +7. Build and test Compile source code, build BFE Ingress Controller docker and then test it. See more instruction in [Deploy Guide](../deployment.md) -7. Commit +8. Commit run `git commit` . @@ -72,7 +85,7 @@ See more instruction in [Deploy Guide](../deployment.md) $ git commit -m "test=release/1.1" ``` -8. Keep local repository up-to-date +9. Keep local repository up-to-date An experienced Git user always pulls from the official repo before pushing. They even pull daily or hourly, so they notice conflicts earlier, and it's easier to resolve smaller conflicts. @@ -82,9 +95,9 @@ They even pull daily or hourly, so they notice conflicts earlier, and it's easie git pull upstream develop ``` -9. Push to remote repository +10. Push to remote repository - Push local to your repository on GitHub `https://github.com/${USERNAME}/ingress-bfe` + Push local to your repository on GitHub `https://github.com/${USERNAME}/ingress-bfe` ```bash # Example: push to remote repository `origin` branch `my-cool-stuff` diff --git a/docs/zh_cn/contribute/contribute-codes.md b/docs/zh_cn/contribute/contribute-codes.md index 5133f560..ed7fb925 100644 --- a/docs/zh_cn/contribute/contribute-codes.md +++ b/docs/zh_cn/contribute/contribute-codes.md @@ -50,8 +50,20 @@ $ pip install pre-commit $ pre-commit install ``` - 1. 使用 `gofmt` 来调整 golang源代码格式。 - + 2. 使用 `gofmt` 来调整 golang源代码格式。 + +1. 使用 `license-eye` 工具 + + [license-eye](http://github.com/apache/skywalking-eyes) 工具可以帮助我们检查和修复所有文件的证书声明,在提交 (commit) 前证书声明都应该先完成。 + + `license-eye` 检查是 Github-Action 中检测的一部分,检测不通过的 PR 不能被提交到代码库,安装使用它: + + ```bash + $ make license-eye-install + $ make license-check + $ make license-fix + ``` + 1. 编写代码 在本例中,删除了 README.md 中的一行,并创建了一个新文件。 From 6d8c79d747d62e0eecfe9bb0e0aa75ba9f398837 Mon Sep 17 00:00:00 2001 From: Dai Ming Date: Tue, 18 Jan 2022 12:06:00 +0800 Subject: [PATCH 6/7] Revert "Add license-eye tool" --- .licenserc.yaml | 36 ----------------------- Makefile | 13 -------- docs/en_us/contribute/contribute-codes.md | 25 ++++------------ docs/zh_cn/contribute/contribute-codes.md | 16 ++-------- 4 files changed, 8 insertions(+), 82 deletions(-) delete mode 100644 .licenserc.yaml diff --git a/.licenserc.yaml b/.licenserc.yaml deleted file mode 100644 index c1bf5897..00000000 --- a/.licenserc.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2022 The BFE 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. - -header: - license: - spdx-id: Apache-2.0 - copyright-owner: The BFE Authors - - paths-ignore: - - '.idea' - - 'conf' - - 'docs/images' - - '**/go.mod' - - '**/go.sum' - - '**/*.md' - - '**/*.orig' - - 'examples/*' - - 'LICENSE' - - 'VERSION' - - comment: on-failure - - dependency: - files: - - go.mod diff --git a/Makefile b/Makefile index 79c3b238..2fc158bd 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,6 @@ GOGEN := $(GO) generate GOCLEAN := $(GO) clean GOFLAGS := -race STATICCHECK := staticcheck -LICENSEEYE := license-eye # init arch ARCH := $(shell getconf LONG_BIT) @@ -71,18 +70,6 @@ check: $(GO) get honnef.co/go/tools/cmd/staticcheck $(STATICCHECK) ./... -# make license-eye-install -license-eye-install: - $(GO) install github.com/apache/skywalking-eyes/cmd/license-eye@latest - -# make license-check, check code file's license declaration -license-check: license-eye-install - $(LICENSEEYE) header check - -# make license-fix, fix code file's license declaration -license-fix: license-eye-install - $(LICENSEEYE) header fix - # make docker docker: docker build \ diff --git a/docs/en_us/contribute/contribute-codes.md b/docs/en_us/contribute/contribute-codes.md index 2120526e..0c403388 100644 --- a/docs/en_us/contribute/contribute-codes.md +++ b/docs/en_us/contribute/contribute-codes.md @@ -48,28 +48,15 @@ Below tutorial will guide you to submit code $ pre-commit install ``` 2. use `gofmt` to format code. - - -5. Use `license-eye` tool - - [license-eye](http://github.com/apache/skywalking-eyes) helps us check and fix file's license header declaration. All files' license header should be done before committing. - - The `license-eye` check is part of the Github-Action. A PR that check failed cannot be submitted to BFE. Install `license-eye` and do check or fix: - - ```bash - $ make license-eye-install - $ make license-check - $ make license-fix - ``` -6. Coding +5. Coding -7. Build and test +6. Build and test Compile source code, build BFE Ingress Controller docker and then test it. See more instruction in [Deploy Guide](../deployment.md) -8. Commit +7. Commit run `git commit` . @@ -85,7 +72,7 @@ See more instruction in [Deploy Guide](../deployment.md) $ git commit -m "test=release/1.1" ``` -9. Keep local repository up-to-date +8. Keep local repository up-to-date An experienced Git user always pulls from the official repo before pushing. They even pull daily or hourly, so they notice conflicts earlier, and it's easier to resolve smaller conflicts. @@ -95,9 +82,9 @@ They even pull daily or hourly, so they notice conflicts earlier, and it's easie git pull upstream develop ``` -10. Push to remote repository +9. Push to remote repository - Push local to your repository on GitHub `https://github.com/${USERNAME}/ingress-bfe` + Push local to your repository on GitHub `https://github.com/${USERNAME}/ingress-bfe` ```bash # Example: push to remote repository `origin` branch `my-cool-stuff` diff --git a/docs/zh_cn/contribute/contribute-codes.md b/docs/zh_cn/contribute/contribute-codes.md index ed7fb925..5133f560 100644 --- a/docs/zh_cn/contribute/contribute-codes.md +++ b/docs/zh_cn/contribute/contribute-codes.md @@ -50,20 +50,8 @@ $ pip install pre-commit $ pre-commit install ``` - 2. 使用 `gofmt` 来调整 golang源代码格式。 - -1. 使用 `license-eye` 工具 - - [license-eye](http://github.com/apache/skywalking-eyes) 工具可以帮助我们检查和修复所有文件的证书声明,在提交 (commit) 前证书声明都应该先完成。 - - `license-eye` 检查是 Github-Action 中检测的一部分,检测不通过的 PR 不能被提交到代码库,安装使用它: - - ```bash - $ make license-eye-install - $ make license-check - $ make license-fix - ``` - + 1. 使用 `gofmt` 来调整 golang源代码格式。 + 1. 编写代码 在本例中,删除了 README.md 中的一行,并创建了一个新文件。 From b3bf4b5a208876c02deda1a3a2785459036dfdb5 Mon Sep 17 00:00:00 2001 From: Dai Ming Date: Tue, 18 Jan 2022 14:11:01 +0800 Subject: [PATCH 7/7] Revert "Fix helm license header declaration" --- .github/workflows/helm.yaml | 14 -------------- charts/bfe-ingress-controller/.helmignore | 14 -------------- charts/bfe-ingress-controller/Chart.yaml | 14 -------------- .../templates/_helpers.tpl | 16 ---------------- .../templates/deployment.yaml | 14 -------------- charts/bfe-ingress-controller/templates/hpa.yaml | 14 -------------- .../bfe-ingress-controller/templates/rbac.yaml | 14 -------------- .../templates/service.yaml | 14 -------------- .../templates/serviceaccount.yaml | 14 -------------- charts/bfe-ingress-controller/values.yaml | 14 -------------- 10 files changed, 142 deletions(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index b56aba10..de05675d 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -1,17 +1,3 @@ -# Copyright 2022 The BFE 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. -# name: Helm on: diff --git a/charts/bfe-ingress-controller/.helmignore b/charts/bfe-ingress-controller/.helmignore index 6abdc1c9..0e8a0eb3 100644 --- a/charts/bfe-ingress-controller/.helmignore +++ b/charts/bfe-ingress-controller/.helmignore @@ -1,17 +1,3 @@ -# # Copyright 2022 The BFE 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. -# # Patterns to ignore when building packages. # This supports shell glob matching, relative path matching, and # negation (prefixed with !). Only one pattern per line. diff --git a/charts/bfe-ingress-controller/Chart.yaml b/charts/bfe-ingress-controller/Chart.yaml index 8dad6ee6..7cd70b33 100644 --- a/charts/bfe-ingress-controller/Chart.yaml +++ b/charts/bfe-ingress-controller/Chart.yaml @@ -1,17 +1,3 @@ -# Copyright 2022 The BFE 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. -# apiVersion: v2 name: bfe-ingress-controller description: Helm chart for BFE Ingress Controller diff --git a/charts/bfe-ingress-controller/templates/_helpers.tpl b/charts/bfe-ingress-controller/templates/_helpers.tpl index d6c2f714..9fd5a56d 100644 --- a/charts/bfe-ingress-controller/templates/_helpers.tpl +++ b/charts/bfe-ingress-controller/templates/_helpers.tpl @@ -1,19 +1,3 @@ -{* - Copyright 2022 The BFE 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. - -*} {{/* Expand the name of the chart. */}} diff --git a/charts/bfe-ingress-controller/templates/deployment.yaml b/charts/bfe-ingress-controller/templates/deployment.yaml index ee8f2691..ebbfa5d0 100644 --- a/charts/bfe-ingress-controller/templates/deployment.yaml +++ b/charts/bfe-ingress-controller/templates/deployment.yaml @@ -1,17 +1,3 @@ -# Copyright 2022 The BFE 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. -# apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/bfe-ingress-controller/templates/hpa.yaml b/charts/bfe-ingress-controller/templates/hpa.yaml index 1e67b73a..5448f0e2 100644 --- a/charts/bfe-ingress-controller/templates/hpa.yaml +++ b/charts/bfe-ingress-controller/templates/hpa.yaml @@ -1,17 +1,3 @@ -# Copyright 2022 The BFE 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. -# {{- if .Values.autoscaling.enabled }} apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler diff --git a/charts/bfe-ingress-controller/templates/rbac.yaml b/charts/bfe-ingress-controller/templates/rbac.yaml index f438104a..cf61069b 100644 --- a/charts/bfe-ingress-controller/templates/rbac.yaml +++ b/charts/bfe-ingress-controller/templates/rbac.yaml @@ -1,17 +1,3 @@ -# Copyright 2022 The BFE 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. -# {{- if .Values.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 diff --git a/charts/bfe-ingress-controller/templates/service.yaml b/charts/bfe-ingress-controller/templates/service.yaml index d2a03f51..f0e9c969 100644 --- a/charts/bfe-ingress-controller/templates/service.yaml +++ b/charts/bfe-ingress-controller/templates/service.yaml @@ -1,17 +1,3 @@ -# Copyright 2022 The BFE 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. -# apiVersion: v1 kind: Service metadata: diff --git a/charts/bfe-ingress-controller/templates/serviceaccount.yaml b/charts/bfe-ingress-controller/templates/serviceaccount.yaml index 9b761f07..5fe44224 100644 --- a/charts/bfe-ingress-controller/templates/serviceaccount.yaml +++ b/charts/bfe-ingress-controller/templates/serviceaccount.yaml @@ -1,17 +1,3 @@ -# Copyright 2022 The BFE 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. -# {{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount diff --git a/charts/bfe-ingress-controller/values.yaml b/charts/bfe-ingress-controller/values.yaml index 4ef53622..80626d11 100644 --- a/charts/bfe-ingress-controller/values.yaml +++ b/charts/bfe-ingress-controller/values.yaml @@ -1,17 +1,3 @@ -# Copyright 2022 The BFE 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. -# # Default values for bfe-ingress-controller. replicaCount: 1