Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podman fixes for v0.6.2 #511

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions hack/quickstart-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ if [ -z $MGC_REF ]; then
MGC_REF=${MGC_REF:="main"}
fi

if [ -z $ISTIO_INSTALL_SAIL]; then
if [ -z "$ISTIO_INSTALL_SAIL" ]; then
ISTIO_INSTALL_SAIL=${ISTIO_INSTALL_SAIL:=false}
fi

echo "Loading quickstart scripts from GitHub"
source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/${KUADRANT_ORG}/multicluster-gateway-controller/${MGC_REF}/hack/.quickstartEnv)"
source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/${KUADRANT_ORG}/multicluster-gateway-controller/${MGC_REF}/hack/.deployUtils)"
if [ -n "$MGC_LOCAL_QUICKSTART_SCRIPTS_MODE" ]; then
echo "Loading quickstart scripts locally"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
source "${SCRIPT_DIR}/../../multicluster-gateway-controller/hack/.quickstartEnv"
source "${SCRIPT_DIR}/../../multicluster-gateway-controller/hack/.deployUtils"
else
echo "Loading quickstart scripts from GitHub"
source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/${KUADRANT_ORG}/multicluster-gateway-controller/${MGC_REF}/hack/.quickstartEnv)"
source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/${KUADRANT_ORG}/multicluster-gateway-controller/${MGC_REF}/hack/.deployUtils)"
fi

YQ_BIN=$(dockerBinCmd "yq")

Expand Down Expand Up @@ -111,7 +118,15 @@ ${KUSTOMIZE_BIN} build ${KUADRANT_METALLB_KUSTOMIZATION} | kubectl apply -f -
echo "Waiting for metallb-system deployments to be ready"
kubectl -n metallb-system wait --for=condition=Available deployments controller --timeout=300s
kubectl -n metallb-system wait --for=condition=ready pod --selector=app=metallb --timeout=60s
kubectl apply -n metallb-system -f - <<< "$(curl -s ${KUADRANT_REPO_RAW}/utils/docker-network-ipaddresspool.sh | bash -s -- kind)"

if [ -n "$MGC_LOCAL_QUICKSTART_SCRIPTS_MODE" ]; then
echo "Loading docker-network-ipaddresspool.sh script locally"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
kubectl apply -n metallb-system -f - <<< "$(bash ${SCRIPT_DIR}/../utils/docker-network-ipaddresspool.sh kind)"
else
echo "Loading docker-network-ipaddresspool.sh script from GitHub"
kubectl apply -n metallb-system -f - <<< "$(curl -s ${KUADRANT_REPO_RAW}/utils/docker-network-ipaddresspool.sh | bash -s -- kind)"
fi

# Install kuadrant
echo "Installing Kuadrant in ${KUADRANT_CLUSTER_NAME}"
Expand Down
15 changes: 13 additions & 2 deletions utils/docker-network-ipaddresspool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,21 @@ set -euo pipefail

networkName=$1

subnet=`docker network inspect $networkName -f '{{ (index .IPAM.Config 0).Subnet }}'`
subnet=""
if command -v podman &> /dev/null; then
subnet=`podman network inspect -f '{{range .Subnets}}{{if eq (len .Subnet.IP) 4}}{{.Subnet}}{{end}}{{end}}' kind`
elif command -v docker &> /dev/null; then
subnet=`docker network inspect $networkName -f '{{ (index .IPAM.Config 0).Subnet }}'`
fi

if [[ -z "$subnet" ]]; then
echo "Error: parsing IPv4 network address for '$networkName' docker network"
exit 1
fi

# shellcheck disable=SC2206
subnetParts=(${subnet//./ })
cidr="${subnetParts[0]}.${subnetParts[1]}.200.0/24"
cidr="${subnetParts[0]}.${subnetParts[1]}.0.252/30"

cat <<EOF
apiVersion: metallb.io/v1beta1
Expand Down
Loading