You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

upgrade-k8s.sh 1.3 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/sh
  2. # Copyright 2021 The KubeEdge Authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. set -o errexit
  16. set -o nounset
  17. set -o pipefail
  18. SEDNA_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
  19. version=v${1#"v"}
  20. if [ -z "$version" ]; then
  21. echo "Must specify the Kubernetes version!"
  22. exit 1
  23. fi
  24. go mod edit "-require=k8s.io/kubernetes@$version"
  25. bash "$SEDNA_ROOT/hack/fix-k8s-import.sh" $version
  26. script_and_directories=$(cat <<EOF
  27. hack/update-vendor.sh vendor go.mod go.sum
  28. hack/update-vendor-licenses.sh LICENSES
  29. hack/update-codegen.sh pkg/apis pkg/client
  30. EOF
  31. )
  32. while read run_script directories; do
  33. if [ -f "$run_script" ]; then
  34. bash "$SEDNA_ROOT/$run_script"
  35. git add $directories
  36. fi
  37. done < <(echo "$script_and_directories")
  38. make crds
  39. git add build/crds