Skip to content

Commit 34c0e78

Browse files
committed
wip
1 parent 6471682 commit 34c0e78

File tree

2 files changed

+43
-7
lines changed

2 files changed

+43
-7
lines changed

kubernetes/provider.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ func Provider() *schema.Provider {
5555
RequiredWith: []string{"username", "host"},
5656
},
5757
"insecure": {
58-
Type: schema.TypeBool,
59-
Optional: true,
60-
DefaultFunc: schema.EnvDefaultFunc("KUBE_INSECURE", nil),
61-
Description: "Whether server should be accessed without verifying the TLS certificate.",
58+
Type: schema.TypeBool,
59+
Optional: true,
60+
DefaultFunc: schema.EnvDefaultFunc("KUBE_INSECURE", nil),
61+
Description: "Whether server should be accessed without verifying the TLS certificate.",
6262
ConflictsWith: []string{"cluster_ca_certificate", "client_key", "client_certificate", "exec"},
6363
},
6464
"client_certificate": {

kubernetes/provider_test.go

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,25 @@ func TestAccKubernetesProvider_host(t *testing.T) {
711711
ExpectNonEmptyPlan: true,
712712
ExpectError: regexp.MustCompile(`Error: expected "host" to have a host, got test-host`),
713713
},
714+
{
715+
Config: testAccKubernetesProviderConfig(
716+
providerConfig_exec("test-exec"),
717+
),
718+
PlanOnly: true,
719+
ExpectNonEmptyPlan: true,
720+
// Error: "exec": all of `host,exec` must be specified
721+
ExpectError: regexp.MustCompile("exec,host"),
722+
},
723+
{
724+
Config: testAccKubernetesProviderConfig(
725+
providerConfig_exec("test-exec") +
726+
providerConfig_token("test-token"),
727+
),
728+
PlanOnly: true,
729+
ExpectNonEmptyPlan: true,
730+
// Error: "exec": all of `cluster_ca_certificate,exec,host` must be specified
731+
ExpectError: regexp.MustCompile("cluster_ca_certificate,exec,host"),
732+
},
714733
{
715734
Config: testAccKubernetesProviderConfig(
716735
providerConfig_token("test-token"),
@@ -722,12 +741,29 @@ func TestAccKubernetesProvider_host(t *testing.T) {
722741
},
723742
{
724743
Config: testAccKubernetesProviderConfig(
725-
providerConfig_exec("test-exec"),
744+
providerConfig_cluster_ca_certificate("test-cert"),
745+
),
746+
PlanOnly: true,
747+
ExpectNonEmptyPlan: true,
748+
// Error: "cluster_ca_certificate": all of `cluster_ca_certificate,host` must be specified
749+
ExpectError: regexp.MustCompile("cluster_ca_certificate,host"),
750+
},
751+
{
752+
Config: testAccKubernetesProviderConfig(
753+
providerConfig_host("https://test-host") +
754+
providerConfig_cluster_ca_certificate("test-cert"),
755+
),
756+
PlanOnly: true,
757+
ExpectNonEmptyPlan: true,
758+
},
759+
{
760+
Config: testAccKubernetesProviderConfig(
761+
providerConfig_host("https://test-host") +
762+
providerConfig_cluster_ca_certificate("test-cert") +
763+
providerConfig_token("test-token"),
726764
),
727765
PlanOnly: true,
728766
ExpectNonEmptyPlan: true,
729-
// Error: "exec": all of `host,exec` must be specified
730-
ExpectError: regexp.MustCompile("exec,host"),
731767
},
732768
},
733769
})

0 commit comments

Comments
 (0)