From defbe23846dc6f9f6f93409c173f567dcfcee4ce Mon Sep 17 00:00:00 2001 From: yaroslavborbat Date: Wed, 8 Jan 2025 17:28:57 +0300 Subject: [PATCH] fix rebase Signed-off-by: yaroslavborbat --- internal/framework/provider/provider_configure.go | 4 ---- kubernetes/provider.go | 5 +++-- kubernetes/provider_test.go | 3 ++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/framework/provider/provider_configure.go b/internal/framework/provider/provider_configure.go index 77ad5cbce1..46898a51e1 100644 --- a/internal/framework/provider/provider_configure.go +++ b/internal/framework/provider/provider_configure.go @@ -5,10 +5,6 @@ package provider import ( "context" - "fmt" - "github.com/hashicorp/terraform-provider-kubernetes/util" - "os" - "path/filepath" "github.com/hashicorp/terraform-plugin-framework/provider" diff --git a/kubernetes/provider.go b/kubernetes/provider.go index f759e5cfd6..b23bb4147d 100644 --- a/kubernetes/provider.go +++ b/kubernetes/provider.go @@ -7,13 +7,14 @@ import ( "bytes" "context" "fmt" - "github.com/hashicorp/terraform-provider-kubernetes/util" "log" "net/http" "os" "path/filepath" "strconv" + "github.com/hashicorp/terraform-provider-kubernetes/util" + "github.com/hashicorp/go-cty/cty" gversion "github.com/hashicorp/go-version" "github.com/mitchellh/go-homedir" @@ -565,7 +566,7 @@ func initializeConfiguration(d *schema.ResourceData) (*restclient.Config, diag.D } log.Printf("[DEBUG] Using overridden context: %#v", overrides.Context) } - + } // Overriding with static configuration if v, ok := d.GetOk("insecure"); ok { diff --git a/kubernetes/provider_test.go b/kubernetes/provider_test.go index 6950279680..6a0e18ddb3 100644 --- a/kubernetes/provider_test.go +++ b/kubernetes/provider_test.go @@ -186,6 +186,7 @@ func getEnv() *currentEnv { func testAccPreCheck(t *testing.T) { ctx := context.TODO() + hasEnvCfg := os.Getenv("KUBE_CONFIG_DATA_BASE64") != "" hasFileCfg := (os.Getenv("KUBE_CTX_AUTH_INFO") != "" && os.Getenv("KUBE_CTX_CLUSTER") != "") || os.Getenv("KUBE_CTX") != "" || os.Getenv("KUBE_CONFIG_PATH") != "" @@ -195,7 +196,7 @@ func testAccPreCheck(t *testing.T) { os.Getenv("KUBE_CLUSTER_CA_CERT_DATA") != "") && (hasUserCredentials || hasClientCert || os.Getenv("KUBE_TOKEN") != "") - if !hasFileCfg && !hasStaticCfg && !hasUserCredentials { + if !hasEnvCfg && !hasFileCfg && !hasStaticCfg && !hasUserCredentials { t.Fatalf("File config (KUBE_CTX_AUTH_INFO and KUBE_CTX_CLUSTER) or static configuration"+ "(%s) or (%s) must be set for acceptance tests", strings.Join([]string{