kbst / terraform-provider-kustomization

Terraform provider for Kustomize
https://www.kubestack.com
Apache License 2.0
270 stars 53 forks source link

adding support for provider parameters host, cluster_ca_certificate, token #226

Closed 5cat closed 1 year ago

5cat commented 1 year ago

resolving #96 #109 and #143

added the params and tested it.

So now we can do

provider "kustomization" {
  host                   = "https://${module.testing_gke_core.endpoint}"
  token                  = data.google_client_config.default.access_token
  cluster_ca_certificate = base64decode(module.testing_gke_core.ca_certificate)
}

Note this is my first time writing something in go and I just copied pasted things until it worked, let me know if there is any issue.

pst commented 1 year ago

I do not want to maintain all the attributes one can set in the kubeconfig in the provider schema. You can do anything you want, just put it in a kubeconfig and pass that to the provider. This is supported both with the path to a file (optionally via env var), or as a string via kubeconfig_raw.

I will admit that using e.g. in-cluster in CI/CD and a kubeconfig locally can be difficult if one option is set in Terraform code. And I would be open to a PR that tries to improve this in a backwards compatible way.

But I will not merge a PR that adds additional auth related attributes to the provider schema. Sorry for rejecting your contribution. But if I accept it, I will have to maintain it.