File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
2+ function is_available {
3+ command -v $1 > /dev/null 2>&1 || { echo >&2 " $1 is required but it's not installed. Aborting." ; exit 1; }
4+ }
25
36if [ -z " $PATTERN_UTILITY_CONTAINER " ]; then
47 PATTERN_UTILITY_CONTAINER=" quay.io/hybridcloudpatterns/utility-container"
58fi
69
10+ readonly commands=(podman)
11+ for cmd in ${commands[@]} ; do is_available " $cmd " ; done
12+
713UNSUPPORTED_PODMAN_VERSIONS=" 1.6 1.5"
814for i in ${UNSUPPORTED_PODMAN_VERSIONS} ; do
915 # We add a space
2531# $HOME is mounted as itself for any files that are referenced with absolute paths
2632# $HOME is mounted to /root because the UID in the container is 0 and that's where SSH looks for credentials
2733
28- # Do not quote the ${KUBECONF_ENV} below, otherwise we will pass '' to podman
29- # which will be confused
34+ # We do not rely on bash's $UID and $GID because on MacOSX $GID is not set
35+ MYUID=$( id -u)
36+ MYGID=$( id -g)
3037podman run -it --rm --pull=newer \
3138 --security-opt label=disable \
39+ --user " ${MYUID} :${MYGID} " \
40+ --userns " keep-id:uid=${MYUID} ,gid=${MYGID} " \
3241 -e EXTRA_HELM_OPTS \
3342 -e KUBECONFIG \
3443 -v " ${HOME} " :" ${HOME} " \
3544 -v " ${HOME} " :/pattern-home \
36- -v " ${HOME} " :/root \
3745 -w " $( pwd) " \
3846 " $PATTERN_UTILITY_CONTAINER " \
3947 $@
You can’t perform that action at this time.
0 commit comments