From 52eacaa5775e0ac343754c1c5d22160a6b311523 Mon Sep 17 00:00:00 2001 From: Kevin Hannon Date: Sat, 15 Apr 2023 08:11:42 -0400 Subject: [PATCH] e2e: support kind clusters (#1103) --- Makefile.e2e | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.e2e b/Makefile.e2e index 5066c2370..a36fb46ad 100644 --- a/Makefile.e2e +++ b/Makefile.e2e @@ -1,7 +1,17 @@ + +# skaffold checks for kubectl context +# For minikube, docker-for-desktop and docker-desktop the context matches above names +# If one wants to use kind, kind gives context names based on the cluster-name +# But as of now they match the following syntax: kind-* +# The first check verifies that this is a kind kubernetes context +# Second check verifies the other ones .PHONY: skaffold.validate skaffold.validate: kubectl_context := $(shell kubectl config current-context) skaffold.validate: - @if [[ ! "minikube,docker-for-desktop,docker-desktop" =~ .*"$(kubectl_context)".* ]]; then \ + + @if [[ "$(kubectl_context)" =~ .*"kind".* ]]; then \ + true; \ + elif [[ ! "minikube,docker-for-desktop,docker-desktop" =~ .*"$(kubectl_context)".* ]]; then \ echo current-context is [$(kubectl_context)]. Must be one of [minikube,docker-for-desktop,docker-desktop]; \ false; \ fi