Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

fix: stringify json object based secrets #247

Merged
merged 2 commits into from
Mar 27, 2020

Conversation

Flydiverny
Copy link
Member

When using an external secret like below where the secret value was formated like json you might expect to get the JSON value in the secret but instead you got "[object Object]"

apiVersion: kubernetes-client.io/v1
kind: ExternalSecret
metadata:
  name: secretsmanager-test
spec:
  backendType: secretsManager
  dataFrom:
    - /development/mma/dockerhub

Secret value:

{
  "auths": {
    "https://index.docker.io/v1/": {
      "auth": "bXktc2VjcmV0LWNyZWRlbnRpYWw6bm90LW15LXBhc3N3b3JkCg=="
    }
  }
}

Gave a secret like

apiVersion: v1
kind: Secret
metadata:
  name: secretmanager-test
data:
  auths: W29iamVjdCBPYmplY3Rd
type: Opaque

W29iamVjdCBPYmplY3Rd -> [object Object]

After this change:

eyJodHRwczovL2luZGV4LmRvY2tlci5pby92MS8iOnsiYXV0aCI6ImJYa3RjMlZqY21WMExXTnlaV1JsYm5ScFlXdzZibTkwTFcxNUxYQmhjM04zYjNKa0NnPT0ifX0= -> {"https://index.docker.io/v1/":{"auth":"bXktc2VjcmV0LWNyZWRlbnRpYWw6bm90LW15LXBhc3N3b3JkCg=="}}

@dawidmalina
Copy link

This is also what I'm looking for. @silasbw, @Flydiverny when this pull request will be merged and new version released?

@Flydiverny Flydiverny self-assigned this Mar 1, 2020
@silasbw silasbw merged commit 828d0ce into external-secrets:master Mar 27, 2020
@silasbw
Copy link
Contributor

silasbw commented Mar 27, 2020

Sorry for the horrible response time on this.

@Flydiverny Flydiverny deleted the fix/json-secrets branch April 26, 2020 01:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants