forked from kubernetes-csi/external-provisioner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed 'release-tools/' changes from dc4d0ae20..adb3af9df
adb3af9df Merge pull request kubernetes-csi#252 from bells17/update-go-version b82ee3888 Merge pull request kubernetes-csi#253 from bells17/fix-typo c31745621 Fix typo 0a7850561 Bump to Go 1.22.3 edd89ad58 Merge pull request kubernetes-csi#251 from jsafrane/add-logcheck 043fd0991 Add test-logcheck target d7535ae0c Merge pull request kubernetes-csi#250 from jsafrane/go-1.22 b52e7ad35 Update go to 1.22.2 14fdb6f66 Merge pull request kubernetes-csi#247 from msau42/prow 9b4352e9f Update release playbook c7bb972cc Fix release notes script to use fixed tags 463a0e9f5 Add script to update specific go modules git-subtree-dir: release-tools git-subtree-split: adb3af9dfa3ed4d1a922cd839bb48e0b73918617
- Loading branch information
Showing
6 changed files
with
156 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2023 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. | ||
|
||
|
||
# Usage: go-modules-targeted-update.sh | ||
# | ||
# Batch update specific dependencies for sidecars. | ||
# | ||
# Required environment variables | ||
# CSI_RELEASE_TOKEN: Github token needed for generating release notes | ||
# GITHUB_USER: Github username to create PRs with | ||
# | ||
# Instructions: | ||
# 1. Login with "gh auth login" | ||
# 2. Copy this script to the Github org directory (one directory above the | ||
# repos) | ||
# 3. Change $modules, $releases and $org if needed. | ||
# 4. Set environment variables | ||
# 5. Run script from the Github org directory | ||
# | ||
# Caveats: | ||
# - This script doesn't handle interface incompatibility of updates. | ||
# You need to resolve interface incompatibility case by case. The | ||
# most frequent case is to update the interface(new parameters, | ||
# name change of the method, etc.)in the sidecar repo and make sure | ||
# the build and test pass. | ||
|
||
|
||
set -e | ||
set -x | ||
|
||
org="kubernetes-csi" | ||
|
||
modules=( | ||
"github.com/kubernetes-csi/[email protected]" | ||
) | ||
|
||
releases=( | ||
#"external-attacher release-4.4" | ||
#"external-provisioner release-3.6" | ||
#"external-resizer release-1.9" | ||
#"external-snapshotter release-6.3" | ||
#"node-driver-registrar release-2.9" | ||
) | ||
|
||
for rel in "${releases[@]}"; do | ||
|
||
read -r repo branch <<< "$rel" | ||
if [ "$repo" != "#" ]; then | ||
( | ||
cd "$repo" | ||
git fetch upstream | ||
|
||
if [ "$(git rev-parse --verify "module-update-$branch" 2>/dev/null)" ]; then | ||
git checkout master && git branch -D "module-update-$branch" | ||
fi | ||
git checkout -B "module-update-$branch" "upstream/$branch" | ||
|
||
for mod in "${modules[@]}"; do | ||
go get "$mod" | ||
done | ||
go mod tidy | ||
go mod vendor | ||
|
||
git add --all | ||
git commit -m "Update go modules" | ||
git push origin "module-update-$branch" --force | ||
|
||
# Create PR | ||
prbody=$(cat <<EOF | ||
Updated the following go modules: | ||
${modules[@]} | ||
\`\`\`release-note | ||
NONE | ||
\`\`\` | ||
EOF | ||
) | ||
gh pr create --title="[$branch] Update go modules" --body "$prbody" --head "$GITHUB_USER:module-update-$branch" --base "$branch" --repo="$org/$repo" | ||
) | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2024 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. | ||
|
||
# This script uses the logcheck tool to analyze the source code | ||
# for proper usage of klog contextual logging. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
LOGCHECK_VERSION=${1:-0.8.2} | ||
|
||
# This will canonicalize the path | ||
CSI_LIB_UTIL_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd -P) | ||
|
||
# Create a temporary directory for installing logcheck and | ||
# set up a trap command to remove it when the script exits. | ||
CSI_LIB_UTIL_TEMP=$(mktemp -d 2>/dev/null || mktemp -d -t csi-lib-utils.XXXXXX) | ||
trap 'rm -rf "${CSI_LIB_UTIL_TEMP}"' EXIT | ||
|
||
echo "Installing logcheck to temp dir: sigs.k8s.io/logtools/logcheck@v${LOGCHECK_VERSION}" | ||
GOBIN="${CSI_LIB_UTIL_TEMP}" go install "sigs.k8s.io/logtools/logcheck@v${LOGCHECK_VERSION}" | ||
echo "Verifying logcheck: ${CSI_LIB_UTIL_TEMP}/logcheck -check-contextual ${CSI_LIB_UTIL_ROOT}/..." | ||
"${CSI_LIB_UTIL_TEMP}/logcheck" -check-contextual -check-with-helpers "${CSI_LIB_UTIL_ROOT}/..." |