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

Create SecretV2 example #19

Open
ichasco-heytrade opened this issue Sep 25, 2023 · 0 comments
Open

Create SecretV2 example #19

ichasco-heytrade opened this issue Sep 25, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ichasco-heytrade
Copy link

Hi!

I have tried to create a secret with SecretV2 api kind but I am not able to do it.

Is there any complete example in de documentation? I only found this:
https://github.com/upbound/provider-vault/blob/main/examples/kvsecretv2/kvsecretv2.yaml

But there is not any reference to the secret yaml. And I have tried to create it by my own and I get this error:

cannot run refresh: refresh failed: json: cannot unmarshal string into Go value of type map[string]interface {}:

Created Secret template:

apiVersion: v1
kind: Secret
metadata:
  name: "{{ .Values.kv.name }}-{{ .Values.kv.secretName }}-secret"
data:
  data-key: {{ toJson (tpl .Values.kv.key .) | b64enc }} 

the value is:

  key: |
    {
      "sentry.dsn": "test"
    }

And the SecretV2

apiVersion: {{ .Values.kv.apiVersion }}
kind: SecretV2
metadata:
  name: "{{ .Values.kv.name }}-{{ .Values.kv.secretName }}-secret"
spec:
  providerConfigRef:
    name: {{ .Values.kv.providerConfigName }}
  forProvider:
    dataJsonSecretRef:
      name: "{{ .Values.kv.name }}-{{ .Values.kv.secretName }}-secret"
      key: data-key 
      namespace: crossplane
    mount: {{ .Values.kv.env }}
    name: "{{ .Values.kv.name }}/{{ .Values.kv.secretName }}"

Thanks!

@ichasco-heytrade ichasco-heytrade added the bug Something isn't working label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant