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

Parse credentials as map[string]any{} #9

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

turkenh
Copy link
Member

@turkenh turkenh commented Aug 10, 2023

Description of your changes

Currently, it is not possible to use a credential value other than string in ProviderConfig.

Using the following provider config secret, fails with the following error:

apiVersion: v1
kind: Secret
metadata:
  name: vault-creds
  namespace: vault
type: Opaque
stringData:
  # WARNING: DO NOT CHECK REAL TOKENS INTO GIT
  credentials: |
    {"auth_login":{"path":"auth/approle/login","namespace":"NAMESPACE","parameters":{"role_id":"ROLE_ID","secret_id":"SECRET_ID"}}}
2023-08-10T08:50:43Z	DEBUG	events	cannot get terraform setup: cannot unmarshal vault credentials as JSON: json: cannot unmarshal object into Go value of type string	{"type": "Warning", "object": {"kind":"Mount","name":"kv-v2-secret-mount","uid":"8ea6a132-c6cf-49c9-83d3-

This PR fixes credential parsing by using map[string]any{} as it type.
I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

To be tested, built provider image turkenh/provider-vault:v0.0.0-50.g8d5443d from this PR.

@linuxbsdfreak
Copy link

Tested the change and it works.

Copy link
Member

@haarchri haarchri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants