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

fix in-cluster loading precedence #57

Closed bonifaido closed 4 years ago

bonifaido commented 4 years ago

Signed-off-by: Nandor Kracser bonifaido@gmail.com

Q A
Bug fix? yes
New feature? no
API breaks? no
Deprecations? no
Related tickets N/A
License Apache 2.0

What's in this PR?

Fixed the provider configuration loading to work according to the documentation.

Why?

The provider wasn't working as expected in-cluster when there were statically defined configuration options, and it was still loading the in-cluster config.

Additional context

Checklist

jamengual commented 4 years ago

I'm not sure but If I use this version now I get :

data.aws_ami.ubuntu: Refreshing state...

Error: Failed to configure: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined

  on ../rancher-common/provider.tf line 10, in provider "k8s":
  10: provider "k8s" {

If I use 0.8.2 it works just fine.