diff --git a/lke_clusters_control_plane.go b/lke_clusters_control_plane.go index 41dd10412..75b4d28c7 100644 --- a/lke_clusters_control_plane.go +++ b/lke_clusters_control_plane.go @@ -19,7 +19,7 @@ type LKEClusterControlPlaneACLAddresses struct { type LKEClusterControlPlaneACL struct { Enabled bool `json:"enabled"` Addresses *LKEClusterControlPlaneACLAddresses `json:"addresses"` - RevisionID string `json:"revision_id,omitempty"` + RevisionID string `json:"revision-id"` } // LKEClusterControlPlaneACLAddressesOptions are the options used to @@ -34,7 +34,7 @@ type LKEClusterControlPlaneACLAddressesOptions struct { type LKEClusterControlPlaneACLOptions struct { Enabled *bool `json:"enabled,omitempty"` Addresses *LKEClusterControlPlaneACLAddressesOptions `json:"addresses,omitempty"` - RevisionID string `json:"revision_id"` + RevisionID string `json:"revision-id,omitempty"` } // LKEClusterControlPlaneOptions represents the options used when diff --git a/test/integration/fixtures/TestLKECluster_withACL.yaml b/test/integration/fixtures/TestLKECluster_withACL.yaml index 921c43915..764a93201 100644 --- a/test/integration/fixtures/TestLKECluster_withACL.yaml +++ b/test/integration/fixtures/TestLKECluster_withACL.yaml @@ -348,7 +348,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 12 May 2025 18:58:03 GMT + - Mon, 19 May 2025 16:22:55 GMT Pragma: - no-cache Strict-Transport-Security: @@ -412,7 +412,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 12 May 2025 18:58:03 GMT + - Mon, 19 May 2025 16:22:55 GMT Pragma: - no-cache Strict-Transport-Security: @@ -435,7 +435,7 @@ interactions: code: 200 duration: "" - request: - body: '{"node_pools":[{"count":1,"type":"g6-standard-2","disks":null,"tags":["test"],"labels":null,"taints":null}],"label":"go-test-def","region":"ap-west","k8s_version":"1.32","tags":["testing"],"control_plane":{"acl":{"enabled":true,"addresses":{"ipv4":["10.0.0.1/32"],"ipv6":["1234::5678"]},"revision_id":""}},"tier":"standard"}' + body: '{"node_pools":[{"count":1,"type":"g6-standard-2","disks":null,"tags":["test"],"labels":null,"taints":null}],"label":"go-test-def","region":"ap-west","k8s_version":"1.32","tags":["testing"],"control_plane":{"acl":{"enabled":true,"addresses":{"ipv4":["10.0.0.1/32"],"ipv6":["1234::5678"]}}},"tier":"standard"}' form: {} headers: Accept: @@ -447,7 +447,7 @@ interactions: url: https://api.linode.com/v4beta/lke/clusters method: POST response: - body: '{"id": 433088, "status": "ready", "created": "2018-01-02T03:04:05", "updated": + body: '{"id": 444268, "status": "ready", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "label": "go-test-def", "region": "ap-west", "k8s_version": "1.32", "tier": "standard", "control_plane": {"high_availability": false}, "apl_enabled": false, "tags": ["testing"]}' @@ -475,7 +475,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 12 May 2025 18:58:16 GMT + - Mon, 19 May 2025 16:23:07 GMT Pragma: - no-cache Strict-Transport-Security: @@ -508,10 +508,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/433088/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/444268/control_plane_acl method: GET response: - body: '{"acl": {"enabled": true, "revision-id": "293cf17f455143a2b1aa7274b828fffd", + body: '{"acl": {"enabled": true, "revision-id": "8caa3c9d3da6426abcb99afde35e50b8", "addresses": {"ipv4": ["10.0.0.1/32"], "ipv6": ["1234::5678/128"]}}}' headers: Access-Control-Allow-Credentials: @@ -537,7 +537,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 12 May 2025 18:58:17 GMT + - Mon, 19 May 2025 16:23:08 GMT Pragma: - no-cache Strict-Transport-Security: @@ -562,7 +562,7 @@ interactions: code: 200 duration: "" - request: - body: '{"acl":{"enabled":true,"addresses":{"ipv4":["10.0.0.2/32"],"ipv6":[]},"revision_id":"test-revision-id"}}' + body: '{"acl":{"enabled":true,"addresses":{"ipv4":["10.0.0.2/32"],"ipv6":[]},"revision-id":"test-revision-id"}}' form: {} headers: Accept: @@ -571,11 +571,11 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/433088/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/444268/control_plane_acl method: PUT response: - body: '{"acl": {"enabled": true, "revision-id": "c6eb994b52604b0bb61c4e49f11a12e0", - "addresses": {"ipv4": ["10.0.0.2/32"], "ipv6": []}}}' + body: '{"acl": {"enabled": true, "revision-id": "test-revision-id", "addresses": + {"ipv4": ["10.0.0.2/32"], "ipv6": []}}}' headers: Access-Control-Allow-Credentials: - "true" @@ -594,13 +594,13 @@ interactions: Connection: - keep-alive Content-Length: - - "129" + - "113" Content-Security-Policy: - default-src 'none' Content-Type: - application/json Expires: - - Mon, 12 May 2025 18:58:22 GMT + - Mon, 19 May 2025 16:23:12 GMT Pragma: - no-cache Strict-Transport-Security: @@ -633,7 +633,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/433088/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/444268/control_plane_acl method: DELETE response: body: '{}' @@ -661,7 +661,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 12 May 2025 18:58:25 GMT + - Mon, 19 May 2025 16:23:15 GMT Pragma: - no-cache Strict-Transport-Security: @@ -694,7 +694,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/433088/control_plane_acl + url: https://api.linode.com/v4beta/lke/clusters/444268/control_plane_acl method: GET response: body: '{"acl": {"enabled": false, "addresses": {"ipv4": [], "ipv6": []}}}' @@ -722,7 +722,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 12 May 2025 18:58:26 GMT + - Mon, 19 May 2025 16:23:16 GMT Pragma: - no-cache Strict-Transport-Security: @@ -740,7 +740,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "1600" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -756,7 +756,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/lke/clusters/433088 + url: https://api.linode.com/v4beta/lke/clusters/444268 method: DELETE response: body: '{}' @@ -784,7 +784,7 @@ interactions: Content-Type: - application/json Expires: - - Mon, 12 May 2025 18:58:30 GMT + - Mon, 19 May 2025 16:23:20 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 f55ab0bb5..e31f903b0 100644 --- a/test/integration/lke_clusters_acl_test.go +++ b/test/integration/lke_clusters_acl_test.go @@ -40,6 +40,8 @@ func TestLKECluster_withACL(t *testing.T) { require.Equal(t, "10.0.0.1/32", acl.ACL.Addresses.IPv4[0]) require.Equal(t, "1234::5678/128", acl.ACL.Addresses.IPv6[0]) + testRevisionID := "test-revision-id" + acl, err = client.UpdateLKEClusterControlPlaneACL( context.Background(), cluster.ID, @@ -50,7 +52,7 @@ func TestLKECluster_withACL(t *testing.T) { IPv4: &[]string{"10.0.0.2/32"}, IPv6: &[]string{}, }, - RevisionID: "test-revision-id", + RevisionID: testRevisionID, }, }, ) @@ -59,6 +61,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, 0, len(acl.ACL.Addresses.IPv6)) + assert.Equal(t, testRevisionID, acl.ACL.RevisionID) err = client.DeleteLKEClusterControlPlaneACL(context.Background(), cluster.ID) require.NoError(t, err) diff --git a/test/unit/fixtures/lke_cluster_control_plane_acl_get.json b/test/unit/fixtures/lke_cluster_control_plane_acl_get.json index eab98af0b..bc6cb1ccd 100644 --- a/test/unit/fixtures/lke_cluster_control_plane_acl_get.json +++ b/test/unit/fixtures/lke_cluster_control_plane_acl_get.json @@ -5,6 +5,6 @@ "ipv4": ["192.168.1.1/32"], "ipv6": ["2001:db8::/32"] }, - "revision_id": "rev-abc123" + "revision-id": "rev-abc123" } } diff --git a/test/unit/fixtures/lke_cluster_control_plane_acl_update.json b/test/unit/fixtures/lke_cluster_control_plane_acl_update.json index 8f3b844ea..fb3d7c13e 100644 --- a/test/unit/fixtures/lke_cluster_control_plane_acl_update.json +++ b/test/unit/fixtures/lke_cluster_control_plane_acl_update.json @@ -5,6 +5,6 @@ "ipv4": ["10.0.0.1/32"], "ipv6": ["2001:db8::/64"] }, - "revision_id": "rev-abc124" + "revision-id": "rev-abc124" } }