From a94924a02fd4f2baf9240e1feab003122d865765 Mon Sep 17 00:00:00 2001 From: justinsb Date: Tue, 18 Jul 2023 13:59:27 -0400 Subject: [PATCH 1/2] verify-boilerplate: stricter error checking If python isn't found, without this fix the script exits with code 0, despite not checking boilerplate. --- hack/verify-boilerplate.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hack/verify-boilerplate.sh b/hack/verify-boilerplate.sh index 3a5c6bf5b18af..ff7ee85dc8dfa 100755 --- a/hack/verify-boilerplate.sh +++ b/hack/verify-boilerplate.sh @@ -14,6 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -o errexit +set -o nounset +set -o pipefail + . "$(dirname "${BASH_SOURCE[0]}")/common.sh" files_need_boilerplate=() From b494ad9a8b7f7aeb371a79178bbb84f6f52ca68c Mon Sep 17 00:00:00 2001 From: justinsb Date: Tue, 18 Jul 2023 14:07:50 -0400 Subject: [PATCH 2/2] helper scripts: update to use python3 This addresses the underlying reason why boilerplate was not being checked. --- hack/__init__.py | 2 +- hack/boilerplate/boilerplate.py | 2 +- hack/boilerplate/boilerplate.py.txt | 2 +- hack/mkdocs_macros/__init__.py | 2 +- hack/mkdocs_macros/feature_stability_table.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hack/__init__.py b/hack/__init__.py index d390cde65cc04..e00530717a732 100644 --- a/hack/__init__.py +++ b/hack/__init__.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2020 The Kubernetes Authors. # diff --git a/hack/boilerplate/boilerplate.py b/hack/boilerplate/boilerplate.py index 946fa05687550..a1dd7ec6b0811 100755 --- a/hack/boilerplate/boilerplate.py +++ b/hack/boilerplate/boilerplate.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2015 The Kubernetes Authors. # diff --git a/hack/boilerplate/boilerplate.py.txt b/hack/boilerplate/boilerplate.py.txt index a2e72e5988e73..9fdb989ce7c5b 100644 --- a/hack/boilerplate/boilerplate.py.txt +++ b/hack/boilerplate/boilerplate.py.txt @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright YEAR The Kubernetes Authors. # diff --git a/hack/mkdocs_macros/__init__.py b/hack/mkdocs_macros/__init__.py index 6bf03edf49b9e..07cf403f59564 100644 --- a/hack/mkdocs_macros/__init__.py +++ b/hack/mkdocs_macros/__init__.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2020 The Kubernetes Authors. # diff --git a/hack/mkdocs_macros/feature_stability_table.py b/hack/mkdocs_macros/feature_stability_table.py index 3eb5750eb869a..577ed148a2786 100644 --- a/hack/mkdocs_macros/feature_stability_table.py +++ b/hack/mkdocs_macros/feature_stability_table.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2020 The Kubernetes Authors. #