diff --git a/Makefile b/Makefile index 56a70044a5..00c635da4b 100644 --- a/Makefile +++ b/Makefile @@ -286,6 +286,7 @@ update/shfmt: bin/shfmt ./bin/shfmt -w -i 2 -d ./hack/ .PHONY: update/generate-license-header + update/generate-license-header: ./hack/generate-license-header.sh diff --git a/README.md b/README.md index e5c07e1c6d..4c8a9fe3d4 100644 --- a/README.md +++ b/README.md @@ -58,3 +58,5 @@ The EBS CSI Driver implements the [Container Storage Interface specification](ht * [Kubernetes Examples](/examples/kubernetes) * [Driver Uninstallation](docs/install.md#uninstalling-the-ebs-csi-driver) * [Development and Contributing](CONTRIBUTING.md) + + diff --git a/hack/generate-license-header.sh b/hack/generate-license-header.sh index cb759f1bee..a0ea8491c4 100755 --- a/hack/generate-license-header.sh +++ b/hack/generate-license-header.sh @@ -18,7 +18,7 @@ set -euo pipefail echo "Adding license header..." -current_year=$(date +%Y) +#current_year=$(date +%Y) # Carry: do not add license to files in vendor/ directory find . -type d \( -name "deploy" -o -name "charts" -o -name "vendor" \) -prune -o -type f \( -name "*.go" -o -name "*.sh" -o -name "*.yaml" -o -name "*.yml" \) -print | while read -r file; do case "$file" in @@ -30,6 +30,6 @@ find . -type d \( -name "deploy" -o -name "charts" -o -name "vendor" \) -prune - ;; esac if ! grep -q "The Kubernetes Authors." "$file"; then - echo -e "${comment_prefix} Copyright ${current_year} The Kubernetes Authors.\n${comment_prefix}\n${comment_prefix} Licensed under the Apache License, Version 2.0 (the 'License');\n${comment_prefix} you may not use this file except in compliance with the License.\n${comment_prefix} You may obtain a copy of the License at\n${comment_prefix}\n${comment_prefix} http://www.apache.org/licenses/LICENSE-2.0\n${comment_prefix}\n${comment_prefix} Unless required by applicable law or agreed to in writing, software\n${comment_prefix} distributed under the License is distributed on an 'AS IS' BASIS,\n${comment_prefix} WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n${comment_prefix} See the License for the specific language governing permissions and\n${comment_prefix} limitations under the License.\n" | cat - "$file" >temp && mv temp "$file" + echo -e "${comment_prefix} Copyright 2024 The Kubernetes Authors.\n${comment_prefix}\n${comment_prefix} Licensed under the Apache License, Version 2.0 (the 'License');\n${comment_prefix} you may not use this file except in compliance with the License.\n${comment_prefix} You may obtain a copy of the License at\n${comment_prefix}\n${comment_prefix} http://www.apache.org/licenses/LICENSE-2.0\n${comment_prefix}\n${comment_prefix} Unless required by applicable law or agreed to in writing, software\n${comment_prefix} distributed under the License is distributed on an 'AS IS' BASIS,\n${comment_prefix} WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n${comment_prefix} See the License for the specific language governing permissions and\n${comment_prefix} limitations under the License.\n" | cat - "$file" >temp && mv temp "$file" fi done