From 8dbc5150f7ab94541f1a9032a7bbe5544ed80eea Mon Sep 17 00:00:00 2001 From: nhyatt Date: Sun, 22 Oct 2023 13:21:04 -0500 Subject: [PATCH] escape periods in secret ids --- vars/declarativeFunctions.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vars/declarativeFunctions.groovy b/vars/declarativeFunctions.groovy index 06763ba..79b8772 100644 --- a/vars/declarativeFunctions.groovy +++ b/vars/declarativeFunctions.groovy @@ -64,11 +64,12 @@ def readSecret (Map config) { serverUrl: config.kubeURL, namespace: config.namespace ]) { + def safeSecretID = config.secretID.replaceAll(/\./, "\.") def output = sh( returnStdout: true, script: """#Read Secret set +x - kubectl get secret "${config.secret}" -o jsonpath={".data.${config.secretID}"} | base64 -d + kubectl get secret "${config.secret}" -o jsonpath={".data.${safeSecretID}"} | base64 -d """ ) return output