From bdf00f8daad7d8878bef9b6dca0704142c20d59b Mon Sep 17 00:00:00 2001 From: "michal.gubricky" Date: Tue, 20 Feb 2024 16:04:04 +0100 Subject: [PATCH 1/2] Remove unnecessary env variables in make target env-vars-for-wl-cluster Based on the introduction of local_mode feature(see issue #76). Some env variables are not needed when we are using local_mode. This commit adjust .envrc.sample and also remove these unnecessary env variables in make target env-vars-for-wl-cluster. Signed-off-by: michal.gubricky --- .envrc.sample | 13 +++++-------- Makefile | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.envrc.sample b/.envrc.sample index 8e66c3aa..eb1f5217 100644 --- a/.envrc.sample +++ b/.envrc.sample @@ -1,14 +1,11 @@ export KUBECONFIG=$PWD/.mgt-cluster-kubeconfig.yaml -export GIT_PROVIDER_B64=Z2l0aHVi -export GIT_ACCESS_TOKEN_B64=mybase64encodedtoken -export GIT_ORG_NAME_B64=U292ZXJlaWduQ2xvdWRTdGFjaw== -export GIT_REPOSITORY_NAME_B64=Y2x1c3Rlci1zdGFja3M= -export EXP_CLUSTER_RESOURCE_SET=true -export EXP_MACHINE_POOL=true export CLUSTER_TOPOLOGY=true -export EXP_RUNTIME_SDK=true -export EXP_MACHINE_SET_PREFLIGHT_CHECKS=true export CLUSTER_NAME=test-dfkhje export SECRET_NAME=supersecret export CLOUD_NAME=test export ENCODED_CLOUDS_YAML=mybase64encodedcloudsyamlfile +## These env variables are not needed when local_mode is enabled +# export GIT_PROVIDER_B64=Z2l0aHVi +# export GIT_ACCESS_TOKEN_B64=mybase64encodedtoken +# export GIT_ORG_NAME_B64=U292ZXJlaWduQ2xvdWRTdGFjaw== +# export GIT_REPOSITORY_NAME_B64=Y2x1c3Rlci1zdGFja3M= diff --git a/Makefile b/Makefile index a83cf263..fb0d345c 100644 --- a/Makefile +++ b/Makefile @@ -160,7 +160,7 @@ all-tools: $(GOTESTSUM) $(go-cover-treemap) $(go-binsize-treemap) $(KIND) $(PACK ##@ Development env-vars-for-wl-cluster: - @./hack/ensure-env-variables.sh GIT_PROVIDER_B64 GIT_ACCESS_TOKEN_B64 GIT_ORG_NAME_B64 GIT_REPOSITORY_NAME_B64 EXP_CLUSTER_RESOURCE_SET CLUSTER_TOPOLOGY CLUSTER_NAME SECRET_NAME CLOUD_NAME ENCODED_CLOUDS_YAML + @./hack/ensure-env-variables.sh CLUSTER_TOPOLOGY CLUSTER_NAME SECRET_NAME CLOUD_NAME ENCODED_CLOUDS_YAML .PHONY: cluster cluster: $(CTLPTL) $(KUBECTL) ## Creates kind-dev Cluster @@ -589,4 +589,4 @@ get-kubeconfig-workload-cluster: .PHONY: tilt-up tilt-up: env-vars-for-wl-cluster $(ENVSUBST) $(KUBECTL) $(KUSTOMIZE) $(TILT) cluster ## Start a mgt-cluster & Tilt. Installs the CRDs and deploys the controllers - EXP_CLUSTER_RESOURCE_SET=true $(TILT) up --port=10351 + $(TILT) up --port=10351 From dc7f129af50627e3eef0f3660522fea1fede46db Mon Sep 17 00:00:00 2001 From: "michal.gubricky" Date: Fri, 23 Feb 2024 13:55:31 +0100 Subject: [PATCH 2/2] Ensure that we check env variables for local_mode enabled and disabled Signed-off-by: michal.gubricky --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index fb0d345c..cb3eea63 100644 --- a/Makefile +++ b/Makefile @@ -160,7 +160,13 @@ all-tools: $(GOTESTSUM) $(go-cover-treemap) $(go-binsize-treemap) $(KIND) $(PACK ##@ Development env-vars-for-wl-cluster: +ifeq ($(wildcard tilt-settings.yaml),) + @./hack/ensure-env-variables.sh GIT_PROVIDER_B64 GIT_ACCESS_TOKEN_B64 GIT_ORG_NAME_B64 GIT_REPOSITORY_NAME_B64 CLUSTER_TOPOLOGY CLUSTER_NAME SECRET_NAME CLOUD_NAME ENCODED_CLOUDS_YAML +else ifeq ($(shell awk '/local_mode:/ {print tolower($$2)}' tilt-settings.yaml),true) @./hack/ensure-env-variables.sh CLUSTER_TOPOLOGY CLUSTER_NAME SECRET_NAME CLOUD_NAME ENCODED_CLOUDS_YAML +else + @./hack/ensure-env-variables.sh GIT_PROVIDER_B64 GIT_ACCESS_TOKEN_B64 GIT_ORG_NAME_B64 GIT_REPOSITORY_NAME_B64 CLUSTER_TOPOLOGY CLUSTER_NAME SECRET_NAME CLOUD_NAME ENCODED_CLOUDS_YAML +endif .PHONY: cluster cluster: $(CTLPTL) $(KUBECTL) ## Creates kind-dev Cluster