provider/kubernetes: Allow sourcing config_path from KUBECONFIG env var (#14889)
This commit is contained in:
parent
72f3c374cf
commit
149bef4b4c
|
@ -63,7 +63,12 @@ func Provider() terraform.ResourceProvider {
|
||||||
"config_path": {
|
"config_path": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DefaultFunc: schema.EnvDefaultFunc("KUBE_CONFIG", "~/.kube/config"),
|
DefaultFunc: schema.MultiEnvDefaultFunc(
|
||||||
|
[]string{
|
||||||
|
"KUBE_CONFIG",
|
||||||
|
"KUBECONFIG",
|
||||||
|
},
|
||||||
|
"~/.kube/config"),
|
||||||
Description: "Path to the kube config file, defaults to ~/.kube/config",
|
Description: "Path to the kube config file, defaults to ~/.kube/config",
|
||||||
},
|
},
|
||||||
"config_context": {
|
"config_context": {
|
||||||
|
|
|
@ -93,7 +93,7 @@ The following arguments are supported:
|
||||||
* `client_certificate` - (Optional) PEM-encoded client certificate for TLS authentication. Can be sourced from `KUBE_CLIENT_CERT_DATA`.
|
* `client_certificate` - (Optional) PEM-encoded client certificate for TLS authentication. Can be sourced from `KUBE_CLIENT_CERT_DATA`.
|
||||||
* `client_key` - (Optional) PEM-encoded client certificate key for TLS authentication. Can be sourced from `KUBE_CLIENT_KEY_DATA`.
|
* `client_key` - (Optional) PEM-encoded client certificate key for TLS authentication. Can be sourced from `KUBE_CLIENT_KEY_DATA`.
|
||||||
* `cluster_ca_certificate` - (Optional) PEM-encoded root certificates bundle for TLS authentication. Can be sourced from `KUBE_CLUSTER_CA_CERT_DATA`.
|
* `cluster_ca_certificate` - (Optional) PEM-encoded root certificates bundle for TLS authentication. Can be sourced from `KUBE_CLUSTER_CA_CERT_DATA`.
|
||||||
* `config_path` - (Optional) Path to the kube config file. Can be sourced from `KUBE_CONFIG`. Defaults to `~/.kube/config`.
|
* `config_path` - (Optional) Path to the kube config file. Can be sourced from `KUBE_CONFIG` or `KUBECONFIG`. Defaults to `~/.kube/config`.
|
||||||
* `config_context` - (Optional) Context to choose from the config file. Can be sourced from `KUBE_CTX`.
|
* `config_context` - (Optional) Context to choose from the config file. Can be sourced from `KUBE_CTX`.
|
||||||
* `config_context_auth_info` - (Optional) Authentication info context of the kube config (name of the kubeconfig user, `--user` flag in `kubectl`). Can be sourced from `KUBE_CTX_AUTH_INFO`.
|
* `config_context_auth_info` - (Optional) Authentication info context of the kube config (name of the kubeconfig user, `--user` flag in `kubectl`). Can be sourced from `KUBE_CTX_AUTH_INFO`.
|
||||||
* `config_context_cluster` - (Optional) Cluster context of the kube config (name of the kubeconfig cluster, `--cluster` flag in `kubectl`). Can be sourced from `KUBE_CTX_CLUSTER`.
|
* `config_context_cluster` - (Optional) Cluster context of the kube config (name of the kubeconfig cluster, `--cluster` flag in `kubectl`). Can be sourced from `KUBE_CTX_CLUSTER`.
|
||||||
|
|
Loading…
Reference in New Issue