Skip to content

Commit

Permalink
build: enable e2e testing for podman
Browse files Browse the repository at this point in the history
As per [0] kind `load docker-image` commands are docker specific.
This commit changes that instruction, using the generic
`load image-archive` instead, which works both for podman and docker.

[0] - kubernetes-sigs/kind#2027

Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com>
  • Loading branch information
maiqueb committed Oct 6, 2021
1 parent 12fc24d commit 2eb3da6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions hack/e2e-setup-kind-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ TIMEOUT=300
TIMEOUT_K8="${TIMEOUT}s"
KIND_CLUSTER_NAME="whereabouts"
OCI_BIN="${OCI_BIN:-"docker"}"
IMG_PROJECT="whereabouts"
IMG_REGISTRY="ghcr.io/k8snetworkplumbingwg"
IMG_TAG="latest-amd64"
IMG_NAME="$IMG_REGISTRY/$IMG_PROJECT:$IMG_TAG"

create_cluster() {
workers="$(for i in $(seq $NUMBER_OF_COMPUTE_NODES); do echo " - role: worker"; done)"
Expand Down Expand Up @@ -85,10 +89,14 @@ retry kubectl create -f "${CNIS_DAEMONSET_URL}"
retry kubectl -n kube-system wait --for=condition=ready -l name="cni-plugins" pod --timeout=$TIMEOUT_K8
echo "## build whereabouts"
pushd "$ROOT"
$OCI_BIN build . -t ghcr.io/k8snetworkplumbingwg/whereabouts:latest-amd64
$OCI_BIN build . -t "$IMG_NAME"
popd

echo "## load image into KinD"
kind load docker-image --name "$KIND_CLUSTER_NAME" ghcr.io/k8snetworkplumbingwg/whereabouts:latest-amd64
trap "rm /tmp/whereabouts-img.tar || true" EXIT
"$OCI_BIN" save -o /tmp/whereabouts-img.tar "$IMG_NAME"
kind load image-archive --name "$KIND_CLUSTER_NAME" /tmp/whereabouts-img.tar

echo "## install whereabouts"
for file in "daemonset-install.yaml" "ip-reconciler-job.yaml" "whereabouts.cni.cncf.io_ippools.yaml" "whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml"; do
retry kubectl apply -f "$ROOT/doc/crds/$file"
Expand Down

0 comments on commit 2eb3da6

Please sign in to comment.