Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use toJSON instead readJSON #1071

Merged
merged 1 commit into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/test/groovy/ApmCliStepTests.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,8 @@ class ApmCliStepTests extends ApmBasePipelineTest {
@Test
void testVaultConfig() throws Exception {
helper.registerAllowedMethod('getVaultSecret', [Map.class],
{ return [
"data": [
"value": '{"url": "https://vaultapm.example.com:8200", "token": "vaultApmPassword"}'
]
]
{
return [data: [value: '{"url": "https://vaultapm.example.com:8200", "token": "vaultApmPassword"}' ]]
})

script.call(apmCliConfig: "secret/oblt/apm", serviceName: "serviceFoo")
Expand Down
2 changes: 1 addition & 1 deletion vars/apmCli.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def call(Map args = [:]) {

if(!url && !token){
def apmJson = getVaultSecret(secret: "${apmCliConfig}")?.data.value
def apm = readJSON(text: apmJson)
def apm = toJSON(apmJson)
url = apm.url
token = apm.token
}
Expand Down