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

Commit

Permalink
Merge pull request #795 from Kuadrant/podman-fixes
Browse files Browse the repository at this point in the history
Podman fixes
  • Loading branch information
david-martin authored Apr 10, 2024
2 parents f507107 + c2e00f6 commit c5563ad
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hack/.binEnv
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export HELM_BIN="${BIN_DIR}helm"
export YQ_BIN="${BIN_DIR}yq"
export OPERATOR_SDK_BIN="${BIN_DIR}operator-sdk"
export CLUSTERADM_BIN="${BIN_DIR}clusteradm"
export KFILT="docker run --rm -i ryane/kfilt"
export KFILT="$CONTAINER_RUNTIME_BIN run --rm -i ryane/kfilt"
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
3 changes: 2 additions & 1 deletion hack/.kindUtils
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ kindSetupMGCClusters() {
local dataPlaneClusterCount=$5

# Create network for the clusters
docker network create -d bridge --subnet 172.31.0.0/16 ${KIND_CLUSTER_DOCKER_NETWORK} --gateway 172.31.0.1 \
# TODO: podman equivs of these options?
$CONTAINER_RUNTIME_BIN network create -d bridge --subnet 172.31.0.0/16 ${KIND_CLUSTER_DOCKER_NETWORK} --gateway 172.31.0.1 \
-o "com.docker.network.bridge.enable_ip_masquerade"="true" \
-o "com.docker.network.driver.mtu"="1500"

Expand Down
23 changes: 20 additions & 3 deletions hack/.quickstartEnv
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
# 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

containerRuntime() {
local container_runtime=""
if command -v podman &> /dev/null; then
container_runtime="podman"
elif command -v docker &> /dev/null; then
container_runtime="docker"
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 c5563ad

Please sign in to comment.