From d2756cb65dd9c77c41a32194291e8b556ca40e9e Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Wed, 7 Jun 2023 11:10:25 +0200 Subject: [PATCH] make pluto mongodb password url conform caused by unescaped character (/) --- goofy-client/apps/goofy-e2e/Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/goofy-client/apps/goofy-e2e/Jenkinsfile b/goofy-client/apps/goofy-e2e/Jenkinsfile index 51bf08936e..7f54d1657d 100644 --- a/goofy-client/apps/goofy-e2e/Jenkinsfile +++ b/goofy-client/apps/goofy-e2e/Jenkinsfile @@ -664,9 +664,11 @@ String generateCypressConfig(String bezeichner, String testFolder, Integer dbPor def config = readJSON file: 'cypress-ci.json' def plutoDatabaseSecret = getPlutoDatabaseSecret(namespace); + def decodedPassword = decodeString(plutoDatabaseSecret.password); + def parsablePassword = makePasswordUrlConform(decodedPassword); config.baseUrl = "https://${bezeichner}.${env.CLUSTER_BASE_URL}" as String - config.env.dbUrl = "mongodb://pluto-database-user:${decodeString(plutoDatabaseSecret.password)}@localhost:${dbPort}/admin?ssl=false&directConnection=true" as String + config.env.dbUrl = "mongodb://pluto-database-user:${parsablePassword}@localhost:${dbPort}/admin?ssl=false&directConnection=true" as String config.env.keycloakUrl = "https://${env.SSO_URL}/" as String config.env.keycloakRealm = namespace as String config.env.keycloakClient = "alfa" as String @@ -687,6 +689,10 @@ String generateCypressConfig(String bezeichner, String testFolder, Integer dbPor return configName } +String makePasswordUrlConform(String password) { + return sh (script: "printf %s ${password} | jq -sRr @uri", returnStdout: true); +} + Map getPlutoDatabaseSecret(String namespace) { return readJSON ( text: sh (script: "kubectl get secret pluto-database-admin-pluto-database-user -n ${namespace} -o jsonpath={.data}", returnStdout: true)) } -- GitLab