From 39db40cd5ee329428dd8ed4418d1f6b154487c23 Mon Sep 17 00:00:00 2001 From: jem Date: Fri, 1 Oct 2021 14:03:00 +0200 Subject: [PATCH] add k8s context env --- .../provs/workplace/infrastructure/DevOps.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/workplace/infrastructure/DevOps.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/workplace/infrastructure/DevOps.kt index c928631..fdf2b7f 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/workplace/infrastructure/DevOps.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/workplace/infrastructure/DevOps.kt @@ -51,21 +51,20 @@ fun Prov.installKubectl(): ProvResult = def { then export KUBECONFIG="$DEFAULT_KUBE_CONTEXTS" fi - - # Additional contexts should be in ~/.kube/custom-contexts/ + + # Additional contexts should be in ~/.kube/custom-contexts/ CUSTOM_KUBE_CONTEXTS="$HOME/.kube/custom-contexts" mkdir -p "${CUSTOM_KUBE_CONTEXTS}" - + OIFS="$IFS" - IFS=${'$'}'\n' - for contextFile in `find "${CUSTOM_KUBE_CONTEXTS}" -type f -name "*.yml"` + IFS=$'\n' + for contextFile in `find "${CUSTOM_KUBE_CONTEXTS}" -type f -name "*.yml"` do export KUBECONFIG="$contextFile:$KUBECONFIG" done IFS="$OIFS" """.trimIndent() - createFile(kubeConfigFile, kubeConfig, "640") */ }