banzaicloud / terraform-provider-k8s

Kubernetes Terraform provider with support for raw manifests
https://registry.terraform.io/providers/banzaicloud/k8s
MIT License
135 stars 30 forks source link

Do not let Terraform fail if the kubectl does not contain the expected content #43

Closed tibuntu closed 4 years ago

tibuntu commented 4 years ago

Please find the initial converstation between @bonifaido and me below.

Q A
Bug fix? yes
New feature? no
API breaks? no
Deprecations? no
Related tickets Initial slack discussion
License Apache 2.0

What's in this PR?

This PR changes the way how Terraform (or the provider) handles the load process of the kubectl config.

Instead of failing, only a WARNING log message will be produced. I also noticed that the provider will only create an INFO log message, if the path to the kubectl config that was provided is non-existent. Thus I believe a 'malformed' (E.g. empty) config should not cause a failure.

Why?

This is useful in scenarios where the Terraform code itself will bootstrap the actual environment (In our case Rancher) and hence create the proper kubectl config somewhere in the middle of the Terraform execution.

Checklist