Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
Podman fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmadigan committed Mar 25, 2024
1 parent f507107 commit 7297a4d
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
16 changes: 16 additions & 0 deletions hack/.binEnv
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BIN_DIR="${SCRIPT_DIR}/../bin/"

containerRuntime() {
local container_runtime=""

if command -v docker &> /dev/null; then
container_runtime="docker"
elif command -v podman &> /dev/null; then
container_runtime="podman"
else
echo "Neither Docker nor Podman is installed. Exiting..."
exit 1
fi
echo "$container_runtime"
}

export CONTAINER_RUNTIME_BIN=$(containerRuntime)

export KIND_BIN="${BIN_DIR}kind"
export KUSTOMIZE_BIN="${BIN_DIR}kustomize"
export HELM_BIN="${BIN_DIR}helm"
Expand Down
2 changes: 1 addition & 1 deletion hack/.cleanupUtils
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cleanClusters() {
cleanNetwork() {
# Delete the network
echo "Deleting mgc network"
docker network rm mgc || true
$CONTAINER_RUNTIME_BIN network rm mgc || true
}

cleanupKind() {
Expand Down
27 changes: 24 additions & 3 deletions hack/.quickstartEnv
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
# shellcheck shell=bash

export TOOLS_IMAGE=quay.io/kuadrant/mgc-tools:latest
export TMP_DIR=/tmp/mgc
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
export TMP_DIR=$SCRIPT_DIR/tmp/mgc

trap 'echo "Error on line $LINENO: $BASH_COMMAND"' ERR


containerRuntime() {
local container_runtime=""

if command -v docker &> /dev/null; then
container_runtime="docker"
elif command -v podman &> /dev/null; then
container_runtime="podman"
else
echo "Neither Docker nor Podman is installed. Exiting..."
exit 1
fi
echo "$container_runtime"
}

export CONTAINER_RUNTIME_BIN=$(containerRuntime)

dockerBinCmd() {
local network=""
if [ ! -z ${KIND_CLUSTER_DOCKER_NETWORK} ]; then
if [ ! -z "${KIND_CLUSTER_DOCKER_NETWORK}" ]; then
network=" --network ${KIND_CLUSTER_DOCKER_NETWORK}"
fi
echo "docker run --rm -u $UID -v ${TMP_DIR}:/tmp/mgc:z${network} -e KUBECONFIG=/tmp/mgc/kubeconfig --entrypoint=$1 $TOOLS_IMAGE"

echo "$CONTAINER_RUNTIME_BIN run --rm -u $UID -v ${TMP_DIR}:${TMP_DIR}${network} -e KUBECONFIG=${TMP_DIR}/kubeconfig --entrypoint=$1 $TOOLS_IMAGE"
}

export KIND_BIN=kind
Expand Down
2 changes: 1 addition & 1 deletion hack/quickstart-metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# limitations under the License.
#

export KFILT="docker run --rm -i ryane/kfilt"
export KFILT="$CONTAINER_RUNTIME_BIN run --rm -i ryane/kfilt"

METRICS_FEDERATION=true

Expand Down

0 comments on commit 7297a4d

Please sign in to comment.