From d1cfbec682d1aa098c41fbc29f29c3352e00b4f4 Mon Sep 17 00:00:00 2001 From: zbangqi Date: Thu, 6 Jan 2022 00:05:59 -0800 Subject: [PATCH] addlicense 1. add make check-copyright and add-copyright in Makefile to check and add copyright for files automatically 2. check if all needed copyright is added in workflow 3. add copyright for files Closes antrea-io#3100 Signed-off-by: zbangqi --- .github/workflows/go.yml | 2 ++ Makefile | 14 ++++++++ ci/check-copyright.sh | 31 ++++++++++++++++ ci/clair-scan/report.go | 14 ++++++++ ci/clair-scan/run.sh | 14 ++++++++ ci/gh-actions/has-changes/entrypoint.sh | 14 ++++++++ ci/golicense/run.sh | 14 ++++++++ ci/jenkins/mellanox/common/clean_common.sh | 14 ++++++++ .../mellanox/common/common_functions.sh | 14 ++++++++ ci/jenkins/mellanox/common/run_ci_scripts.sh | 14 ++++++++ ci/jenkins/mellanox/scripts/start_ci.sh | 14 ++++++++ ci/jenkins/mellanox/scripts/stop_ci.sh | 14 ++++++++ ci/jenkins/mellanox/scripts/test.sh | 14 ++++++++ ci/jenkins/mellanox/switchdev_setup.sh | 14 ++++++++ ci/test-elk-flow-collector.sh | 14 ++++++++ cmd/antctl/bincover_run_main_test.go | 14 ++++++++ cmd/antrea-agent/bincover_run_main_test.go | 14 ++++++++ .../bincover_run_main_test.go | 14 ++++++++ cmd/flow-aggregator/bincover_run_main_test.go | 14 ++++++++ hack/add-license.sh | 36 +++++++++++++++++++ hack/netpol-generator/test-kind.sh | 14 ++++++++ hack/netpol/pkg/main/main.go | 14 ++++++++ hack/netpol/pkg/utils/k8s_util.go | 14 ++++++++ .../pkg/utils/networkpolicyspecbuilder.go | 14 ++++++++ hack/netpol/pkg/utils/reachability.go | 14 ++++++++ hack/netpol/pkg/utils/utils_test.go | 14 ++++++++ hack/netpol/test-kind.sh | 14 ++++++++ pkg/agent/config/traffic_encap_mode_test.go | 14 ++++++++ pkg/agent/proxy/metrics/metrics.go | 14 ++++++++ pkg/apis/controlplane/sets_test.go | 14 ++++++++ pkg/ovs/openflow/ofctrl_action.go | 14 ++++++++ pkg/ovs/openflow/ofctrl_bridge.go | 14 ++++++++ pkg/ovs/openflow/ofctrl_flow.go | 14 ++++++++ pkg/ovs/openflow/ofctrl_flow_test.go | 14 ++++++++ pkg/ovs/openflow/ofctrl_packetout_test.go | 14 ++++++++ test/e2e/infra/vagrant/destroy.sh | 14 ++++++++ test/e2e/infra/vagrant/provision.sh | 14 ++++++++ test/e2e/infra/vagrant/push_antrea.sh | 14 ++++++++ test/e2e/infra/vagrant/resume.sh | 14 ++++++++ test/e2e/infra/vagrant/suspend.sh | 14 ++++++++ 40 files changed, 587 insertions(+) create mode 100755 ci/check-copyright.sh create mode 100755 hack/add-license.sh diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9f8607b6c18..f3ae3f5b564 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -160,6 +160,8 @@ jobs: run: ./ci/check-codegen.sh - name: Check manifest run: ./ci/check-manifest.sh + - name: Check copyright + run: ./ci/check-copyright.sh verify: name: Verify docs and spelling diff --git a/Makefile b/Makefile index 0237a201e24..bc3b64cc472 100644 --- a/Makefile +++ b/Makefile @@ -194,6 +194,20 @@ antctl: $(ANTCTL_BINARIES) antctl-release: @$(GO) build -o $(BINDIR)/$(ANTCTL_BINARY_NAME) $(GOFLAGS) -ldflags '-s -w $(LDFLAGS)' antrea.io/antrea/cmd/antctl +.PHONY: check-copyright +check-copyright: + @echo "==> Installing addlicense <==" + @$(GO) install github.com/google/addlicense@latest + @echo "===> Checking License for files <===" + $(CURDIR)/hack/add-license.sh + +.PHONY: add-copyright +add-copyright: + @echo "==> Installing addlicense <==" + @$(GO) install github.com/google/addlicense@latest + @echo "===> Adding License for files <===" + $(CURDIR)/hack/add-license.sh --add + .PHONY: .linux-test-unit .linux-test-unit: .coverage @echo diff --git a/ci/check-copyright.sh b/ci/check-copyright.sh new file mode 100755 index 00000000000..f7ad791504f --- /dev/null +++ b/ci/check-copyright.sh @@ -0,0 +1,31 @@ +# Copyright 2022 Antrea 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 -eo pipefail + +function echoerr { + >&2 echo "$@" +} + +THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +pushd $THIS_DIR/.. > /dev/null + +make add-copyright +diff="$(git status --porcelain `find . -type f -name "*.go"` `find . -type f -name "*.sh"`)" + +if [ ! -z "$diff" ]; then + echoerr "The copyrights of some files are not generated" + echoerr "You can regenerate them with 'make add-copyright' and commit the changes" + exit 1 +fi diff --git a/ci/clair-scan/report.go b/ci/clair-scan/report.go index 29946531196..def6f29852b 100644 --- a/ci/clair-scan/report.go +++ b/ci/clair-scan/report.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 main // These are copied from https://github.com/arminc/clair-scanner, which diff --git a/ci/clair-scan/run.sh b/ci/clair-scan/run.sh index 3d5e1654a75..ac7d062391d 100755 --- a/ci/clair-scan/run.sh +++ b/ci/clair-scan/run.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2022 Antrea 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 -eo pipefail diff --git a/ci/gh-actions/has-changes/entrypoint.sh b/ci/gh-actions/has-changes/entrypoint.sh index 036d8eb2400..fc4840bffd2 100755 --- a/ci/gh-actions/has-changes/entrypoint.sh +++ b/ci/gh-actions/has-changes/entrypoint.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2022 Antrea 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 -eo pipefail diff --git a/ci/golicense/run.sh b/ci/golicense/run.sh index dfd9fc0edd5..9b7033ab666 100755 --- a/ci/golicense/run.sh +++ b/ci/golicense/run.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2022 Antrea 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 -eo pipefail diff --git a/ci/jenkins/mellanox/common/clean_common.sh b/ci/jenkins/mellanox/common/clean_common.sh index 111a806eb08..cd4cc949e78 100755 --- a/ci/jenkins/mellanox/common/clean_common.sh +++ b/ci/jenkins/mellanox/common/clean_common.sh @@ -1,4 +1,18 @@ #!/bin/bash -x +# Copyright 2022 Antrea 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. + export LOGDIR=$WORKSPACE/logs export ARTIFACTS=$WORKSPACE/artifacts diff --git a/ci/jenkins/mellanox/common/common_functions.sh b/ci/jenkins/mellanox/common/common_functions.sh index 234f7b43507..1d468c88f21 100755 --- a/ci/jenkins/mellanox/common/common_functions.sh +++ b/ci/jenkins/mellanox/common/common_functions.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2022 Antrea 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. + export RECLONE=${RECLONE:-true} export WORKSPACE=${WORKSPACE:-/tmp/k8s_$$} diff --git a/ci/jenkins/mellanox/common/run_ci_scripts.sh b/ci/jenkins/mellanox/common/run_ci_scripts.sh index ea6dedbe33c..973a8b3353a 100644 --- a/ci/jenkins/mellanox/common/run_ci_scripts.sh +++ b/ci/jenkins/mellanox/common/run_ci_scripts.sh @@ -1,4 +1,18 @@ #!/bin/bash -x +# Copyright 2022 Antrea 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. + status=0 echo "I am" $(whoami) env diff --git a/ci/jenkins/mellanox/scripts/start_ci.sh b/ci/jenkins/mellanox/scripts/start_ci.sh index 4ba57cd37c2..e8c68f69e32 100755 --- a/ci/jenkins/mellanox/scripts/start_ci.sh +++ b/ci/jenkins/mellanox/scripts/start_ci.sh @@ -1,4 +1,18 @@ #!/bin/bash -x +# Copyright 2022 Antrea 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. + source ./common/common_functions.sh diff --git a/ci/jenkins/mellanox/scripts/stop_ci.sh b/ci/jenkins/mellanox/scripts/stop_ci.sh index 5a33410bd8b..d681232103a 100755 --- a/ci/jenkins/mellanox/scripts/stop_ci.sh +++ b/ci/jenkins/mellanox/scripts/stop_ci.sh @@ -1,4 +1,18 @@ #!/bin/bash -x +# Copyright 2022 Antrea 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. + export LOGDIR=$WORKSPACE/logs export ARTIFACTS=$WORKSPACE/artifacts diff --git a/ci/jenkins/mellanox/scripts/test.sh b/ci/jenkins/mellanox/scripts/test.sh index 69d90b0e0cc..239938566c3 100755 --- a/ci/jenkins/mellanox/scripts/test.sh +++ b/ci/jenkins/mellanox/scripts/test.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2022 Antrea 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. + export WORKSPACE=${WORKSPACE:-/tmp/k8s_$$} export LOGDIR=$WORKSPACE/logs diff --git a/ci/jenkins/mellanox/switchdev_setup.sh b/ci/jenkins/mellanox/switchdev_setup.sh index 783f99fff90..4f017651497 100755 --- a/ci/jenkins/mellanox/switchdev_setup.sh +++ b/ci/jenkins/mellanox/switchdev_setup.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2022 Antrea 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 scripts create vfs on the interface and switch them to switchdev mode # it accepts two parameters, the first is the name of the interface and the # second is the number of vfs diff --git a/ci/test-elk-flow-collector.sh b/ci/test-elk-flow-collector.sh index b3f28b001dd..6f3e915b6e2 100755 --- a/ci/test-elk-flow-collector.sh +++ b/ci/test-elk-flow-collector.sh @@ -1,3 +1,17 @@ +# Copyright 2022 Antrea 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 -eu LOGSTASH_PORT=4739 diff --git a/cmd/antctl/bincover_run_main_test.go b/cmd/antctl/bincover_run_main_test.go index e0256dd2d30..c8eb2554671 100644 --- a/cmd/antctl/bincover_run_main_test.go +++ b/cmd/antctl/bincover_run_main_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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. + //go:build testbincover // +build testbincover diff --git a/cmd/antrea-agent/bincover_run_main_test.go b/cmd/antrea-agent/bincover_run_main_test.go index e0256dd2d30..c8eb2554671 100644 --- a/cmd/antrea-agent/bincover_run_main_test.go +++ b/cmd/antrea-agent/bincover_run_main_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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. + //go:build testbincover // +build testbincover diff --git a/cmd/antrea-controller/bincover_run_main_test.go b/cmd/antrea-controller/bincover_run_main_test.go index e0256dd2d30..c8eb2554671 100644 --- a/cmd/antrea-controller/bincover_run_main_test.go +++ b/cmd/antrea-controller/bincover_run_main_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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. + //go:build testbincover // +build testbincover diff --git a/cmd/flow-aggregator/bincover_run_main_test.go b/cmd/flow-aggregator/bincover_run_main_test.go index e0256dd2d30..c8eb2554671 100644 --- a/cmd/flow-aggregator/bincover_run_main_test.go +++ b/cmd/flow-aggregator/bincover_run_main_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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. + //go:build testbincover // +build testbincover diff --git a/hack/add-license.sh b/hack/add-license.sh new file mode 100755 index 00000000000..088bd2a16a3 --- /dev/null +++ b/hack/add-license.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# Copyright 2022 Antrea 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. + +ADD=false + +while [[ $# -gt 0 ]] +do +key="$1" + +case $key in + --add) + ADD=true + shift + ;; +esac +done + +if $ADD; then + addlicense -c "Antrea Authors." -y $(date +%Y) `find . -type f -name "*.go"` `find . -type f -name "*.sh"` +else + addlicense -c "Antrea Authors." -check `find . -type f -name "*.go"` `find . -type f -name "*.sh"` + echo "Have checked out files without copyright, if you want to add them, please run 'make add-copyright'" +fi diff --git a/hack/netpol-generator/test-kind.sh b/hack/netpol-generator/test-kind.sh index 0aed429f057..ccadf7100fd 100755 --- a/hack/netpol-generator/test-kind.sh +++ b/hack/netpol-generator/test-kind.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2022 Antrea 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 -eo pipefail set -xv diff --git a/hack/netpol/pkg/main/main.go b/hack/netpol/pkg/main/main.go index c74d69f2062..fc4b09192f7 100644 --- a/hack/netpol/pkg/main/main.go +++ b/hack/netpol/pkg/main/main.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 main import ( diff --git a/hack/netpol/pkg/utils/k8s_util.go b/hack/netpol/pkg/utils/k8s_util.go index 4faae5b9adf..1e071398130 100644 --- a/hack/netpol/pkg/utils/k8s_util.go +++ b/hack/netpol/pkg/utils/k8s_util.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 utils import ( diff --git a/hack/netpol/pkg/utils/networkpolicyspecbuilder.go b/hack/netpol/pkg/utils/networkpolicyspecbuilder.go index b9952119b3b..fa9ee33a598 100644 --- a/hack/netpol/pkg/utils/networkpolicyspecbuilder.go +++ b/hack/netpol/pkg/utils/networkpolicyspecbuilder.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 utils import ( diff --git a/hack/netpol/pkg/utils/reachability.go b/hack/netpol/pkg/utils/reachability.go index 4c9bf0c8c6e..a72440693b6 100644 --- a/hack/netpol/pkg/utils/reachability.go +++ b/hack/netpol/pkg/utils/reachability.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 utils import ( diff --git a/hack/netpol/pkg/utils/utils_test.go b/hack/netpol/pkg/utils/utils_test.go index d11e247f41b..6de5533841d 100644 --- a/hack/netpol/pkg/utils/utils_test.go +++ b/hack/netpol/pkg/utils/utils_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 utils import ( diff --git a/hack/netpol/test-kind.sh b/hack/netpol/test-kind.sh index 4f5de3458c0..bce9ebef377 100755 --- a/hack/netpol/test-kind.sh +++ b/hack/netpol/test-kind.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2022 Antrea 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 -eo pipefail diff --git a/pkg/agent/config/traffic_encap_mode_test.go b/pkg/agent/config/traffic_encap_mode_test.go index e7265ce05dc..119081164e6 100644 --- a/pkg/agent/config/traffic_encap_mode_test.go +++ b/pkg/agent/config/traffic_encap_mode_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 config import ( diff --git a/pkg/agent/proxy/metrics/metrics.go b/pkg/agent/proxy/metrics/metrics.go index 414f592648c..a14df15126f 100644 --- a/pkg/agent/proxy/metrics/metrics.go +++ b/pkg/agent/proxy/metrics/metrics.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 metrics import ( diff --git a/pkg/apis/controlplane/sets_test.go b/pkg/apis/controlplane/sets_test.go index 1fe5a770184..ab74a940b46 100644 --- a/pkg/apis/controlplane/sets_test.go +++ b/pkg/apis/controlplane/sets_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 controlplane import ( diff --git a/pkg/ovs/openflow/ofctrl_action.go b/pkg/ovs/openflow/ofctrl_action.go index 93e876bc25b..c53c6b2e678 100644 --- a/pkg/ovs/openflow/ofctrl_action.go +++ b/pkg/ovs/openflow/ofctrl_action.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 openflow import ( diff --git a/pkg/ovs/openflow/ofctrl_bridge.go b/pkg/ovs/openflow/ofctrl_bridge.go index 467363a1e1d..80674340308 100644 --- a/pkg/ovs/openflow/ofctrl_bridge.go +++ b/pkg/ovs/openflow/ofctrl_bridge.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 openflow import ( diff --git a/pkg/ovs/openflow/ofctrl_flow.go b/pkg/ovs/openflow/ofctrl_flow.go index 4a4928218ad..b3a1dc60033 100644 --- a/pkg/ovs/openflow/ofctrl_flow.go +++ b/pkg/ovs/openflow/ofctrl_flow.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 openflow import ( diff --git a/pkg/ovs/openflow/ofctrl_flow_test.go b/pkg/ovs/openflow/ofctrl_flow_test.go index 2f0b15c3c0f..413cb95a6ad 100644 --- a/pkg/ovs/openflow/ofctrl_flow_test.go +++ b/pkg/ovs/openflow/ofctrl_flow_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 openflow import ( diff --git a/pkg/ovs/openflow/ofctrl_packetout_test.go b/pkg/ovs/openflow/ofctrl_packetout_test.go index ed1625a2218..64001df1008 100644 --- a/pkg/ovs/openflow/ofctrl_packetout_test.go +++ b/pkg/ovs/openflow/ofctrl_packetout_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 Antrea 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 openflow import ( diff --git a/test/e2e/infra/vagrant/destroy.sh b/test/e2e/infra/vagrant/destroy.sh index f42899d6ecb..8a400a4d80e 100755 --- a/test/e2e/infra/vagrant/destroy.sh +++ b/test/e2e/infra/vagrant/destroy.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2022 Antrea 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_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" diff --git a/test/e2e/infra/vagrant/provision.sh b/test/e2e/infra/vagrant/provision.sh index d7a5b0b525e..aea4e1fca9e 100755 --- a/test/e2e/infra/vagrant/provision.sh +++ b/test/e2e/infra/vagrant/provision.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2022 Antrea 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. + function usage() { echo "Usage: provision.sh [--ip-family ] [-l|--large] [-h|--help] diff --git a/test/e2e/infra/vagrant/push_antrea.sh b/test/e2e/infra/vagrant/push_antrea.sh index aab56f06a25..92aa5cd373b 100755 --- a/test/e2e/infra/vagrant/push_antrea.sh +++ b/test/e2e/infra/vagrant/push_antrea.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2022 Antrea 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. + function usage() { echo "Usage: push_antrea.sh [--prometheus] [-fc|--flow-collector
] [-fa|--flow-aggregator] [-h|--help] diff --git a/test/e2e/infra/vagrant/resume.sh b/test/e2e/infra/vagrant/resume.sh index f8b689da227..b2b0c995843 100755 --- a/test/e2e/infra/vagrant/resume.sh +++ b/test/e2e/infra/vagrant/resume.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2022 Antrea 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_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" diff --git a/test/e2e/infra/vagrant/suspend.sh b/test/e2e/infra/vagrant/suspend.sh index a9fce63aa2f..9f2aeba8475 100755 --- a/test/e2e/infra/vagrant/suspend.sh +++ b/test/e2e/infra/vagrant/suspend.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2022 Antrea 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_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"