-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change updates to the following: * Ubuntu 20.04 * Go 1.16.7 * Minikube 1.22.0 (running Kubernetes 1.15.12) * Skaffold 1.31.0 * Kubectl 1.15.12 In addition, it adds more documentation to the Kubernetes update script.
- Loading branch information
Showing
3 changed files
with
38 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/nats-io/nats-operator | ||
|
||
go 1.13 | ||
go 1.16 | ||
|
||
require ( | ||
cloud.google.com/go v0.47.0 // indirect | ||
|
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 |
---|---|---|
@@ -1,21 +1,47 @@ | ||
#!/bin/sh | ||
set -euo pipefail | ||
|
||
# Usage | ||
# In order to update k8s.io/kubernetes, we also have to update modules at | ||
# k8s.io/XXX. | ||
# | ||
# To update the Kubernetes dependencies, first look for a tag here: | ||
# https://github.com/kubernetes/kubernetes/releases | ||
# | ||
# Then, run this command: | ||
# ./update-kube-version.sh 1.22.1 | ||
# | ||
# This will update the go.mod file with the required sub-dependency versions | ||
# and only then update the kubernetes version. | ||
|
||
VERSION=${1#"v"} | ||
if [ -z "$VERSION" ]; then | ||
echo "Must specify version!" | ||
exit 1 | ||
fi | ||
echo "Specified version ${VERSION}" | ||
|
||
echo "Checking which modules need updating..." | ||
MODS=($( | ||
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' | ||
)) | ||
echo "Found ${#MODS[@]} modules" | ||
|
||
i=0 | ||
for MOD in "${MODS[@]}"; do | ||
V=$( | ||
go mod download -json "${MOD}@kubernetes-${VERSION}" | | ||
sed -n 's|.*"Version": "\(.*\)".*|\1|p' | ||
) | ||
go mod edit "-replace=${MOD}=${MOD}@${V}" | ||
|
||
i=$[i + 1] | ||
echo "Updated ${MOD} (${i}/${#MODS[@]})" | ||
done | ||
|
||
echo "Lastly, updating k8s.io/kubernetes..." | ||
go get "k8s.io/kubernetes@v${VERSION}" | ||
go mod tidy | ||
|
||
echo "Done!" |