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 authenticatingProxy.ca support for CCE cluster #279

Merged
merged 1 commit into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion huaweicloud/resource_huaweicloud_cce_cluster_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ func resourceCCEClusterV3() *schema.Resource {
ForceNew: true,
Default: "x509",
},
"authenticating_proxy_ca": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
"multi_az": {
Type: schema.TypeBool,
Optional: true,
Expand Down Expand Up @@ -209,6 +214,10 @@ func resourceCCEClusterV3Create(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("Unable to create HuaweiCloud CCE client : %s", err)
}

authenticating_proxy := make(map[string]string)
if hasFilledOpt(d, "authenticating_proxy_ca") {
authenticating_proxy["ca"] = d.Get("authenticating_proxy_ca").(string)
}
createOpts := clusters.CreateOpts{
Kind: "Cluster",
ApiVersion: "v3",
Expand All @@ -226,7 +235,7 @@ func resourceCCEClusterV3Create(d *schema.ResourceData, meta interface{}) error
ContainerNetwork: clusters.ContainerNetworkSpec{Mode: d.Get("container_network_type").(string),
Cidr: d.Get("container_network_cidr").(string)},
Authentication: clusters.AuthenticationSpec{Mode: d.Get("authentication_mode").(string),
AuthenticatingProxy: make(map[string]string)},
AuthenticatingProxy: authenticating_proxy},
BillingMode: d.Get("billing_mode").(int),
ExtendParam: resourceClusterExtendParamV3(d),
},
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/cce_cluster_v3.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ The following arguments are supported:
* `authentication_mode` - (Optional) Authentication mode of the cluster, possible values are x509 and rbac. Defaults to x509.
Changing this parameter will create a new cluster resource.

* `authenticating_proxy_ca` - (Optional) CA root certificate provided in the authenticating_proxy mode. The CA root certificate
is encoded to the Base64 format. Changing this parameter will create a new cluster resource.

* `multi_az` - (Optional) Enable multiple AZs for the cluster, only when using HA flavors. Changing this parameter will create a new cluster resource.

* `eip` - (Optional) EIP address of the cluster. Changing this parameter will create a new cluster resource.
Expand Down