Skip to content

Commit 88854c6

Browse files
Mia-Crossbene2k1Gnoale
committed
Apply suggestions from code review
Co-authored-by: Benedikt Rollik <[email protected]> Co-authored-by: Guillaume Noale <[email protected]>
1 parent 86977cf commit 88854c6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/resources/k8s_acl.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ page_title: "Scaleway: scaleway_k8s_acl"
66
# Resource: scaleway_k8s_acl
77

88
Creates and manages Scaleway Kubernetes Cluster authorized IPs.
9-
For more information, please refer to the [API documentation](https://www.scaleway.com/en/developers/api/kubernetes/#path-access-control-list-add-new-acls)
9+
For more information, please refer to the [API documentation](https://www.scaleway.com/en/developers/api/kubernetes/#path-access-control-list-add-new-acls).
1010

1111
~> **Important:** When creating a Cluster, it comes with a default ACL rule allowing all ranges `0.0.0.0/0`.
1212
Defining custom ACLs with Terraform will overwrite this rule, but it will be recreated automatically when deleting the ACL resource.
@@ -62,7 +62,7 @@ resource "scaleway_k8s_acl" "acl_basic" {
6262

6363
The following arguments are supported:
6464

65-
- `cluster_id` - (Required) UUID of the Cluster. The ID of the cluster is also the ID of the ACL resource as there can only be one per cluster.
65+
- `cluster_id` - (Required) UUID of the cluster. The ID of the cluster is also the ID of the ACL resource, as there can only be one per cluster.
6666

6767
~> **Important:** Updates to `cluster_id` will recreate the ACL.
6868

@@ -82,7 +82,7 @@ The `acl_rules` block supports:
8282

8383
~> **Important:** If the `ip` field is set, `scaleway_ranges` cannot be set to true in the same rule.
8484

85-
- `scaleway_ranges` - (Optional) Allow access to cluster from all Scaleway ranges as defined in https://www.scaleway.com/en/docs/console/account/reference-content/scaleway-network-information/#ip-ranges-used-by-scaleway.
85+
- `scaleway_ranges` - (Optional) Allow access to cluster from all Scaleway ranges as defined in [Scaleway Network Information - IP ranges used by Scaleway](https://www.scaleway.com/en/docs/console/account/reference-content/scaleway-network-information/#ip-ranges-used-by-scaleway).
8686
Only one rule with this field set to true can be added.
8787

8888
~> **Important:** If the `scaleway_ranges` field is set to true, the `ip` field cannot be set on the same rule.

internal/services/k8s/acl.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func ResourceACL() *schema.Resource {
4747
Type: schema.TypeBool,
4848
Optional: true,
4949
Default: false,
50-
Description: "If true, no IP will be allowed",
50+
Description: "If true, no IP will be allowed and the cluster will be fully isolated",
5151
ExactlyOneOf: []string{"acl_rules"},
5252
},
5353
"acl_rules": {
@@ -237,7 +237,7 @@ func expandACL(data []interface{}) ([]*k8s.ACLRuleRequest, error) {
237237
r := rule.(map[string]interface{})
238238
expandedRule := &k8s.ACLRuleRequest{}
239239

240-
if ipRaw, ipSet := r["ip"]; ipSet && ipRaw != "" {
240+
if ipRaw, ok := r["ip"]; ok && ipRaw != "" {
241241
ip, err := types.ExpandIPNet(ipRaw.(string))
242242
if err != nil {
243243
return nil, err
@@ -246,11 +246,11 @@ func expandACL(data []interface{}) ([]*k8s.ACLRuleRequest, error) {
246246
expandedRule.IP = &ip
247247
}
248248

249-
if scwRangesRaw, scwRangesSet := r["scaleway_ranges"]; scwRangesSet && scwRangesRaw.(bool) {
249+
if scwRangesRaw, ok := r["scaleway_ranges"]; ok && scwRangesRaw.(bool) {
250250
expandedRule.ScalewayRanges = scw.BoolPtr(true)
251251
}
252252

253-
if descriptionRaw, descriptionSet := r["description"]; descriptionSet && descriptionRaw.(string) != "" {
253+
if descriptionRaw, ok := r["description"]; ok && descriptionRaw.(string) != "" {
254254
expandedRule.Description = descriptionRaw.(string)
255255
}
256256

0 commit comments

Comments
 (0)