zlabjp / kubernetes-resource

[DEPLICATED] This repository is no longer actively maintained.
MIT License
91 stars 42 forks source link

Allow certificate_authority to be a base64 single line string (from Hashicorp Vault) #57

Closed NickLarsenNZ closed 5 years ago

NickLarsenNZ commented 5 years ago

Is this a BUG REPORT or FEATURE REQUEST?:

What happened: Tried setting certificate_authority: ((k8s-ca-cert)) to a variable stored in Vault which is base64 encoded (since Vault doesn't appear to like our multiline PEMs.

What you expected to happen: It would be nice if the resource could detect a one-line string provided for certificate_authority, and base64 decode it (revealing the multi-line base64 encoded PEM).

How to reproduce it (as minimally and precisely as possible):

- name: k8s-cluster
  type: kubernetes
  source:
    server: ((kubernetes_server_url))
    certificate_authority: ((kubernetes_ca_cert))
    namespace: ((kubernetes_namespace))
    token: ((kubernetes_token))
    # We have to fall back to insecure, or run a task to pull in the b64 string as an environment 
    # variable and decode it, and locate the file in the following steps.
    #insecure_skip_tls_verify: true

Anything else we need to know?: No

Environment:

superbrothers commented 5 years ago

You can write a multiline text into Vault. See https://github.com/hashicorp/vault/issues/1929#issuecomment-249921120.

superbrothers commented 5 years ago

This issue is inactive, so I'll close it. If you have any problems, please feel free to reopen it.