diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 523373395a8..1954882e8b1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -164,6 +164,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 61cadf1a068..adcf330aec6 100644 --- a/Makefile +++ b/Makefile @@ -194,6 +194,14 @@ 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: + @GO=$(GO) $(CURDIR)/hack/add-license.sh + +.PHONY: add-copyright +add-copyright: + @GO=$(GO) $(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..b3fd904492d --- /dev/null +++ b/hack/add-license.sh @@ -0,0 +1,67 @@ +#!/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 + +# if Go environment variable is set, use it as it is, otherwise default to "go" +: "${GO:=go}" + +GO_VERSION="$(${GO} version | awk '{print $3}')" +function version_lt() { test "$(printf '%s\n' "$@" | sort -rV | head -n 1)" != "$1"; } + +if version_lt "${GO_VERSION}" "go1.16"; then + # See https://golang.org/doc/go-get-install-deprecation + echo "Running this script requires Go >= 1.16, please upgrade" + exit 1 +fi + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +cd "${ROOT}" + +TMP_DIR=$(mktemp -d) + +# cleanup +exitHandler() ( + echo "Cleaning up temporary directory" + rm -rf "${TMP_DIR}" +) +trap exitHandler EXIT + +echo "==> Installing addlicense <==" +GOBIN="${TMP_DIR}" ${GO} install "github.com/google/addlicense@latest" +export PATH="${TMP_DIR}:${PATH}" + +ADD=false + +while [[ $# -gt 0 ]] +do +key="$1" + +case $key in + --add) + ADD=true + shift + ;; +esac +done + +if $ADD; then + echo "===> Adding License for files <===" + addlicense -c "Antrea Authors." -y $(date +%Y) `find . -type f -name "*.go"` `find . -type f -name "*.sh"` +else + echo "===> Checking License for files <===" + addlicense -c "Antrea Authors." -check `find . -type f -name "*.go"` `find . -type f -name "*.sh"` +fi diff --git a/hack/netpol-generator/test-kind.sh b/hack/netpol-generator/test-kind.sh index ff97b8f5f93..f3e086679b7 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/multicluster/apis/multicluster/v1alpha1/doc.go b/multicluster/apis/multicluster/v1alpha1/doc.go index e0f912ac25f..71a933763de 100644 --- a/multicluster/apis/multicluster/v1alpha1/doc.go +++ b/multicluster/apis/multicluster/v1alpha1/doc.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 v1alpha1 is the v1alpha1 version of the API. // +groupName=multicluster.crd.antrea.io package v1alpha1 diff --git a/multicluster/apis/multicluster/v1alpha1/register.go b/multicluster/apis/multicluster/v1alpha1/register.go index b84580412d2..70799d9e562 100644 --- a/multicluster/apis/multicluster/v1alpha1/register.go +++ b/multicluster/apis/multicluster/v1alpha1/register.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 v1alpha1 import ( diff --git a/multicluster/controllers/multicluster/controller_utils.go b/multicluster/controllers/multicluster/controller_utils.go index 64db0347c3e..6d248526609 100644 --- a/multicluster/controllers/multicluster/controller_utils.go +++ b/multicluster/controllers/multicluster/controller_utils.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 multicluster import ( diff --git a/multicluster/controllers/multicluster/leader_clusterset_controller_test.go b/multicluster/controllers/multicluster/leader_clusterset_controller_test.go index 94b370bfbc9..735cdac93d3 100644 --- a/multicluster/controllers/multicluster/leader_clusterset_controller_test.go +++ b/multicluster/controllers/multicluster/leader_clusterset_controller_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 multicluster import ( diff --git a/multicluster/controllers/multicluster/memberclusterannounce_controller_test.go b/multicluster/controllers/multicluster/memberclusterannounce_controller_test.go index 0f2162e73b2..44c144d1694 100644 --- a/multicluster/controllers/multicluster/memberclusterannounce_controller_test.go +++ b/multicluster/controllers/multicluster/memberclusterannounce_controller_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 multicluster import ( 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 2e47ea11d7a..cc3592dd1aa 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] Provisions the Vagrant VMs. diff --git a/test/e2e/infra/vagrant/push_antrea.sh b/test/e2e/infra/vagrant/push_antrea.sh index 7d34646cb64..8ac1965bfa5 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 )"