@@ -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