mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
add helper script to upgrade k8s
- added helper script from https://github.com/kubernetes/kubernetes/issues/79384#issuecomment-521493597 to scripts/upgrade-k8s.sh - removed bashisms from the script Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
This commit is contained in:
parent
210252d2e1
commit
f814591a3d
24
scripts/upgrade-k8s.sh
Executable file
24
scripts/upgrade-k8s.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/sh -eu
|
||||
|
||||
# based on the work discussed in
|
||||
# https://github.com/kubernetes/kubernetes/issues/79384#issuecomment-521493597
|
||||
|
||||
if [ $# != 1 ] || [ "$1" = "?" ] || [ "$1" = "--help" ]; then
|
||||
echo "Usage: $0 <k8s version>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION="$1"
|
||||
|
||||
for MOD in $(
|
||||
curl -sS https://raw.githubusercontent.com/kubernetes/kubernetes/v${VERSION}/go.mod |
|
||||
sed -n 's|.*k8s.io/\(.*\) => ./staging/src/k8s.io/.*|k8s.io/\1|p'
|
||||
); do
|
||||
echo "$MOD"
|
||||
V=$(
|
||||
go mod download -json "${MOD}@kubernetes-${VERSION}" |
|
||||
sed -n 's|.*"Version": "\(.*\)".*|\1|p'
|
||||
)
|
||||
go mod edit "-replace=${MOD}=${MOD}@${V}"
|
||||
done
|
||||
go get "k8s.io/kubernetes@v${VERSION}"
|
Loading…
Reference in New Issue
Block a user