@@ -40,46 +40,57 @@ func Provider() *schema.Provider {
4040 p := & schema.Provider {
4141 Schema : map [string ]* schema.Schema {
4242 "host" : {
43- Type : schema .TypeString ,
44- Optional : true ,
45- DefaultFunc : schema .EnvDefaultFunc ("KUBE_HOST" , "" ),
46- Description : "The hostname (in form of URI) of Kubernetes master." ,
43+ Type : schema .TypeString ,
44+ Optional : true ,
45+ DefaultFunc : schema .EnvDefaultFunc ("KUBE_HOST" , nil ),
46+ Description : "The hostname (in form of URI) of Kubernetes master." ,
47+ ConflictsWith : []string {"config_path" , "config_paths" },
4748 },
4849 "username" : {
49- Type : schema .TypeString ,
50- Optional : true ,
51- DefaultFunc : schema .EnvDefaultFunc ("KUBE_USER" , "" ),
52- Description : "The username to use for HTTP basic authentication when accessing the Kubernetes master endpoint." ,
50+ Type : schema .TypeString ,
51+ Optional : true ,
52+ DefaultFunc : schema .EnvDefaultFunc ("KUBE_USER" , nil ),
53+ Description : "The username to use for HTTP basic authentication when accessing the Kubernetes master endpoint." ,
54+ ConflictsWith : []string {"config_path" , "config_paths" , "exec" , "token" , "client_certificate" , "client_key" },
55+ RequiredWith : []string {"password" , "host" },
5356 },
5457 "password" : {
55- Type : schema .TypeString ,
56- Optional : true ,
57- DefaultFunc : schema .EnvDefaultFunc ("KUBE_PASSWORD" , "" ),
58- Description : "The password to use for HTTP basic authentication when accessing the Kubernetes master endpoint." ,
58+ Type : schema .TypeString ,
59+ Optional : true ,
60+ DefaultFunc : schema .EnvDefaultFunc ("KUBE_PASSWORD" , nil ),
61+ Description : "The password to use for HTTP basic authentication when accessing the Kubernetes master endpoint." ,
62+ ConflictsWith : []string {"config_path" , "config_paths" , "exec" , "token" , "client_certificate" , "client_key" },
63+ RequiredWith : []string {"username" , "host" },
5964 },
6065 "insecure" : {
61- Type : schema .TypeBool ,
62- Optional : true ,
63- DefaultFunc : schema .EnvDefaultFunc ("KUBE_INSECURE" , false ),
64- Description : "Whether server should be accessed without verifying the TLS certificate." ,
66+ Type : schema .TypeBool ,
67+ Optional : true ,
68+ DefaultFunc : schema .EnvDefaultFunc ("KUBE_INSECURE" , nil ),
69+ Description : "Whether server should be accessed without verifying the TLS certificate." ,
70+ ConflictsWith : []string {"cluster_ca_certificate" },
6571 },
6672 "client_certificate" : {
67- Type : schema .TypeString ,
68- Optional : true ,
69- DefaultFunc : schema .EnvDefaultFunc ("KUBE_CLIENT_CERT_DATA" , "" ),
70- Description : "PEM-encoded client certificate for TLS authentication." ,
73+ Type : schema .TypeString ,
74+ Optional : true ,
75+ DefaultFunc : schema .EnvDefaultFunc ("KUBE_CLIENT_CERT_DATA" , nil ),
76+ Description : "PEM-encoded client certificate for TLS authentication." ,
77+ ConflictsWith : []string {"config_path" , "config_paths" , "username" , "password" },
78+ RequiredWith : []string {"client_key" },
7179 },
7280 "client_key" : {
73- Type : schema .TypeString ,
74- Optional : true ,
75- DefaultFunc : schema .EnvDefaultFunc ("KUBE_CLIENT_KEY_DATA" , "" ),
76- Description : "PEM-encoded client certificate key for TLS authentication." ,
81+ Type : schema .TypeString ,
82+ Optional : true ,
83+ DefaultFunc : schema .EnvDefaultFunc ("KUBE_CLIENT_KEY_DATA" , nil ),
84+ Description : "PEM-encoded client certificate key for TLS authentication." ,
85+ ConflictsWith : []string {"config_path" , "config_paths" , "username" , "password" , "exec" },
86+ RequiredWith : []string {"client_certificate" },
7787 },
7888 "cluster_ca_certificate" : {
79- Type : schema .TypeString ,
80- Optional : true ,
81- DefaultFunc : schema .EnvDefaultFunc ("KUBE_CLUSTER_CA_CERT_DATA" , "" ),
82- Description : "PEM-encoded root certificates bundle for TLS authentication." ,
89+ Type : schema .TypeString ,
90+ Optional : true ,
91+ DefaultFunc : schema .EnvDefaultFunc ("KUBE_CLUSTER_CA_CERT_DATA" , nil ),
92+ Description : "PEM-encoded root certificates bundle for TLS authentication." ,
93+ ConflictsWith : []string {"insecure" },
8394 },
8495 "config_paths" : {
8596 Type : schema .TypeList ,
0 commit comments