mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 14:20:19 +00:00
deploy: remove the snapshot controller installation check
no need to have 1.17 kube version check anymore before we install snapshot controller. Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
parent
297b14ed54
commit
5aabd4e1d2
@ -84,30 +84,6 @@ function delete_snapshot_crd() {
|
|||||||
kubectl delete -f "${VOLUME_SNAPSHOT}" --ignore-not-found
|
kubectl delete -f "${VOLUME_SNAPSHOT}" --ignore-not-found
|
||||||
}
|
}
|
||||||
|
|
||||||
# parse the kubernetes version
|
|
||||||
# v1.17.2 -> kube_version 1 -> 1 (Major)
|
|
||||||
# v1.17.2 -> kube_version 2 -> 17 (Minor)
|
|
||||||
function kube_version() {
|
|
||||||
echo "${KUBE_VERSION}" | sed 's/^v//' | cut -d'.' -f"${1}"
|
|
||||||
}
|
|
||||||
|
|
||||||
if ! get_kube_version=$(kubectl version --short) ||
|
|
||||||
[[ -z "${get_kube_version}" ]]; then
|
|
||||||
echo "could not get Kubernetes server version"
|
|
||||||
echo "hint: check if you have specified the right host or port"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
KUBE_VERSION=$(echo "${get_kube_version}" | grep "^Server Version" | cut -d' ' -f3)
|
|
||||||
KUBE_MAJOR=$(kube_version 1)
|
|
||||||
KUBE_MINOR=$(kube_version 2)
|
|
||||||
|
|
||||||
# skip snapshot operation if kube version is less than 1.17.0
|
|
||||||
if [[ "${KUBE_MAJOR}" -lt 1 ]] || [[ "${KUBE_MAJOR}" -eq 1 && "${KUBE_MINOR}" -lt 17 ]]; then
|
|
||||||
echo "skipping: Kubernetes server version is < 1.17.0"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${1:-}" in
|
case "${1:-}" in
|
||||||
install)
|
install)
|
||||||
install_snapshot_controller "$2"
|
install_snapshot_controller "$2"
|
||||||
@ -115,13 +91,9 @@ install)
|
|||||||
cleanup)
|
cleanup)
|
||||||
cleanup_snapshot_controller "$2"
|
cleanup_snapshot_controller "$2"
|
||||||
;;
|
;;
|
||||||
delete-crd)
|
|
||||||
delete_snapshot_crd
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "usage:" >&2
|
echo "usage:" >&2
|
||||||
echo " $0 install" >&2
|
echo " $0 install" >&2
|
||||||
echo " $0 cleanup" >&2
|
echo " $0 cleanup" >&2
|
||||||
echo " $0 delete-crd" >&2
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user