[Bug?] Odd prefix in injected strings

All strings written by the vault-agent to the secret files are getting prefixed with an u (unicode?). Not sure if a bug or misconfiguration on my side.


I have the annotations below attached to my pod:

vault.hashicorp.com/agent-inject: 'true'
vault.hashicorp.com/preserve-secret-case: 'true'
vault.hashicorp.com/agent-inject-default-template: "json"
vault.hashicorp.com/role: "myapp-role"
vault.hashicorp.com/secret-volume-path: "/run/secrets"
vault.hashicorp.com/log-level: "trace"
vault.hashicorp.com/auth-path: "auth/myapp"
vault.hashicorp.com/agent-inject-secret-FOO: 'myapp/FOO'

This is the myapp/FOO secret content, in a KV2 storage

  "x": 1,
  "y": "foobar"

And this is what actually gets injected in my containers:

# cat /run/secrets/FOO

Why is my foobar value prefixed with u?

FWIW, the same issue happens when I use the vault.hashicorp.com/agent-inject-template-* annotation with some Consul template to render just one of the keys, like shown below:

vault.hashicorp.com/agent-inject-secret-FOOY: 'myapp/FOO'
vault.hashicorp.com/agent-inject-template-FOOY: {{ with secret "myapp/FOO" }}{{ .Data.data.y }}{{ end }}`
# cat /run/secrets/FOOY

GitHub issue: Odd prefix in strings in