From 1b76e391c8cb736f1b6a2abed1bf2833e09f94af Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Mon, 29 Apr 2024 11:35:54 -0400 Subject: [PATCH 01/15] Initial implementation; needs testing --- go.work.sum | 2 ++ lke_clusters.go | 3 ++- lke_clusters_acl.go | 62 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 lke_clusters_acl.go diff --git a/go.work.sum b/go.work.sum index d7582cb50..d9c424d35 100644 --- a/go.work.sum +++ b/go.work.sum @@ -183,6 +183,7 @@ golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72 golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= @@ -211,6 +212,7 @@ golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3j golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao= google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= diff --git a/lke_clusters.go b/lke_clusters.go index ff9b67659..5f56d14db 100644 --- a/lke_clusters.go +++ b/lke_clusters.go @@ -68,7 +68,8 @@ type LKEClusterDashboard struct { // LKEClusterControlPlane fields contained within the `control_plane` attribute of an LKE cluster. type LKEClusterControlPlane struct { - HighAvailability bool `json:"high_availability"` + HighAvailability bool `json:"high_availability"` + ACL *LKEClusterControlPlaneACL `json:"acl"` } // LKEVersion fields are those returned by GetLKEVersion diff --git a/lke_clusters_acl.go b/lke_clusters_acl.go new file mode 100644 index 000000000..ad07c4db8 --- /dev/null +++ b/lke_clusters_acl.go @@ -0,0 +1,62 @@ +package linodego + +import "context" + +// LKEClusterControlPlaneACLAddresses describes the +// allowed IP ranges for an LKE cluster's control plane. +type LKEClusterControlPlaneACLAddresses struct { + IPv4 []string `json:"ipv4"` + IPv6 []string `json:"ipv6"` +} + +// LKEClusterControlPlaneACL describes the ACL configuration +// for an LKE cluster's control plane. +type LKEClusterControlPlaneACL struct { + Enabled bool `json:"enabled"` + Addresses LKEClusterControlPlaneACLAddresses `json:"addresses"` +} + +// LKEClusterControlPlaneACLUpdateOptions represents the options +// available when updating the ACL configuration of an LKE cluster's +// control plane. +type LKEClusterControlPlaneACLUpdateOptions struct { + ACL *LKEClusterControlPlaneACL `json:"acl"` +} + +// GetLKEClusterControlPlaneACL gets the ACL configuration for the +// given cluster's control plane. +func (c *Client) GetLKEClusterControlPlaneACL(ctx context.Context, clusterID int) (*LKEClusterControlPlaneACL, error) { + return doGETRequest[LKEClusterControlPlaneACL]( + ctx, + c, + formatAPIPath("lke/clusters/%d/control_plane_acl", clusterID), + ) +} + +// UpdateLKEClusterControlPlaneACL gets the ACL configuration for the +// given cluster's control plane. +func (c *Client) UpdateLKEClusterControlPlaneACL( + ctx context.Context, + clusterID int, + opts LKEClusterControlPlaneACLUpdateOptions, +) (*LKEClusterControlPlaneACL, error) { + return doPUTRequest[LKEClusterControlPlaneACL]( + ctx, + c, + formatAPIPath("lke/clusters/%d/control_plane_acl", clusterID), + opts, + ) +} + +// DeleteLKEClusterControlPlaneACL deletes the ACL configuration for the +// given cluster's control plane. +func (c *Client) DeleteLKEClusterControlPlaneACL( + ctx context.Context, + clusterID int, +) error { + return doDELETERequest( + ctx, + c, + formatAPIPath("lke/clusters/%d/control_plane_acl", clusterID), + ) +} From a6596864f7521831801cd27cbbb2b947ced5b500 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Mon, 29 Apr 2024 11:39:46 -0400 Subject: [PATCH 02/15] Fix control plane omit empty --- lke_clusters.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lke_clusters.go b/lke_clusters.go index 5f56d14db..47384d9be 100644 --- a/lke_clusters.go +++ b/lke_clusters.go @@ -68,8 +68,8 @@ type LKEClusterDashboard struct { // LKEClusterControlPlane fields contained within the `control_plane` attribute of an LKE cluster. type LKEClusterControlPlane struct { - HighAvailability bool `json:"high_availability"` - ACL *LKEClusterControlPlaneACL `json:"acl"` + HighAvailability bool `json:"high_availability,omitempty"` + ACL *LKEClusterControlPlaneACL `json:"acl,omitempty"` } // LKEVersion fields are those returned by GetLKEVersion From 11e155da424c7dafe331bfbdb273fcc18daa48ac Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Mon, 29 Apr 2024 12:35:06 -0400 Subject: [PATCH 03/15] Add integration tests --- lke_clusters_acl.go | 16 +- .../fixtures/TestLKECluster_withACL.yaml | 656 ++++++++++++++++++ test/integration/lke_clusters_acl_test.go | 72 ++ test/integration/lke_clusters_test.go | 2 +- 4 files changed, 740 insertions(+), 6 deletions(-) create mode 100644 test/integration/fixtures/TestLKECluster_withACL.yaml create mode 100644 test/integration/lke_clusters_acl_test.go diff --git a/lke_clusters_acl.go b/lke_clusters_acl.go index ad07c4db8..6c702d381 100644 --- a/lke_clusters_acl.go +++ b/lke_clusters_acl.go @@ -20,13 +20,19 @@ type LKEClusterControlPlaneACL struct { // available when updating the ACL configuration of an LKE cluster's // control plane. type LKEClusterControlPlaneACLUpdateOptions struct { - ACL *LKEClusterControlPlaneACL `json:"acl"` + ACL LKEClusterControlPlaneACL `json:"acl"` +} + +// LKEClusterControlPlaneACLResponse represents the response structure +// for the Client.GetLKEClusterControlPlaneACL(...) method. +type LKEClusterControlPlaneACLResponse struct { + ACL LKEClusterControlPlaneACL `json:"acl"` } // GetLKEClusterControlPlaneACL gets the ACL configuration for the // given cluster's control plane. -func (c *Client) GetLKEClusterControlPlaneACL(ctx context.Context, clusterID int) (*LKEClusterControlPlaneACL, error) { - return doGETRequest[LKEClusterControlPlaneACL]( +func (c *Client) GetLKEClusterControlPlaneACL(ctx context.Context, clusterID int) (*LKEClusterControlPlaneACLResponse, error) { + return doGETRequest[LKEClusterControlPlaneACLResponse]( ctx, c, formatAPIPath("lke/clusters/%d/control_plane_acl", clusterID), @@ -39,8 +45,8 @@ func (c *Client) UpdateLKEClusterControlPlaneACL( ctx context.Context, clusterID int, opts LKEClusterControlPlaneACLUpdateOptions, -) (*LKEClusterControlPlaneACL, error) { - return doPUTRequest[LKEClusterControlPlaneACL]( +) (*LKEClusterControlPlaneACLResponse, error) { + return doPUTRequest[LKEClusterControlPlaneACLResponse]( ctx, c, formatAPIPath("lke/clusters/%d/control_plane_acl", clusterID), diff --git a/test/integration/fixtures/TestLKECluster_withACL.yaml b/test/integration/fixtures/TestLKECluster_withACL.yaml new file mode 100644 index 000000000..4cc419c21 --- /dev/null +++ b/test/integration/fixtures/TestLKECluster_withACL.yaml @@ -0,0 +1,656 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "Backups", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, + 172.105.37.5, 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, + 172.105.43.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}, "placement_group_limits": + {"maximum_pgs_per_customer": 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, + {"id": "ca-central", "label": "Toronto, CA", "country": "ca", "capabilities": + ["Linodes", "Backups", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, 172.105.4.5, 172.105.5.5, + 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, 172.105.10.5, 172.105.11.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "Backups", + "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block + Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": {"ipv4": + "172.105.166.5, 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, + 172.105.170.5, 172.105.167.5, 172.105.171.5, 172.105.181.5, 172.105.161.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-iad", "label": + "Washington, DC", "country": "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, + 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-ord", "label": + "Chicago, IL", "country": "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, + 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", "ipv6": + "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "fr-par", "label": + "Paris, FR", "country": "fr", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, + 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-sea", "label": + "Seattle, WA", "country": "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "br-gru", "label": + "Sao Paulo, BR", "country": "br", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.0.4, 172.233.0.9, 172.233.0.7, 172.233.0.12, 172.233.0.5, 172.233.0.13, + 172.233.0.10, 172.233.0.6, 172.233.0.8, 172.233.0.11", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": 5, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "nl-ams", "label": "Amsterdam, NL", "country": + "nl", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", + "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, 172.233.33.38, + 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, 172.233.33.30, + 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}, "placement_group_limits": + {"maximum_pgs_per_customer": 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "Backups", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, + 172.232.128.25, 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, + 172.232.128.27", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}, "placement_group_limits": + {"maximum_pgs_per_customer": 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, + {"id": "es-mad", "label": "Madrid, ES", "country": "es", "capabilities": ["Linodes", + "Backups", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, 172.233.111.25, + 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, 172.233.111.18, + 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}, "placement_group_limits": + {"maximum_pgs_per_customer": 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, + {"id": "in-maa", "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", + "Backups", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.96.17, 172.232.96.26, 172.232.96.19, 172.232.96.20, + 172.232.96.25, 172.232.96.21, 172.232.96.18, 172.232.96.22, 172.232.96.23, 172.232.96.24", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "jp-osa", "label": + "Osaka, JP", "country": "jp", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "it-mil", "label": + "Milan, IT", "country": "it", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.192.19, 172.232.192.18, 172.232.192.16, 172.232.192.20, 172.232.192.24, + 172.232.192.21, 172.232.192.22, 172.232.192.17, 172.232.192.15, 172.232.192.23", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-mia", "label": + "Miami, FL", "country": "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "id-cgk", "label": + "Jakarta, ID", "country": "id", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.224.23, 172.232.224.32, 172.232.224.26, 172.232.224.27, 172.232.224.21, + 172.232.224.24, 172.232.224.22, 172.232.224.20, 172.232.224.31, 172.232.224.28", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-lax", "label": + "Los Angeles, CA", "country": "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, 172.233.128.34, + 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, 172.233.128.44", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "Backups", + "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block + Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": {"ipv4": + "72.14.179.5, 72.14.188.5, 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, + 96.126.127.5, 198.58.107.5, 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-west", "label": + "Fremont, CA", "country": "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "173.230.145.5, + 173.230.147.5, 173.230.155.5, 173.255.212.5, 173.255.219.5, 173.255.241.5, 173.255.243.5, + 173.255.244.5, 74.207.241.5, 74.207.242.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-southeast", + "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", "Backups", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": 5, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "us-east", "label": "Newark, NJ", "country": + "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", + "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block + Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": {"ipv4": + "66.228.42.5, 96.126.106.5, 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, + 66.175.211.5, 97.107.133.4, 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "eu-west", "label": + "London, UK", "country": "gb", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "178.79.182.5, 176.58.107.5, + 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, + 109.74.193.20, 109.74.194.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": 5, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "ap-south", "label": "Singapore, SG", "country": + "sg", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", + "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block + Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": {"ipv4": + "139.162.11.5, 139.162.13.5, 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, + 139.162.27.5, 103.3.60.18, 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + 5, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "eu-central", + "label": "Frankfurt, DE", "country": "de", "capabilities": ["Linodes", "Backups", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "139.162.130.5, 139.162.131.5, 139.162.132.5, + 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, 139.162.137.5, 139.162.138.5, + 139.162.139.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": 5, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "ap-northeast", "label": "Tokyo, JP", "country": + "jp", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.66.5, 139.162.67.5, + 139.162.68.5, 139.162.69.5, 139.162.70.5, 139.162.71.5, 139.162.72.5, 139.162.73.5, + 139.162.74.5, 139.162.75.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": 5, "maximum_linodes_per_pg": + 5}, "site_type": "core"}], "page": 1, "pages": 1, "results": 25}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - max-age=0, no-cache, no-store + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Expires: + - Mon, 29 Apr 2024 16:31:26 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + - Accept-Encoding + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"node_pools":[{"count":1,"type":"g6-standard-2","disks":null,"tags":["test"]}],"label":"go-test-def","region":"ap-west","k8s_version":"1.29","tags":["testing"],"control_plane":{"acl":{"enabled":true,"addresses":{"ipv4":["10.0.0.1/32"],"ipv6":["1234::5678/64"]}}}}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/lke/clusters + method: POST + response: + body: '{"id": 173757, "status": "ready", "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05", "label": "go-test-def", "region": "ap-west", "k8s_version": + "1.29", "control_plane": {"high_availability": false}, "tags": ["testing"]}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - max-age=0, no-cache, no-store + Connection: + - keep-alive + Content-Length: + - "237" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Expires: + - Mon, 29 Apr 2024 16:31:54 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - lke:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/lke/clusters/173757/control_plane_acl + method: GET + response: + body: '{"acl": {"enabled": true, "addresses": {"ipv4": ["10.0.0.1/32"], "ipv6": + ["1234::5678/64"]}}}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - max-age=0, no-cache, no-store + Connection: + - keep-alive + Content-Length: + - "103" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Expires: + - Mon, 29 Apr 2024 16:31:55 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - lke:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"acl":{"enabled":true,"addresses":{"ipv4":["10.0.0.2/32"],"ipv6":["1234::5678/64"]}}}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/lke/clusters/173757/control_plane_acl + method: PUT + response: + body: '{"acl": {"enabled": true, "addresses": {"ipv4": ["10.0.0.2/32"], "ipv6": + ["1234::5678/64"]}}}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - max-age=0, no-cache, no-store + Connection: + - keep-alive + Content-Length: + - "103" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Expires: + - Mon, 29 Apr 2024 16:31:58 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - lke:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/lke/clusters/173757/control_plane_acl + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - max-age=0, no-cache, no-store + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Expires: + - Mon, 29 Apr 2024 16:32:00 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - lke:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/lke/clusters/173757/control_plane_acl + method: GET + response: + body: '{"acl": {"enabled": false, "addresses": null}}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - max-age=0, no-cache, no-store + Connection: + - keep-alive + Content-Length: + - "46" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Expires: + - Mon, 29 Apr 2024 16:32:01 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - lke:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/lke/clusters/173757 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - max-age=0, no-cache, no-store + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Expires: + - Mon, 29 Apr 2024 16:32:23 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - lke:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/lke_clusters_acl_test.go b/test/integration/lke_clusters_acl_test.go new file mode 100644 index 000000000..0bb30f923 --- /dev/null +++ b/test/integration/lke_clusters_acl_test.go @@ -0,0 +1,72 @@ +package integration + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/linode/linodego" +) + +func TestLKECluster_withACL(t *testing.T) { + client, cluster, teardown, err := setupLKECluster( + t, + []clusterModifier{ + func(options *linodego.LKEClusterCreateOptions) { + options.ControlPlane = &linodego.LKEClusterControlPlane{ + ACL: &linodego.LKEClusterControlPlaneACL{ + Enabled: true, + Addresses: linodego.LKEClusterControlPlaneACLAddresses{ + IPv4: []string{"10.0.0.1/32"}, + IPv6: []string{"2001:db8:1234:abcd::/64"}, + }, + }, + } + }, + }, + "fixtures/TestLKECluster_withACL", + ) + require.NoError(t, err) + defer teardown() + + // TODO: Not currently populated in response, uncomment when available + // require.Equal(t, true, cluster.ControlPlane.ACL.Enabled) + // require.Equal(t, "10.0.0.1/32", cluster.ControlPlane.ACL.Addresses.IPv4[0]) + // require.Equal(t, "2001:db8:1234:abcd::/64", cluster.ControlPlane.ACL.Addresses.IPv6[0]) + + acl, err := client.GetLKEClusterControlPlaneACL(context.Background(), cluster.ID) + assert.NoError(t, err) + + require.Equal(t, true, acl.ACL.Enabled) + require.Equal(t, "10.0.0.1/32", acl.ACL.Addresses.IPv4[0]) + require.Equal(t, "2001:db8:1234:abcd::/64", acl.ACL.Addresses.IPv6[0]) + + acl, err = client.UpdateLKEClusterControlPlaneACL( + context.Background(), + cluster.ID, + linodego.LKEClusterControlPlaneACLUpdateOptions{ + ACL: linodego.LKEClusterControlPlaneACL{ + Enabled: true, + Addresses: linodego.LKEClusterControlPlaneACLAddresses{ + IPv4: []string{"10.0.0.2/32"}, + IPv6: []string{"2002:db8:1234:abcd::/64"}, + }, + }, + }, + ) + require.NoError(t, err) + + require.Equal(t, true, acl.ACL.Enabled) + require.Equal(t, "10.0.0.2/32", acl.ACL.Addresses.IPv4[0]) + require.Equal(t, "2002:db8:1234:abcd::/64", acl.ACL.Addresses.IPv6[0]) + + err = client.DeleteLKEClusterControlPlaneACL(context.Background(), cluster.ID) + require.NoError(t, err) + + acl, err = client.GetLKEClusterControlPlaneACL(context.Background(), cluster.ID) + assert.NoError(t, err) + + assert.Equal(t, false, acl.ACL.Enabled) +} diff --git a/test/integration/lke_clusters_test.go b/test/integration/lke_clusters_test.go index 0e4e6a1f4..830aed91e 100644 --- a/test/integration/lke_clusters_test.go +++ b/test/integration/lke_clusters_test.go @@ -254,7 +254,7 @@ func setupLKECluster(t *testing.T, clusterModifiers []clusterModifier, fixturesY createOpts := linodego.LKEClusterCreateOptions{ Label: label, Region: getRegionsWithCaps(t, client, []string{"Kubernetes"})[0], - K8sVersion: "1.23", + K8sVersion: "1.29", Tags: []string{"testing"}, NodePools: []linodego.LKENodePoolCreateOptions{{Count: 1, Type: "g6-standard-2", Tags: []string{"test"}}}, } From 75862737161cfe8231ac6c40ba0880f5a7eb7537 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Mon, 29 Apr 2024 12:53:11 -0400 Subject: [PATCH 04/15] Update IPv6 address --- .../fixtures/TestLKECluster_withACL.yaml | 38 +++++++++---------- test/integration/lke_clusters_acl_test.go | 10 ++--- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/test/integration/fixtures/TestLKECluster_withACL.yaml b/test/integration/fixtures/TestLKECluster_withACL.yaml index 4cc419c21..48245fd4a 100644 --- a/test/integration/fixtures/TestLKECluster_withACL.yaml +++ b/test/integration/fixtures/TestLKECluster_withACL.yaml @@ -269,7 +269,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:31:26 GMT + - Mon, 29 Apr 2024 16:51:45 GMT Pragma: - no-cache Strict-Transport-Security: @@ -295,7 +295,7 @@ interactions: code: 200 duration: "" - request: - body: '{"node_pools":[{"count":1,"type":"g6-standard-2","disks":null,"tags":["test"]}],"label":"go-test-def","region":"ap-west","k8s_version":"1.29","tags":["testing"],"control_plane":{"acl":{"enabled":true,"addresses":{"ipv4":["10.0.0.1/32"],"ipv6":["1234::5678/64"]}}}}' + body: '{"node_pools":[{"count":1,"type":"g6-standard-2","disks":null,"tags":["test"]}],"label":"go-test-def","region":"ap-west","k8s_version":"1.29","tags":["testing"],"control_plane":{"acl":{"enabled":true,"addresses":{"ipv4":["10.0.0.1/32"],"ipv6":["1234::5678"]}}}}' form: {} headers: Accept: @@ -307,7 +307,7 @@ interactions: url: https://api.linode.com/v4beta/lke/clusters method: POST response: - body: '{"id": 173757, "status": "ready", "created": "2018-01-02T03:04:05", "updated": + body: '{"id": 173778, "status": "ready", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "label": "go-test-def", "region": "ap-west", "k8s_version": "1.29", "control_plane": {"high_availability": false}, "tags": ["testing"]}' headers: @@ -332,7 +332,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:31:54 GMT + - Mon, 29 Apr 2024 16:52:13 GMT Pragma: - no-cache Strict-Transport-Security: @@ -365,11 +365,11 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173757/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/173778/control_plane_acl method: GET response: body: '{"acl": {"enabled": true, "addresses": {"ipv4": ["10.0.0.1/32"], "ipv6": - ["1234::5678/64"]}}}' + ["1234::5678/128"]}}}' headers: Access-Control-Allow-Credentials: - "true" @@ -386,13 +386,13 @@ interactions: Connection: - keep-alive Content-Length: - - "103" + - "94" Content-Security-Policy: - default-src 'none' Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:31:55 GMT + - Mon, 29 Apr 2024 16:52:13 GMT Pragma: - no-cache Strict-Transport-Security: @@ -417,7 +417,7 @@ interactions: code: 200 duration: "" - request: - body: '{"acl":{"enabled":true,"addresses":{"ipv4":["10.0.0.2/32"],"ipv6":["1234::5678/64"]}}}' + body: '{"acl":{"enabled":true,"addresses":{"ipv4":["10.0.0.2/32"],"ipv6":["1234::5678"]}}}' form: {} headers: Accept: @@ -426,11 +426,11 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173757/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/173778/control_plane_acl method: PUT response: body: '{"acl": {"enabled": true, "addresses": {"ipv4": ["10.0.0.2/32"], "ipv6": - ["1234::5678/64"]}}}' + ["1234::5678/128"]}}}' headers: Access-Control-Allow-Credentials: - "true" @@ -447,13 +447,13 @@ interactions: Connection: - keep-alive Content-Length: - - "103" + - "94" Content-Security-Policy: - default-src 'none' Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:31:58 GMT + - Mon, 29 Apr 2024 16:52:17 GMT Pragma: - no-cache Strict-Transport-Security: @@ -486,7 +486,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173757/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/173778/control_plane_acl method: DELETE response: body: '{}' @@ -512,7 +512,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:32:00 GMT + - Mon, 29 Apr 2024 16:52:19 GMT Pragma: - no-cache Strict-Transport-Security: @@ -545,7 +545,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173757/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/173778/control_plane_acl method: GET response: body: '{"acl": {"enabled": false, "addresses": null}}' @@ -571,7 +571,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:32:01 GMT + - Mon, 29 Apr 2024 16:52:20 GMT Pragma: - no-cache Strict-Transport-Security: @@ -605,7 +605,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173757 + url: https://api.linode.com/v4beta/lke/clusters/173778 method: DELETE response: body: '{}' @@ -631,7 +631,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:32:23 GMT + - Mon, 29 Apr 2024 16:52:42 GMT Pragma: - no-cache Strict-Transport-Security: diff --git a/test/integration/lke_clusters_acl_test.go b/test/integration/lke_clusters_acl_test.go index 0bb30f923..9ba2e2657 100644 --- a/test/integration/lke_clusters_acl_test.go +++ b/test/integration/lke_clusters_acl_test.go @@ -20,7 +20,7 @@ func TestLKECluster_withACL(t *testing.T) { Enabled: true, Addresses: linodego.LKEClusterControlPlaneACLAddresses{ IPv4: []string{"10.0.0.1/32"}, - IPv6: []string{"2001:db8:1234:abcd::/64"}, + IPv6: []string{"1234::5678"}, }, }, } @@ -34,14 +34,14 @@ func TestLKECluster_withACL(t *testing.T) { // TODO: Not currently populated in response, uncomment when available // require.Equal(t, true, cluster.ControlPlane.ACL.Enabled) // require.Equal(t, "10.0.0.1/32", cluster.ControlPlane.ACL.Addresses.IPv4[0]) - // require.Equal(t, "2001:db8:1234:abcd::/64", cluster.ControlPlane.ACL.Addresses.IPv6[0]) + // require.Equal(t, "1234::5678", cluster.ControlPlane.ACL.Addresses.IPv6[0]) acl, err := client.GetLKEClusterControlPlaneACL(context.Background(), cluster.ID) assert.NoError(t, err) require.Equal(t, true, acl.ACL.Enabled) require.Equal(t, "10.0.0.1/32", acl.ACL.Addresses.IPv4[0]) - require.Equal(t, "2001:db8:1234:abcd::/64", acl.ACL.Addresses.IPv6[0]) + require.Equal(t, "1234::5678/128", acl.ACL.Addresses.IPv6[0]) acl, err = client.UpdateLKEClusterControlPlaneACL( context.Background(), @@ -51,7 +51,7 @@ func TestLKECluster_withACL(t *testing.T) { Enabled: true, Addresses: linodego.LKEClusterControlPlaneACLAddresses{ IPv4: []string{"10.0.0.2/32"}, - IPv6: []string{"2002:db8:1234:abcd::/64"}, + IPv6: []string{"1235::5678"}, }, }, }, @@ -60,7 +60,7 @@ func TestLKECluster_withACL(t *testing.T) { require.Equal(t, true, acl.ACL.Enabled) require.Equal(t, "10.0.0.2/32", acl.ACL.Addresses.IPv4[0]) - require.Equal(t, "2002:db8:1234:abcd::/64", acl.ACL.Addresses.IPv6[0]) + require.Equal(t, "1235::5678/128", acl.ACL.Addresses.IPv6[0]) err = client.DeleteLKEClusterControlPlaneACL(context.Background(), cluster.ID) require.NoError(t, err) From 4b90dea942eb7227eda32e4d61cc3e8d7b1fb83a Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Mon, 29 Apr 2024 12:59:17 -0400 Subject: [PATCH 05/15] Add event actions --- account_events.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/account_events.go b/account_events.go index 0f8565d18..b7f18a55d 100644 --- a/account_events.go +++ b/account_events.go @@ -127,6 +127,9 @@ const ( ActionLinodeConfigUpdate EventAction = "linode_config_update" ActionLishBoot EventAction = "lish_boot" ActionLKENodeCreate EventAction = "lke_node_create" + ActionLKEControlPlaneACLCreate EventAction = "lke_control_plane_acl_create" + ActionLKEControlPlaneACLUpdate EventAction = "lke_control_plane_acl_update" + ActionLKEControlPlaneACLDelete EventAction = "lke_control_plane_acl_delete" ActionLongviewClientCreate EventAction = "longviewclient_create" ActionLongviewClientDelete EventAction = "longviewclient_delete" ActionLongviewClientUpdate EventAction = "longviewclient_update" From 64cd27810e1bff5ade90f4a2d69402b9a86f3e3e Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Mon, 29 Apr 2024 13:02:43 -0400 Subject: [PATCH 06/15] Account for fixture sanitization --- lke_clusters_acl.go | 8 ++--- .../fixtures/TestLKECluster_withACL.yaml | 33 +++++++++---------- test/integration/lke_clusters_acl_test.go | 4 +-- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/lke_clusters_acl.go b/lke_clusters_acl.go index 6c702d381..57494b618 100644 --- a/lke_clusters_acl.go +++ b/lke_clusters_acl.go @@ -5,15 +5,15 @@ import "context" // LKEClusterControlPlaneACLAddresses describes the // allowed IP ranges for an LKE cluster's control plane. type LKEClusterControlPlaneACLAddresses struct { - IPv4 []string `json:"ipv4"` - IPv6 []string `json:"ipv6"` + IPv4 []string `json:"ipv4,omitempty"` + IPv6 []string `json:"ipv6,omitempty"` } // LKEClusterControlPlaneACL describes the ACL configuration // for an LKE cluster's control plane. type LKEClusterControlPlaneACL struct { - Enabled bool `json:"enabled"` - Addresses LKEClusterControlPlaneACLAddresses `json:"addresses"` + Enabled bool `json:"enabled,omitempty"` + Addresses LKEClusterControlPlaneACLAddresses `json:"addresses,omitempty"` } // LKEClusterControlPlaneACLUpdateOptions represents the options diff --git a/test/integration/fixtures/TestLKECluster_withACL.yaml b/test/integration/fixtures/TestLKECluster_withACL.yaml index 48245fd4a..690198c4c 100644 --- a/test/integration/fixtures/TestLKECluster_withACL.yaml +++ b/test/integration/fixtures/TestLKECluster_withACL.yaml @@ -269,7 +269,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:51:45 GMT + - Mon, 29 Apr 2024 17:01:06 GMT Pragma: - no-cache Strict-Transport-Security: @@ -307,7 +307,7 @@ interactions: url: https://api.linode.com/v4beta/lke/clusters method: POST response: - body: '{"id": 173778, "status": "ready", "created": "2018-01-02T03:04:05", "updated": + body: '{"id": 173783, "status": "ready", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "label": "go-test-def", "region": "ap-west", "k8s_version": "1.29", "control_plane": {"high_availability": false}, "tags": ["testing"]}' headers: @@ -332,7 +332,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:52:13 GMT + - Mon, 29 Apr 2024 17:01:34 GMT Pragma: - no-cache Strict-Transport-Security: @@ -365,7 +365,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173778/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/173783/control_plane_acl method: GET response: body: '{"acl": {"enabled": true, "addresses": {"ipv4": ["10.0.0.1/32"], "ipv6": @@ -392,7 +392,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:52:13 GMT + - Mon, 29 Apr 2024 17:01:35 GMT Pragma: - no-cache Strict-Transport-Security: @@ -417,7 +417,7 @@ interactions: code: 200 duration: "" - request: - body: '{"acl":{"enabled":true,"addresses":{"ipv4":["10.0.0.2/32"],"ipv6":["1234::5678"]}}}' + body: '{"acl":{"enabled":true,"addresses":{"ipv4":["10.0.0.2/32"]}}}' form: {} headers: Accept: @@ -426,11 +426,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173778/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/173783/control_plane_acl method: PUT response: - body: '{"acl": {"enabled": true, "addresses": {"ipv4": ["10.0.0.2/32"], "ipv6": - ["1234::5678/128"]}}}' + body: '{"acl": {"enabled": true, "addresses": {"ipv4": ["10.0.0.2/32"]}}}' headers: Access-Control-Allow-Credentials: - "true" @@ -447,13 +446,13 @@ interactions: Connection: - keep-alive Content-Length: - - "94" + - "66" Content-Security-Policy: - default-src 'none' Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:52:17 GMT + - Mon, 29 Apr 2024 17:01:38 GMT Pragma: - no-cache Strict-Transport-Security: @@ -486,7 +485,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173778/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/173783/control_plane_acl method: DELETE response: body: '{}' @@ -512,7 +511,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:52:19 GMT + - Mon, 29 Apr 2024 17:01:41 GMT Pragma: - no-cache Strict-Transport-Security: @@ -545,7 +544,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173778/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/173783/control_plane_acl method: GET response: body: '{"acl": {"enabled": false, "addresses": null}}' @@ -571,7 +570,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:52:20 GMT + - Mon, 29 Apr 2024 17:01:41 GMT Pragma: - no-cache Strict-Transport-Security: @@ -605,7 +604,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173778 + url: https://api.linode.com/v4beta/lke/clusters/173783 method: DELETE response: body: '{}' @@ -631,7 +630,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 16:52:42 GMT + - Mon, 29 Apr 2024 17:02:04 GMT Pragma: - no-cache Strict-Transport-Security: diff --git a/test/integration/lke_clusters_acl_test.go b/test/integration/lke_clusters_acl_test.go index 9ba2e2657..4ba0cc4c5 100644 --- a/test/integration/lke_clusters_acl_test.go +++ b/test/integration/lke_clusters_acl_test.go @@ -51,7 +51,7 @@ func TestLKECluster_withACL(t *testing.T) { Enabled: true, Addresses: linodego.LKEClusterControlPlaneACLAddresses{ IPv4: []string{"10.0.0.2/32"}, - IPv6: []string{"1235::5678"}, + IPv6: []string{}, }, }, }, @@ -60,7 +60,7 @@ func TestLKECluster_withACL(t *testing.T) { require.Equal(t, true, acl.ACL.Enabled) require.Equal(t, "10.0.0.2/32", acl.ACL.Addresses.IPv4[0]) - require.Equal(t, "1235::5678/128", acl.ACL.Addresses.IPv6[0]) + require.Equal(t, 0, len(acl.ACL.Addresses.IPv6)) err = client.DeleteLKEClusterControlPlaneACL(context.Background(), cluster.ID) require.NoError(t, err) From d6a95bf6b05a14c78af20601ccbad3464c309360 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Mon, 29 Apr 2024 13:05:06 -0400 Subject: [PATCH 07/15] make tidy --- test/go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/go.mod b/test/go.mod index 14ee41906..be2c84654 100644 --- a/test/go.mod +++ b/test/go.mod @@ -6,6 +6,7 @@ require ( github.com/jarcoal/httpmock v1.3.1 github.com/linode/linodego v1.30.0 github.com/linode/linodego/k8s v0.0.0-00010101000000-000000000000 + github.com/stretchr/testify v1.9.0 golang.org/x/net v0.24.0 golang.org/x/oauth2 v0.19.0 k8s.io/client-go v0.28.8 @@ -31,6 +32,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/spf13/pflag v1.0.5 // indirect golang.org/x/sys v0.19.0 // indirect golang.org/x/term v0.19.0 // indirect From 487a7161e2de76532ded60c061c19c3f340442ee Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Mon, 29 Apr 2024 13:08:52 -0400 Subject: [PATCH 08/15] oops --- lke_clusters_acl.go | 4 ++-- test/integration/lke_clusters_acl_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lke_clusters_acl.go b/lke_clusters_acl.go index 57494b618..e6c3646d4 100644 --- a/lke_clusters_acl.go +++ b/lke_clusters_acl.go @@ -12,8 +12,8 @@ type LKEClusterControlPlaneACLAddresses struct { // LKEClusterControlPlaneACL describes the ACL configuration // for an LKE cluster's control plane. type LKEClusterControlPlaneACL struct { - Enabled bool `json:"enabled,omitempty"` - Addresses LKEClusterControlPlaneACLAddresses `json:"addresses,omitempty"` + Enabled bool `json:"enabled,omitempty"` + Addresses *LKEClusterControlPlaneACLAddresses `json:"addresses,omitempty"` } // LKEClusterControlPlaneACLUpdateOptions represents the options diff --git a/test/integration/lke_clusters_acl_test.go b/test/integration/lke_clusters_acl_test.go index 4ba0cc4c5..3524fbbc0 100644 --- a/test/integration/lke_clusters_acl_test.go +++ b/test/integration/lke_clusters_acl_test.go @@ -18,7 +18,7 @@ func TestLKECluster_withACL(t *testing.T) { options.ControlPlane = &linodego.LKEClusterControlPlane{ ACL: &linodego.LKEClusterControlPlaneACL{ Enabled: true, - Addresses: linodego.LKEClusterControlPlaneACLAddresses{ + Addresses: &linodego.LKEClusterControlPlaneACLAddresses{ IPv4: []string{"10.0.0.1/32"}, IPv6: []string{"1234::5678"}, }, From 1bbab93e6802ad9e505bfef0fa059e448255f3af Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Mon, 29 Apr 2024 13:09:03 -0400 Subject: [PATCH 09/15] oops again --- test/integration/lke_clusters_acl_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/lke_clusters_acl_test.go b/test/integration/lke_clusters_acl_test.go index 3524fbbc0..234e2d8b4 100644 --- a/test/integration/lke_clusters_acl_test.go +++ b/test/integration/lke_clusters_acl_test.go @@ -49,7 +49,7 @@ func TestLKECluster_withACL(t *testing.T) { linodego.LKEClusterControlPlaneACLUpdateOptions{ ACL: linodego.LKEClusterControlPlaneACL{ Enabled: true, - Addresses: linodego.LKEClusterControlPlaneACLAddresses{ + Addresses: &linodego.LKEClusterControlPlaneACLAddresses{ IPv4: []string{"10.0.0.2/32"}, IPv6: []string{}, }, From f2219b4c1f6bf809d08391213f51f92995faae12 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Mon, 29 Apr 2024 13:31:04 -0400 Subject: [PATCH 10/15] Make enabled a *bool --- lke_clusters_acl.go | 2 +- .../fixtures/TestLKECluster_withACL.yaml | 26 +++++++++---------- test/integration/lke_clusters_acl_test.go | 12 +++++---- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/lke_clusters_acl.go b/lke_clusters_acl.go index e6c3646d4..74dda1d60 100644 --- a/lke_clusters_acl.go +++ b/lke_clusters_acl.go @@ -12,7 +12,7 @@ type LKEClusterControlPlaneACLAddresses struct { // LKEClusterControlPlaneACL describes the ACL configuration // for an LKE cluster's control plane. type LKEClusterControlPlaneACL struct { - Enabled bool `json:"enabled,omitempty"` + Enabled *bool `json:"enabled,omitempty"` Addresses *LKEClusterControlPlaneACLAddresses `json:"addresses,omitempty"` } diff --git a/test/integration/fixtures/TestLKECluster_withACL.yaml b/test/integration/fixtures/TestLKECluster_withACL.yaml index 690198c4c..24d2c2a83 100644 --- a/test/integration/fixtures/TestLKECluster_withACL.yaml +++ b/test/integration/fixtures/TestLKECluster_withACL.yaml @@ -269,7 +269,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 17:01:06 GMT + - Mon, 29 Apr 2024 17:28:41 GMT Pragma: - no-cache Strict-Transport-Security: @@ -307,7 +307,7 @@ interactions: url: https://api.linode.com/v4beta/lke/clusters method: POST response: - body: '{"id": 173783, "status": "ready", "created": "2018-01-02T03:04:05", "updated": + body: '{"id": 173796, "status": "ready", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "label": "go-test-def", "region": "ap-west", "k8s_version": "1.29", "control_plane": {"high_availability": false}, "tags": ["testing"]}' headers: @@ -332,7 +332,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 17:01:34 GMT + - Mon, 29 Apr 2024 17:29:09 GMT Pragma: - no-cache Strict-Transport-Security: @@ -365,7 +365,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173783/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/173796/control_plane_acl method: GET response: body: '{"acl": {"enabled": true, "addresses": {"ipv4": ["10.0.0.1/32"], "ipv6": @@ -392,7 +392,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 17:01:35 GMT + - Mon, 29 Apr 2024 17:29:10 GMT Pragma: - no-cache Strict-Transport-Security: @@ -426,7 +426,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173783/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/173796/control_plane_acl method: PUT response: body: '{"acl": {"enabled": true, "addresses": {"ipv4": ["10.0.0.2/32"]}}}' @@ -452,7 +452,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 17:01:38 GMT + - Mon, 29 Apr 2024 17:29:13 GMT Pragma: - no-cache Strict-Transport-Security: @@ -485,7 +485,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173783/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/173796/control_plane_acl method: DELETE response: body: '{}' @@ -511,7 +511,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 17:01:41 GMT + - Mon, 29 Apr 2024 17:29:15 GMT Pragma: - no-cache Strict-Transport-Security: @@ -544,7 +544,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173783/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/173796/control_plane_acl method: GET response: body: '{"acl": {"enabled": false, "addresses": null}}' @@ -570,7 +570,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 17:01:41 GMT + - Mon, 29 Apr 2024 17:29:16 GMT Pragma: - no-cache Strict-Transport-Security: @@ -604,7 +604,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/173783 + url: https://api.linode.com/v4beta/lke/clusters/173796 method: DELETE response: body: '{}' @@ -630,7 +630,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 29 Apr 2024 17:02:04 GMT + - Mon, 29 Apr 2024 17:29:38 GMT Pragma: - no-cache Strict-Transport-Security: diff --git a/test/integration/lke_clusters_acl_test.go b/test/integration/lke_clusters_acl_test.go index 234e2d8b4..26cb1d907 100644 --- a/test/integration/lke_clusters_acl_test.go +++ b/test/integration/lke_clusters_acl_test.go @@ -11,13 +11,15 @@ import ( ) func TestLKECluster_withACL(t *testing.T) { + valueTrue := true + client, cluster, teardown, err := setupLKECluster( t, []clusterModifier{ func(options *linodego.LKEClusterCreateOptions) { options.ControlPlane = &linodego.LKEClusterControlPlane{ ACL: &linodego.LKEClusterControlPlaneACL{ - Enabled: true, + Enabled: &valueTrue, Addresses: &linodego.LKEClusterControlPlaneACLAddresses{ IPv4: []string{"10.0.0.1/32"}, IPv6: []string{"1234::5678"}, @@ -39,7 +41,7 @@ func TestLKECluster_withACL(t *testing.T) { acl, err := client.GetLKEClusterControlPlaneACL(context.Background(), cluster.ID) assert.NoError(t, err) - require.Equal(t, true, acl.ACL.Enabled) + require.Equal(t, true, *acl.ACL.Enabled) require.Equal(t, "10.0.0.1/32", acl.ACL.Addresses.IPv4[0]) require.Equal(t, "1234::5678/128", acl.ACL.Addresses.IPv6[0]) @@ -48,7 +50,7 @@ func TestLKECluster_withACL(t *testing.T) { cluster.ID, linodego.LKEClusterControlPlaneACLUpdateOptions{ ACL: linodego.LKEClusterControlPlaneACL{ - Enabled: true, + Enabled: &valueTrue, Addresses: &linodego.LKEClusterControlPlaneACLAddresses{ IPv4: []string{"10.0.0.2/32"}, IPv6: []string{}, @@ -58,7 +60,7 @@ func TestLKECluster_withACL(t *testing.T) { ) require.NoError(t, err) - require.Equal(t, true, acl.ACL.Enabled) + require.Equal(t, true, *acl.ACL.Enabled) require.Equal(t, "10.0.0.2/32", acl.ACL.Addresses.IPv4[0]) require.Equal(t, 0, len(acl.ACL.Addresses.IPv6)) @@ -68,5 +70,5 @@ func TestLKECluster_withACL(t *testing.T) { acl, err = client.GetLKEClusterControlPlaneACL(context.Background(), cluster.ID) assert.NoError(t, err) - assert.Equal(t, false, acl.ACL.Enabled) + assert.Equal(t, false, *acl.ACL.Enabled) } From 4deed73f838566a7a7446737ef8b173094d1c656 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Mon, 29 Apr 2024 15:14:19 -0400 Subject: [PATCH 11/15] [PROPOSED] breaking change --- lke_clusters.go | 44 +++++++++++-------- ...rs_acl.go => lke_clusters_control_plane.go | 33 +++++++++++--- test/integration/lke_clusters_acl_test.go | 17 +++---- test/integration/lke_clusters_test.go | 5 ++- 4 files changed, 62 insertions(+), 37 deletions(-) rename lke_clusters_acl.go => lke_clusters_control_plane.go (70%) diff --git a/lke_clusters.go b/lke_clusters.go index 47384d9be..7cc6d77a5 100644 --- a/lke_clusters.go +++ b/lke_clusters.go @@ -35,20 +35,20 @@ type LKECluster struct { // LKEClusterCreateOptions fields are those accepted by CreateLKECluster type LKEClusterCreateOptions struct { - NodePools []LKENodePoolCreateOptions `json:"node_pools"` - Label string `json:"label"` - Region string `json:"region"` - K8sVersion string `json:"k8s_version"` - Tags []string `json:"tags,omitempty"` - ControlPlane *LKEClusterControlPlane `json:"control_plane,omitempty"` + NodePools []LKENodePoolCreateOptions `json:"node_pools"` + Label string `json:"label"` + Region string `json:"region"` + K8sVersion string `json:"k8s_version"` + Tags []string `json:"tags,omitempty"` + ControlPlane *LKEClusterControlPlaneOptions `json:"control_plane,omitempty"` } // LKEClusterUpdateOptions fields are those accepted by UpdateLKECluster type LKEClusterUpdateOptions struct { - K8sVersion string `json:"k8s_version,omitempty"` - Label string `json:"label,omitempty"` - Tags *[]string `json:"tags,omitempty"` - ControlPlane *LKEClusterControlPlane `json:"control_plane,omitempty"` + K8sVersion string `json:"k8s_version,omitempty"` + Label string `json:"label,omitempty"` + Tags *[]string `json:"tags,omitempty"` + ControlPlane *LKEClusterControlPlaneOptions `json:"control_plane,omitempty"` } // LKEClusterAPIEndpoint fields are those returned by ListLKEClusterAPIEndpoints @@ -66,12 +66,6 @@ type LKEClusterDashboard struct { URL string `json:"url"` } -// LKEClusterControlPlane fields contained within the `control_plane` attribute of an LKE cluster. -type LKEClusterControlPlane struct { - HighAvailability bool `json:"high_availability,omitempty"` - ACL *LKEClusterControlPlaneACL `json:"acl,omitempty"` -} - // LKEVersion fields are those returned by GetLKEVersion type LKEVersion struct { ID string `json:"id"` @@ -111,7 +105,14 @@ func (i LKECluster) GetCreateOptions() (o LKEClusterCreateOptions) { o.Region = i.Region o.K8sVersion = i.K8sVersion o.Tags = i.Tags - o.ControlPlane = &i.ControlPlane + + isHA := i.ControlPlane.HighAvailability + + o.ControlPlane = &LKEClusterControlPlaneOptions{ + HighAvailability: &isHA, + // ACL will not be populated in the control plane response + } + // @TODO copy NodePools? return } @@ -121,7 +122,14 @@ func (i LKECluster) GetUpdateOptions() (o LKEClusterUpdateOptions) { o.K8sVersion = i.K8sVersion o.Label = i.Label o.Tags = &i.Tags - o.ControlPlane = &i.ControlPlane + + isHA := i.ControlPlane.HighAvailability + + o.ControlPlane = &LKEClusterControlPlaneOptions{ + HighAvailability: &isHA, + // ACL will not be populated in the control plane response + } + return } diff --git a/lke_clusters_acl.go b/lke_clusters_control_plane.go similarity index 70% rename from lke_clusters_acl.go rename to lke_clusters_control_plane.go index 74dda1d60..dd678661b 100644 --- a/lke_clusters_acl.go +++ b/lke_clusters_control_plane.go @@ -2,6 +2,11 @@ package linodego import "context" +// LKEClusterControlPlane fields contained within the `control_plane` attribute of an LKE cluster. +type LKEClusterControlPlane struct { + HighAvailability bool `json:"high_availability"` +} + // LKEClusterControlPlaneACLAddresses describes the // allowed IP ranges for an LKE cluster's control plane. type LKEClusterControlPlaneACLAddresses struct { @@ -12,21 +17,35 @@ type LKEClusterControlPlaneACLAddresses struct { // LKEClusterControlPlaneACL describes the ACL configuration // for an LKE cluster's control plane. type LKEClusterControlPlaneACL struct { + Enabled bool `json:"enabled"` + Addresses *LKEClusterControlPlaneACLAddresses `json:"addresses"` +} + +// LKEClusterControlPlaneACLResponse represents the response structure +// for the Client.GetLKEClusterControlPlaneACL(...) method. +type LKEClusterControlPlaneACLResponse struct { + ACL LKEClusterControlPlaneACL `json:"acl"` +} + +// LKEClusterControlPlaneACLOptions represents the options used when +// configuring an LKE cluster's control plane ACL policy. +type LKEClusterControlPlaneACLOptions struct { Enabled *bool `json:"enabled,omitempty"` Addresses *LKEClusterControlPlaneACLAddresses `json:"addresses,omitempty"` } +// LKEClusterControlPlaneOptions represents the options used when +// configuring an LKE cluster's control plane. +type LKEClusterControlPlaneOptions struct { + HighAvailability *bool `json:"high_availability,omitempty"` + ACL *LKEClusterControlPlaneACLOptions `json:"acl,omitempty"` +} + // LKEClusterControlPlaneACLUpdateOptions represents the options // available when updating the ACL configuration of an LKE cluster's // control plane. type LKEClusterControlPlaneACLUpdateOptions struct { - ACL LKEClusterControlPlaneACL `json:"acl"` -} - -// LKEClusterControlPlaneACLResponse represents the response structure -// for the Client.GetLKEClusterControlPlaneACL(...) method. -type LKEClusterControlPlaneACLResponse struct { - ACL LKEClusterControlPlaneACL `json:"acl"` + ACL LKEClusterControlPlaneACLOptions `json:"acl"` } // GetLKEClusterControlPlaneACL gets the ACL configuration for the diff --git a/test/integration/lke_clusters_acl_test.go b/test/integration/lke_clusters_acl_test.go index 26cb1d907..3508a2eac 100644 --- a/test/integration/lke_clusters_acl_test.go +++ b/test/integration/lke_clusters_acl_test.go @@ -17,8 +17,8 @@ func TestLKECluster_withACL(t *testing.T) { t, []clusterModifier{ func(options *linodego.LKEClusterCreateOptions) { - options.ControlPlane = &linodego.LKEClusterControlPlane{ - ACL: &linodego.LKEClusterControlPlaneACL{ + options.ControlPlane = &linodego.LKEClusterControlPlaneOptions{ + ACL: &linodego.LKEClusterControlPlaneACLOptions{ Enabled: &valueTrue, Addresses: &linodego.LKEClusterControlPlaneACLAddresses{ IPv4: []string{"10.0.0.1/32"}, @@ -33,15 +33,10 @@ func TestLKECluster_withACL(t *testing.T) { require.NoError(t, err) defer teardown() - // TODO: Not currently populated in response, uncomment when available - // require.Equal(t, true, cluster.ControlPlane.ACL.Enabled) - // require.Equal(t, "10.0.0.1/32", cluster.ControlPlane.ACL.Addresses.IPv4[0]) - // require.Equal(t, "1234::5678", cluster.ControlPlane.ACL.Addresses.IPv6[0]) - acl, err := client.GetLKEClusterControlPlaneACL(context.Background(), cluster.ID) assert.NoError(t, err) - require.Equal(t, true, *acl.ACL.Enabled) + require.Equal(t, true, acl.ACL.Enabled) require.Equal(t, "10.0.0.1/32", acl.ACL.Addresses.IPv4[0]) require.Equal(t, "1234::5678/128", acl.ACL.Addresses.IPv6[0]) @@ -49,7 +44,7 @@ func TestLKECluster_withACL(t *testing.T) { context.Background(), cluster.ID, linodego.LKEClusterControlPlaneACLUpdateOptions{ - ACL: linodego.LKEClusterControlPlaneACL{ + ACL: linodego.LKEClusterControlPlaneACLOptions{ Enabled: &valueTrue, Addresses: &linodego.LKEClusterControlPlaneACLAddresses{ IPv4: []string{"10.0.0.2/32"}, @@ -60,7 +55,7 @@ func TestLKECluster_withACL(t *testing.T) { ) require.NoError(t, err) - require.Equal(t, true, *acl.ACL.Enabled) + require.Equal(t, true, acl.ACL.Enabled) require.Equal(t, "10.0.0.2/32", acl.ACL.Addresses.IPv4[0]) require.Equal(t, 0, len(acl.ACL.Addresses.IPv6)) @@ -70,5 +65,5 @@ func TestLKECluster_withACL(t *testing.T) { acl, err = client.GetLKEClusterControlPlaneACL(context.Background(), cluster.ID) assert.NoError(t, err) - assert.Equal(t, false, *acl.ACL.Enabled) + assert.Equal(t, false, acl.ACL.Enabled) } diff --git a/test/integration/lke_clusters_test.go b/test/integration/lke_clusters_test.go index 830aed91e..f94c6b400 100644 --- a/test/integration/lke_clusters_test.go +++ b/test/integration/lke_clusters_test.go @@ -75,7 +75,10 @@ func TestLKECluster_Update(t *testing.T) { updatedTags := []string{"test=true"} updatedLabel := cluster.Label + "-updated" updatedK8sVersion := "1.23" - updatedControlPlane := &linodego.LKEClusterControlPlane{HighAvailability: true} + isHA := true + + updatedControlPlane := &linodego.LKEClusterControlPlaneOptions{HighAvailability: &isHA} + updatedCluster, err := client.UpdateLKECluster(context.TODO(), cluster.ID, linodego.LKEClusterUpdateOptions{ Tags: &updatedTags, Label: updatedLabel, From 6f2d41901fadb2fe820c6d40b7f4644dc93ce505 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Mon, 29 Apr 2024 15:54:04 -0400 Subject: [PATCH 12/15] fix test --- test/integration/lke_clusters_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/lke_clusters_test.go b/test/integration/lke_clusters_test.go index f94c6b400..244ffdcd6 100644 --- a/test/integration/lke_clusters_test.go +++ b/test/integration/lke_clusters_test.go @@ -101,7 +101,7 @@ func TestLKECluster_Update(t *testing.T) { t.Errorf("expected tags to be updated to %#v; got %#v", updatedTags, updatedCluster.Tags) } - if !reflect.DeepEqual(*updatedControlPlane, updatedCluster.ControlPlane) { + if !reflect.DeepEqual(*updatedControlPlane.HighAvailability, updatedCluster.ControlPlane.HighAvailability) { t.Errorf("expected control plane to be updated to %#v; got %#v", updatedControlPlane, updatedCluster.ControlPlane) } } From ac5c2482470a6c9dc78e869e7307c3acebf4a4fe Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Thu, 2 May 2024 12:13:44 -0400 Subject: [PATCH 13/15] Use pointers for addresses --- lke_clusters_control_plane.go | 15 +++++++++++---- test/integration/lke_clusters_acl_test.go | 12 ++++++------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lke_clusters_control_plane.go b/lke_clusters_control_plane.go index dd678661b..9d5806689 100644 --- a/lke_clusters_control_plane.go +++ b/lke_clusters_control_plane.go @@ -10,8 +10,8 @@ type LKEClusterControlPlane struct { // LKEClusterControlPlaneACLAddresses describes the // allowed IP ranges for an LKE cluster's control plane. type LKEClusterControlPlaneACLAddresses struct { - IPv4 []string `json:"ipv4,omitempty"` - IPv6 []string `json:"ipv6,omitempty"` + IPv4 []string `json:"ipv4"` + IPv6 []string `json:"ipv6"` } // LKEClusterControlPlaneACL describes the ACL configuration @@ -27,11 +27,18 @@ type LKEClusterControlPlaneACLResponse struct { ACL LKEClusterControlPlaneACL `json:"acl"` } +// LKEClusterControlPlaneACLAddressesOptions are the options used to +// specify the allowed IP ranges for an LKE cluster's control plane. +type LKEClusterControlPlaneACLAddressesOptions struct { + IPv4 *[]string `json:"ipv4,omitempty"` + IPv6 *[]string `json:"ipv6,omitempty"` +} + // LKEClusterControlPlaneACLOptions represents the options used when // configuring an LKE cluster's control plane ACL policy. type LKEClusterControlPlaneACLOptions struct { - Enabled *bool `json:"enabled,omitempty"` - Addresses *LKEClusterControlPlaneACLAddresses `json:"addresses,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Addresses *LKEClusterControlPlaneACLAddressesOptions `json:"addresses,omitempty"` } // LKEClusterControlPlaneOptions represents the options used when diff --git a/test/integration/lke_clusters_acl_test.go b/test/integration/lke_clusters_acl_test.go index 3508a2eac..6d85b74bf 100644 --- a/test/integration/lke_clusters_acl_test.go +++ b/test/integration/lke_clusters_acl_test.go @@ -20,9 +20,9 @@ func TestLKECluster_withACL(t *testing.T) { options.ControlPlane = &linodego.LKEClusterControlPlaneOptions{ ACL: &linodego.LKEClusterControlPlaneACLOptions{ Enabled: &valueTrue, - Addresses: &linodego.LKEClusterControlPlaneACLAddresses{ - IPv4: []string{"10.0.0.1/32"}, - IPv6: []string{"1234::5678"}, + Addresses: &linodego.LKEClusterControlPlaneACLAddressesOptions{ + IPv4: &[]string{"10.0.0.1/32"}, + IPv6: &[]string{"1234::5678"}, }, }, } @@ -46,9 +46,9 @@ func TestLKECluster_withACL(t *testing.T) { linodego.LKEClusterControlPlaneACLUpdateOptions{ ACL: linodego.LKEClusterControlPlaneACLOptions{ Enabled: &valueTrue, - Addresses: &linodego.LKEClusterControlPlaneACLAddresses{ - IPv4: []string{"10.0.0.2/32"}, - IPv6: []string{}, + Addresses: &linodego.LKEClusterControlPlaneACLAddressesOptions{ + IPv4: &[]string{"10.0.0.2/32"}, + IPv6: &[]string{}, }, }, }, From a8843f9261fae65ebc5a9ef2f52cc7d27f855709 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Thu, 2 May 2024 12:19:54 -0400 Subject: [PATCH 14/15] Reorder for readability --- lke_clusters_control_plane.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lke_clusters_control_plane.go b/lke_clusters_control_plane.go index 9d5806689..01fd36195 100644 --- a/lke_clusters_control_plane.go +++ b/lke_clusters_control_plane.go @@ -21,12 +21,6 @@ type LKEClusterControlPlaneACL struct { Addresses *LKEClusterControlPlaneACLAddresses `json:"addresses"` } -// LKEClusterControlPlaneACLResponse represents the response structure -// for the Client.GetLKEClusterControlPlaneACL(...) method. -type LKEClusterControlPlaneACLResponse struct { - ACL LKEClusterControlPlaneACL `json:"acl"` -} - // LKEClusterControlPlaneACLAddressesOptions are the options used to // specify the allowed IP ranges for an LKE cluster's control plane. type LKEClusterControlPlaneACLAddressesOptions struct { @@ -55,6 +49,12 @@ type LKEClusterControlPlaneACLUpdateOptions struct { ACL LKEClusterControlPlaneACLOptions `json:"acl"` } +// LKEClusterControlPlaneACLResponse represents the response structure +// for the Client.GetLKEClusterControlPlaneACL(...) method. +type LKEClusterControlPlaneACLResponse struct { + ACL LKEClusterControlPlaneACL `json:"acl"` +} + // GetLKEClusterControlPlaneACL gets the ACL configuration for the // given cluster's control plane. func (c *Client) GetLKEClusterControlPlaneACL(ctx context.Context, clusterID int) (*LKEClusterControlPlaneACLResponse, error) { From 34c518aa78f297306db63f56bc963fe60630ce2f Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Wed, 8 May 2024 10:31:13 -0400 Subject: [PATCH 15/15] Address comment feedback --- go.work.sum | 4 ++-- lke_clusters_control_plane.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.work.sum b/go.work.sum index 6991c5ca4..87323275f 100644 --- a/go.work.sum +++ b/go.work.sum @@ -50,8 +50,6 @@ github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 h1:cqQfy1jclcSy/FwLje github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= @@ -119,6 +117,7 @@ github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEo github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= @@ -264,6 +263,7 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c h1:GohjlNKauSai7gN4wsJkeZ3WAJx4Sh+oT/b5IYn5suA= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks= k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= diff --git a/lke_clusters_control_plane.go b/lke_clusters_control_plane.go index 01fd36195..d71da8ab1 100644 --- a/lke_clusters_control_plane.go +++ b/lke_clusters_control_plane.go @@ -65,7 +65,7 @@ func (c *Client) GetLKEClusterControlPlaneACL(ctx context.Context, clusterID int ) } -// UpdateLKEClusterControlPlaneACL gets the ACL configuration for the +// UpdateLKEClusterControlPlaneACL updates the ACL configuration for the // given cluster's control plane. func (c *Client) UpdateLKEClusterControlPlaneACL( ctx context.Context,