0

I'm using below agent inject annotations in my deployment file. But the rendered output is not what i'm expecting. TIA

    vault.hashicorp.com/agent-inject-secret-cos.json: "observability/data/dev/cosapikey"
    vault.hashicorp.com/agent-inject-template-cos.json: |
      {{`{{- with secret "observe/cosapikey" -}}
        {
          "credential": {
              "apikey": "{{ .Data.data.cosapikey }}"
            }
        }
      {{- end -}}`}}

Output: Notice the apikey doesn't have closed double quote in line number 4. this is throwing error in my application code

root@vault-demo-686fdcbdb7-4kvtj:/vault/secrets# cat cos.json
{
    "credential": {
        "apikey": "ddfdffsfjfjgjgdkdkfj
"}
  }

Expected:

root@vault-demo-686fdcbdb7-4kvtj:/vault/secrets# cat cos.json
{
    "credential": {
        "apikey": "ddfdffsfjfjgjgdkdkfj"
}
  }

David Maze
  • 130,717
  • 29
  • 175
  • 215
Raghavendra
  • 521
  • 5
  • 11

0 Answers0