Skip to content

Commit

Permalink
Merge pull request #1450 from linode/dev
Browse files Browse the repository at this point in the history
v2.21.1
  • Loading branch information
zliang-akamai committed May 30, 2024
2 parents abb9e80 + 6703d4c commit 1c2b199
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/resources/lke_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ resource "linode_lke_cluster" "test" {
acl {
enabled = true
addresses {
ipv4 = "0.0.0.0/0"
ipv6 = "2001:db8::/32"
ipv4 = ["0.0.0.0/0"]
ipv6 = ["2001:db8::/32"]
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions linode/lke/framework_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ func (r *DataSource) Read(
acl, err := client.GetLKEClusterControlPlaneACL(ctx, clusterId)
if err != nil {
if lerr, ok := err.(*linodego.Error); ok &&
lerr.Code == 400 && strings.Contains(lerr.Message, "Cluster does not support Control Plane ACL") {
// The cluster does not have a Gateway. Nothing to do here.
(lerr.Code == 404 ||
(lerr.Code == 400 && strings.Contains(lerr.Message, "Cluster does not support Control Plane ACL"))) {
// The customer doesn't have access to LKE ACL or the cluster does not have a Gateway. Nothing to do here.
} else {
resp.Diagnostics.AddError(
fmt.Sprintf("Failed to get Control Plane ACL for LKE cluster %d", clusterId),
Expand Down
5 changes: 3 additions & 2 deletions linode/lke/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ func readResource(ctx context.Context, d *schema.ResourceData, meta interface{})
acl, err := client.GetLKEClusterControlPlaneACL(ctx, id)
if err != nil {
if lerr, ok := err.(*linodego.Error); ok &&
lerr.Code == 400 && strings.Contains(lerr.Message, "Cluster does not support Control Plane ACL") {
// The cluster does not have a Gateway. Nothing to do here.
(lerr.Code == 404 ||
(lerr.Code == 400 && strings.Contains(lerr.Message, "Cluster does not support Control Plane ACL"))) {
// The customer doesn't have access to LKE ACL or the cluster does not have a Gateway. Nothing to do here.
} else {
return diag.Errorf("failed to get control plane ACL for LKE cluster %d: %s", id, err)
}
Expand Down

0 comments on commit 1c2b199

Please sign in to comment.