Fix prepare-environment-k3d target
@@ -29,13 +29,30 @@ function create_docker_pull_secret {
fi
}
+function prepare_system_domain {
+ if [[ -z "${EPINIO_SYSTEM_DOMAIN}" ]]; then
+ echo "EPINIO_SYSTEM_DOMAIN not set. Trying to use a magic domain..."
+ EPINIO_CLUSTER_IP=$(docker inspect k3d-epinio-acceptance-server-0 | jq -r '.[0]["NetworkSettings"]["Networks"]["epinio-acceptance"]["IPAddress"]')
+ if [[ -z $EPINIO_CLUSTER_IP ]]; then
+ echo "Couldn't find the cluster's IP address"
+ exit 1
+ fi
+
+ export EPINIO_SYSTEM_DOMAIN="${EPINIO_CLUSTER_IP}.omg.howdoi.website"
+ else
+ echo "Using ${EPINIO_SYSTEM_DOMAIN} for --system-domain"
+ fi
+}
+
+# Ensure we have a value for --system-domain
+prepare_system_domain
# Check Dependencies
check_dependency kubectl helm
# Create docker registry image pull secret
create_docker_pull_secret
# Install Epinio
-EPINIO_DONT_WAIT_FOR_DEPLOYMENT=1 "${EPINIO_BINARY}" install --skip-default-namespace
+EPINIO_DONT_WAIT_FOR_DEPLOYMENT=1 "${EPINIO_BINARY}" install --system-domain "${EPINIO_SYSTEM_DOMAIN}"
# Patch Epinio
./scripts/patch-epinio-deployment.sh
@@ -59,6 +76,4 @@ if [ ${retry} -ge ${maxRetries} ]; then
exit 1
fi
-# Create Namespace
-"${EPINIO_BINARY}" namespace create workspace
-"${EPINIO_BINARY}" target workspace
+echo "Done preparing k3d environment!"
