From ad30fb21a778c2ffe2898527bf6acbc0c42f023a Mon Sep 17 00:00:00 2001 From: Nikhita Raghunath Date: Sun, 7 Mar 2021 21:01:06 +0530 Subject: [PATCH 1/2] hack: add verify script for boilerplate + yamllint check - Update existing `verify-yamllint.sh` script to install yamllint if it does not exist. - Add `verify-boilerplate.sh` script for verifying boilerplate. - Add `verify.sh` script to test all verify scripts at once. This would be useful for adding future verify scripts. --- .gitignore | 2 + hack/boilerplate/boilerplate.Dockerfile.txt | 14 +++ hack/boilerplate/boilerplate.Makefile.txt | 14 +++ hack/boilerplate/boilerplate.go.txt | 16 +++ hack/boilerplate/boilerplate.py.txt | 14 +++ hack/boilerplate/boilerplate.sh.txt | 14 +++ hack/verify-boilerplate.sh | 33 ++++++ hack/verify-yamllint.sh | 4 +- hack/verify.sh | 120 ++++++++++++++++++++ 9 files changed, 229 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 hack/boilerplate/boilerplate.Dockerfile.txt create mode 100644 hack/boilerplate/boilerplate.Makefile.txt create mode 100644 hack/boilerplate/boilerplate.go.txt create mode 100644 hack/boilerplate/boilerplate.py.txt create mode 100644 hack/boilerplate/boilerplate.sh.txt create mode 100755 hack/verify-boilerplate.sh create mode 100755 hack/verify.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..71bdf427117 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Verify scripts may leave programs in this directory +bin/ diff --git a/hack/boilerplate/boilerplate.Dockerfile.txt b/hack/boilerplate/boilerplate.Dockerfile.txt new file mode 100644 index 00000000000..384f325abf3 --- /dev/null +++ b/hack/boilerplate/boilerplate.Dockerfile.txt @@ -0,0 +1,14 @@ +# Copyright YEAR The Kubernetes 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. + diff --git a/hack/boilerplate/boilerplate.Makefile.txt b/hack/boilerplate/boilerplate.Makefile.txt new file mode 100644 index 00000000000..384f325abf3 --- /dev/null +++ b/hack/boilerplate/boilerplate.Makefile.txt @@ -0,0 +1,14 @@ +# Copyright YEAR The Kubernetes 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. + diff --git a/hack/boilerplate/boilerplate.go.txt b/hack/boilerplate/boilerplate.go.txt new file mode 100644 index 00000000000..59e740c1ee4 --- /dev/null +++ b/hack/boilerplate/boilerplate.go.txt @@ -0,0 +1,16 @@ +/* +Copyright YEAR The Kubernetes 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. +*/ + diff --git a/hack/boilerplate/boilerplate.py.txt b/hack/boilerplate/boilerplate.py.txt new file mode 100644 index 00000000000..384f325abf3 --- /dev/null +++ b/hack/boilerplate/boilerplate.py.txt @@ -0,0 +1,14 @@ +# Copyright YEAR The Kubernetes 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. + diff --git a/hack/boilerplate/boilerplate.sh.txt b/hack/boilerplate/boilerplate.sh.txt new file mode 100644 index 00000000000..384f325abf3 --- /dev/null +++ b/hack/boilerplate/boilerplate.sh.txt @@ -0,0 +1,14 @@ +# Copyright YEAR The Kubernetes 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. + diff --git a/hack/verify-boilerplate.sh b/hack/verify-boilerplate.sh new file mode 100755 index 00000000000..b99c2f74ffa --- /dev/null +++ b/hack/verify-boilerplate.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# Copyright 2021 The Kubernetes 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 -o errexit +set -o nounset +set -o pipefail + +VERSION=v0.2.0 +URL_BASE=https://raw.githubusercontent.com/kubernetes/repo-infra +URL=$URL_BASE/$VERSION/hack/verify_boilerplate.py +BIN_DIR=bin +SCRIPT=$BIN_DIR/verify_boilerplate.py + +if [[ ! -f $SCRIPT ]]; then + mkdir -p $BIN_DIR + curl -sfL $URL -o $SCRIPT + chmod +x $SCRIPT +fi + +$SCRIPT --boilerplate-dir hack/boilerplate diff --git a/hack/verify-yamllint.sh b/hack/verify-yamllint.sh index b6230b4c034..e18c636f69b 100755 --- a/hack/verify-yamllint.sh +++ b/hack/verify-yamllint.sh @@ -37,8 +37,8 @@ if [ $# != 0 ]; then fi if ! command -v yamllint >/dev/null 2>&1; then - echo >/dev/stderr "ERROR: yamllint not found - please install with: ${pip} install -r ${pip_requirements}" - exit 1 + echo "yamllint not found - installing with: ${pip} install -r ${pip_requirements}" + ${pip} install -r ${pip_requirements} fi version=$(yamllint --version | awk '{ print $2 }') diff --git a/hack/verify.sh b/hack/verify.sh new file mode 100755 index 00000000000..b8a43f0602a --- /dev/null +++ b/hack/verify.sh @@ -0,0 +1,120 @@ +#!/usr/bin/env bash + +# Copyright 2021 The Kubernetes 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 -o errexit +set -o nounset +set -o pipefail + +KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. + +# Some useful colors. +if [[ -z "${color_start-}" ]]; then + declare -r color_start="\033[" + declare -r color_red="${color_start}0;31m" + declare -r color_yellow="${color_start}0;33m" + declare -r color_green="${color_start}0;32m" + declare -r color_norm="${color_start}0m" +fi + +# Excluded check patterns are always skipped. +EXCLUDED_PATTERNS=( + "verify-*-dockerized.sh" # Don't run any scripts that intended to be run dockerized + ) + +EXCLUDED_CHECKS=$(ls ${EXCLUDED_PATTERNS[@]/#/${KUBE_ROOT}\/hack\/} 2>/dev/null || true) + +function is-excluded { + for e in ${EXCLUDED_CHECKS[@]}; do + if [[ $1 -ef "$e" ]]; then + return + fi + done + return 1 +} + +function run-cmd { + if ${SILENT}; then + "$@" &> /dev/null + else + "$@" + fi +} + +# Collect Failed tests in this Array , initialize it to nil +FAILED_TESTS=() + +function print-failed-tests { + echo -e "========================" + echo -e "${color_red}FAILED TESTS${color_norm}" + echo -e "========================" + for t in ${FAILED_TESTS[@]}; do + echo -e "${color_red}${t}${color_norm}" + done +} + +function run-checks { + local -r pattern=$1 + local -r runner=$2 + + local t + for t in $(ls ${pattern}) + do + local check_name="$(basename "${t}")" + if is-excluded "${t}" ; then + echo "Skipping ${check_name}" + continue + fi + echo -e "Verifying ${check_name}" + local start=$(date +%s) + run-cmd "${runner}" "${t}" && tr=$? || tr=$? + local elapsed=$(($(date +%s) - ${start})) + if [[ ${tr} -eq 0 ]]; then + echo -e "${color_green}SUCCESS${color_norm} ${check_name}\t${elapsed}s" + else + echo -e "${color_red}FAILED${color_norm} ${check_name}\t${elapsed}s" + ret=1 + FAILED_TESTS+=(${t}) + fi + done +} + +SILENT=false + +while getopts ":s" opt; do + case ${opt} in + s) + SILENT=true + ;; + \?) + echo "Invalid flag: -${OPTARG}" >&2 + exit 1 + ;; + esac +done + +if ${SILENT} ; then + echo "Running in silent mode, run without -s if you want to see script logs." +fi + +ret=0 +run-checks "${KUBE_ROOT}/hack/verify-*.sh" bash + +if [[ ${ret} -eq 1 ]]; then + print-failed-tests +fi +exit ${ret} + +# ex: ts=2 sw=2 et filetype=sh From 414f44755c4f0450a8aacaaf8923dd70b764ef64 Mon Sep 17 00:00:00 2001 From: Nikhita Raghunath Date: Sun, 7 Mar 2021 21:17:32 +0530 Subject: [PATCH 2/2] Fix boilerplate headers --- artifactserver/cmd/artifactserver/main.go | 16 ++++++++++++++++ artifactserver/tools/get_workspace_status.sh | 2 ++ audit/audit-gcp.sh | 16 +++++++++++++++- dns/check-zone.py | 1 + dns/check-zone.sh | 2 +- dns/push.sh | 1 + infra/gcp/backup_tools/backup_lib.sh | 2 +- infra/gcp/backup_tools/backup_prod.sh | 2 +- infra/gcp/backup_tools/backup_test.sh | 2 +- infra/gcp/cip-auditor/deploy.sh | 2 +- infra/gcp/ensure-conformance-storage.sh | 2 +- infra/gcp/ensure-env-cip-auditor.sh | 2 +- infra/gcp/ensure-gsuite.sh | 2 +- infra/gcp/ensure-main-project.sh | 2 +- infra/gcp/ensure-organization.sh | 2 +- infra/gcp/ensure-prod-storage-gclb.sh | 2 +- infra/gcp/ensure-prod-storage.sh | 2 +- infra/gcp/ensure-release-projects.sh | 2 +- infra/gcp/ensure-releng.sh | 2 +- infra/gcp/ensure-staging-storage.sh | 2 +- infra/gcp/ensure-static-ips.sh | 2 +- infra/gcp/lib.sh | 2 +- infra/gcp/lib_gcr.sh | 2 +- infra/gcp/lib_gcs.sh | 2 +- infra/gcp/lib_iam.sh | 2 +- infra/gcp/lib_util.sh | 2 +- infra/gcp/namespaces/ensure-namespaces.sh | 2 +- infra/gcp/prow/ensure-e2e-projects.sh | 2 +- infra/gcp/roles/generate-role-yaml.sh | 2 +- .../k8s-staging-csi-secrets-store/generate.sh | 16 +++++++++++++++- .../images/k8s-staging-sig-storage/generate.sh | 16 +++++++++++++++- k8s.io/Makefile | 14 ++++++++++++++ k8s.io/canary.sh | 14 ++++++++++++++ k8s.io/test.py | 14 ++++++++++++++ 34 files changed, 131 insertions(+), 27 deletions(-) diff --git a/artifactserver/cmd/artifactserver/main.go b/artifactserver/cmd/artifactserver/main.go index 32dafdeaded..9ecc65d7bb6 100644 --- a/artifactserver/cmd/artifactserver/main.go +++ b/artifactserver/cmd/artifactserver/main.go @@ -1,3 +1,19 @@ +/* +Copyright 2021 The Kubernetes 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/artifactserver/tools/get_workspace_status.sh b/artifactserver/tools/get_workspace_status.sh index 7e38934f645..cf408fa857c 100755 --- a/artifactserver/tools/get_workspace_status.sh +++ b/artifactserver/tools/get_workspace_status.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash + # Copyright 2018 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,6 +13,7 @@ # 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 script will be run bazel when building process starts to # generate key-value information that represents the status of the # workspace. The output should be like diff --git a/audit/audit-gcp.sh b/audit/audit-gcp.sh index 8c7efb7e348..c0899a5672f 100755 --- a/audit/audit-gcp.sh +++ b/audit/audit-gcp.sh @@ -1,4 +1,18 @@ -#!/bin/bash +#!/usr/bin/env bash + +# Copyright 2018 The Kubernetes 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 -o errexit set -o nounset diff --git a/dns/check-zone.py b/dns/check-zone.py index 17eeed25ecd..2e6b8e3e468 100755 --- a/dns/check-zone.py +++ b/dns/check-zone.py @@ -13,6 +13,7 @@ # 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. + ''' Octo-DNS Reporter / exit non-zero on failure ''' diff --git a/dns/check-zone.sh b/dns/check-zone.sh index a6f7bc3a20c..28a9dceadd4 100755 --- a/dns/check-zone.sh +++ b/dns/check-zone.sh @@ -13,7 +13,7 @@ # 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 runs as you. It assumes you have built an image named ${USER}/octodns. # It also requires working gcloud credentials # diff --git a/dns/push.sh b/dns/push.sh index 4ff79eae31f..ccd9f242515 100755 --- a/dns/push.sh +++ b/dns/push.sh @@ -13,6 +13,7 @@ # 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 runs as you. It assumes you have built an image named ${USER}/octodns. SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}") diff --git a/infra/gcp/backup_tools/backup_lib.sh b/infra/gcp/backup_tools/backup_lib.sh index 80db538f632..43b5f50da61 100755 --- a/infra/gcp/backup_tools/backup_lib.sh +++ b/infra/gcp/backup_tools/backup_lib.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/backup_tools/backup_prod.sh b/infra/gcp/backup_tools/backup_prod.sh index 70417b8bf84..b3a7cbe566f 100755 --- a/infra/gcp/backup_tools/backup_prod.sh +++ b/infra/gcp/backup_tools/backup_prod.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/backup_tools/backup_test.sh b/infra/gcp/backup_tools/backup_test.sh index 3c8df3b0c37..4b796e8dda5 100755 --- a/infra/gcp/backup_tools/backup_test.sh +++ b/infra/gcp/backup_tools/backup_test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/cip-auditor/deploy.sh b/infra/gcp/cip-auditor/deploy.sh index bc49ec47d1d..94d46e761eb 100755 --- a/infra/gcp/cip-auditor/deploy.sh +++ b/infra/gcp/cip-auditor/deploy.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2020 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/ensure-conformance-storage.sh b/infra/gcp/ensure-conformance-storage.sh index ec06e389709..ce8c4be7ef4 100755 --- a/infra/gcp/ensure-conformance-storage.sh +++ b/infra/gcp/ensure-conformance-storage.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/ensure-env-cip-auditor.sh b/infra/gcp/ensure-env-cip-auditor.sh index 2cd2debf5c2..a0090c47bf2 100755 --- a/infra/gcp/ensure-env-cip-auditor.sh +++ b/infra/gcp/ensure-env-cip-auditor.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2020 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/ensure-gsuite.sh b/infra/gcp/ensure-gsuite.sh index 9b175f87949..2339f0c7899 100755 --- a/infra/gcp/ensure-gsuite.sh +++ b/infra/gcp/ensure-gsuite.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/ensure-main-project.sh b/infra/gcp/ensure-main-project.sh index 7cb20544dfd..253155cae0f 100755 --- a/infra/gcp/ensure-main-project.sh +++ b/infra/gcp/ensure-main-project.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/ensure-organization.sh b/infra/gcp/ensure-organization.sh index 2f628ce3dd6..8d1c2248c72 100755 --- a/infra/gcp/ensure-organization.sh +++ b/infra/gcp/ensure-organization.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/ensure-prod-storage-gclb.sh b/infra/gcp/ensure-prod-storage-gclb.sh index c7a560f9168..759f257eac9 100755 --- a/infra/gcp/ensure-prod-storage-gclb.sh +++ b/infra/gcp/ensure-prod-storage-gclb.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/ensure-prod-storage.sh b/infra/gcp/ensure-prod-storage.sh index f7e3b5af39c..ea7bde4bcb3 100755 --- a/infra/gcp/ensure-prod-storage.sh +++ b/infra/gcp/ensure-prod-storage.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/ensure-release-projects.sh b/infra/gcp/ensure-release-projects.sh index f7613b68111..c56dbbf445f 100755 --- a/infra/gcp/ensure-release-projects.sh +++ b/infra/gcp/ensure-release-projects.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/ensure-releng.sh b/infra/gcp/ensure-releng.sh index a4969ffc14a..d60efc3addc 100755 --- a/infra/gcp/ensure-releng.sh +++ b/infra/gcp/ensure-releng.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/ensure-staging-storage.sh b/infra/gcp/ensure-staging-storage.sh index 57074913951..80846546e9a 100755 --- a/infra/gcp/ensure-staging-storage.sh +++ b/infra/gcp/ensure-staging-storage.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/ensure-static-ips.sh b/infra/gcp/ensure-static-ips.sh index 5b7db7f1e3f..b3168b8a33f 100755 --- a/infra/gcp/ensure-static-ips.sh +++ b/infra/gcp/ensure-static-ips.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2020 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/lib.sh b/infra/gcp/lib.sh index fd5c200f0d3..d4f5dcb5a1c 100755 --- a/infra/gcp/lib.sh +++ b/infra/gcp/lib.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/lib_gcr.sh b/infra/gcp/lib_gcr.sh index 1d6f425627e..a0b435d6618 100755 --- a/infra/gcp/lib_gcr.sh +++ b/infra/gcp/lib_gcr.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2020 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/lib_gcs.sh b/infra/gcp/lib_gcs.sh index 54eb5ba460f..57744285fb7 100755 --- a/infra/gcp/lib_gcs.sh +++ b/infra/gcp/lib_gcs.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2020 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/lib_iam.sh b/infra/gcp/lib_iam.sh index 5e2c72d48df..88bb894bd32 100755 --- a/infra/gcp/lib_iam.sh +++ b/infra/gcp/lib_iam.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2021 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/lib_util.sh b/infra/gcp/lib_util.sh index 6c90d46ebd4..c5049fb0472 100755 --- a/infra/gcp/lib_util.sh +++ b/infra/gcp/lib_util.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2020 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/namespaces/ensure-namespaces.sh b/infra/gcp/namespaces/ensure-namespaces.sh index e3588cfc49c..cb1b9820442 100755 --- a/infra/gcp/namespaces/ensure-namespaces.sh +++ b/infra/gcp/namespaces/ensure-namespaces.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/prow/ensure-e2e-projects.sh b/infra/gcp/prow/ensure-e2e-projects.sh index 32b2c596914..b58ea2d77fb 100755 --- a/infra/gcp/prow/ensure-e2e-projects.sh +++ b/infra/gcp/prow/ensure-e2e-projects.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/infra/gcp/roles/generate-role-yaml.sh b/infra/gcp/roles/generate-role-yaml.sh index a47802e4033..3f524849cd1 100755 --- a/infra/gcp/roles/generate-role-yaml.sh +++ b/infra/gcp/roles/generate-role-yaml.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# + # Copyright 2021 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/k8s.gcr.io/images/k8s-staging-csi-secrets-store/generate.sh b/k8s.gcr.io/images/k8s-staging-csi-secrets-store/generate.sh index 2819455e3d1..b95c42495da 100755 --- a/k8s.gcr.io/images/k8s-staging-csi-secrets-store/generate.sh +++ b/k8s.gcr.io/images/k8s-staging-csi-secrets-store/generate.sh @@ -1,4 +1,18 @@ -#! /bin/sh +#!/usr/bin/env bash + +# Copyright 2021 The Kubernetes 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=" driver diff --git a/k8s.gcr.io/images/k8s-staging-sig-storage/generate.sh b/k8s.gcr.io/images/k8s-staging-sig-storage/generate.sh index 7791f308303..89fc4f2759d 100755 --- a/k8s.gcr.io/images/k8s-staging-sig-storage/generate.sh +++ b/k8s.gcr.io/images/k8s-staging-sig-storage/generate.sh @@ -1,4 +1,18 @@ -#! /bin/sh +#!/usr/bin/env bash + +# Copyright 2021 The Kubernetes 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. # List of repos under https://console.cloud.google.com/gcr/images/k8s-staging-sig-storage/GLOBAL repos=" diff --git a/k8s.io/Makefile b/k8s.io/Makefile index a5d4ca85dd0..a2a1672e550 100644 --- a/k8s.io/Makefile +++ b/k8s.io/Makefile @@ -1,3 +1,17 @@ +# Copyright 2021 The Kubernetes 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. + all: test .PHONY: test diff --git a/k8s.io/canary.sh b/k8s.io/canary.sh index 3952f7cb390..7002b7adcc3 100755 --- a/k8s.io/canary.sh +++ b/k8s.io/canary.sh @@ -1,5 +1,19 @@ #!/usr/bin/env bash +# Copyright 2021 The Kubernetes 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 -o errexit set -o nounset set -o pipefail diff --git a/k8s.io/test.py b/k8s.io/test.py index 5ace2cdac2b..3cbb3fb691a 100755 --- a/k8s.io/test.py +++ b/k8s.io/test.py @@ -1,5 +1,19 @@ #!/usr/bin/env python3 +# Copyright 2021 The Kubernetes 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. + try: import HTMLParser import httplib