mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-27 08:40:23 +00:00
ci: add a way to supply CONTAINER_CMD of choice
Add a way to supply local CONTAINER_CMD option of choice via env variable to minikube.sh Note: we still use docker daemon env at minikube box, in the future we can switch to podman service env '# minikube podman-env' if needed Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
parent
54aed7f899
commit
ce0b3b4f88
@ -18,14 +18,15 @@ function wait_for_ssh() {
|
|||||||
function copy_image_to_cluster() {
|
function copy_image_to_cluster() {
|
||||||
local build_image=$1
|
local build_image=$1
|
||||||
local final_image=$2
|
local final_image=$2
|
||||||
if [ -z "$(docker images -q "${build_image}")" ]; then
|
validate_container_cmd
|
||||||
docker pull "${build_image}"
|
if [ -z "$(${CONTAINER_CMD} images -q "${build_image}")" ]; then
|
||||||
|
${CONTAINER_CMD} pull "${build_image}"
|
||||||
fi
|
fi
|
||||||
if [[ "${VM_DRIVER}" == "none" ]]; then
|
if [[ "${VM_DRIVER}" == "none" ]]; then
|
||||||
docker tag "${build_image}" "${final_image}"
|
${CONTAINER_CMD} tag "${build_image}" "${final_image}"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
docker save "${build_image}" | (eval "$(${minikube} docker-env --shell bash)" && docker load && docker tag "${build_image}" "${final_image}")
|
${CONTAINER_CMD} save "${build_image}" | (eval "$(${minikube} docker-env --shell bash)" && docker load && docker tag "${build_image}" "${final_image}")
|
||||||
}
|
}
|
||||||
|
|
||||||
# parse the minikube version, return the digit passed as argument
|
# parse the minikube version, return the digit passed as argument
|
||||||
@ -73,6 +74,18 @@ function install_kubectl() {
|
|||||||
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/"${KUBE_VERSION}"/bin/linux/"${MINIKUBE_ARCH}"/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/
|
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/"${KUBE_VERSION}"/bin/linux/"${MINIKUBE_ARCH}"/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function validate_container_cmd() {
|
||||||
|
if [[ "${CONTAINER_CMD}" == "docker" ]] || [[ "${CONTAINER_CMD}" == "podman" ]]; then
|
||||||
|
if ! command -v "${CONTAINER_CMD}" &> /dev/null; then
|
||||||
|
echo "'${CONTAINER_CMD}' not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "'CONTAINER_CMD' should be either docker or podman and not '${CONTAINER_CMD}'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function enable_psp() {
|
function enable_psp() {
|
||||||
echo "prepare minikube to support pod security policies"
|
echo "prepare minikube to support pod security policies"
|
||||||
mkdir -p "$HOME"/.minikube/files/etc/kubernetes/addons
|
mkdir -p "$HOME"/.minikube/files/etc/kubernetes/addons
|
||||||
@ -103,6 +116,7 @@ function minikube_losetup() {
|
|||||||
MINIKUBE_ARCH=${MINIKUBE_ARCH:-"amd64"}
|
MINIKUBE_ARCH=${MINIKUBE_ARCH:-"amd64"}
|
||||||
MINIKUBE_VERSION=${MINIKUBE_VERSION:-"latest"}
|
MINIKUBE_VERSION=${MINIKUBE_VERSION:-"latest"}
|
||||||
KUBE_VERSION=${KUBE_VERSION:-"v1.14.10"}
|
KUBE_VERSION=${KUBE_VERSION:-"v1.14.10"}
|
||||||
|
CONTAINER_CMD=${CONTAINER_CMD:-"docker"}
|
||||||
MEMORY=${MEMORY:-"4096"}
|
MEMORY=${MEMORY:-"4096"}
|
||||||
CPUS=${CPUS:-"$(nproc)"}
|
CPUS=${CPUS:-"$(nproc)"}
|
||||||
VM_DRIVER=${VM_DRIVER:-"virtualbox"}
|
VM_DRIVER=${VM_DRIVER:-"virtualbox"}
|
||||||
|
Loading…
Reference in New Issue
Block a user