Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add conflictsWith to provider schema #2084

Merged
merged 11 commits into from
May 30, 2023
68 changes: 40 additions & 28 deletions kubernetes/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,46 +40,58 @@ func Provider() *schema.Provider {
p := &schema.Provider{
Schema: map[string]*schema.Schema{
"host": {
jrhouston marked this conversation as resolved.
Show resolved Hide resolved
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_HOST", ""),
Description: "The hostname (in form of URI) of Kubernetes master.",
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_HOST", nil),
Description: "The hostname (in form of URI) of Kubernetes master.",
ConflictsWith: []string{"config_path", "config_paths"},
},
"username": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_USER", ""),
Description: "The username to use for HTTP basic authentication when accessing the Kubernetes master endpoint.",
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_USER", nil),
Description: "The username to use for HTTP basic authentication when accessing the Kubernetes master endpoint.",
ConflictsWith: []string{"config_path", "config_paths", "exec", "token", "client_certificate", "client_key"},
RequiredWith: []string{"password", "host"},
},
"password": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_PASSWORD", ""),
Description: "The password to use for HTTP basic authentication when accessing the Kubernetes master endpoint.",
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_PASSWORD", nil),
Description: "The password to use for HTTP basic authentication when accessing the Kubernetes master endpoint.",
ConflictsWith: []string{"config_path", "config_paths", "exec", "token", "client_certificate", "client_key"},
RequiredWith: []string{"username", "host"},
},
"insecure": {
Type: schema.TypeBool,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_INSECURE", false),
Description: "Whether server should be accessed without verifying the TLS certificate.",
Type: schema.TypeBool,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_INSECURE", nil),
Description: "Whether server should be accessed without verifying the TLS certificate.",
ConflictsWith: []string{"cluster_ca_certificate", "client_key", "client_certificate", "exec"},
},
"client_certificate": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_CLIENT_CERT_DATA", ""),
Description: "PEM-encoded client certificate for TLS authentication.",
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_CLIENT_CERT_DATA", nil),
Description: "PEM-encoded client certificate for TLS authentication.",
ConflictsWith: []string{"config_path", "config_paths", "username", "password", "insecure"},
BBBmau marked this conversation as resolved.
Show resolved Hide resolved
RequiredWith: []string{"client_key", "cluster_ca_certificate", "host"},
},
"client_key": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_CLIENT_KEY_DATA", ""),
Description: "PEM-encoded client certificate key for TLS authentication.",
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_CLIENT_KEY_DATA", nil),
Description: "PEM-encoded client certificate key for TLS authentication.",
ConflictsWith: []string{"config_path", "config_paths", "username", "password", "exec", "insecure"},
BBBmau marked this conversation as resolved.
Show resolved Hide resolved
RequiredWith: []string{"client_certificate", "cluster_ca_certificate", "host"},
BBBmau marked this conversation as resolved.
Show resolved Hide resolved
},
"cluster_ca_certificate": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_CLUSTER_CA_CERT_DATA", ""),
Description: "PEM-encoded root certificates bundle for TLS authentication.",
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("KUBE_CLUSTER_CA_CERT_DATA", nil),
Description: "PEM-encoded root certificates bundle for TLS authentication.",
ConflictsWith: []string{"config_path", "config_paths", "insecure"},
RequiredWith: []string{"host"},
},
"config_paths": {
BBBmau marked this conversation as resolved.
Show resolved Hide resolved
Type: schema.TypeList,
Expand Down