Skip to content

Commit d6838a7

Browse files
authored
Support LKE-E: Bring Your Own VPC, Dual Stack Cluster, Audit Log Enabling (#803)
* lkee * add stack type const * update monthly transfer fixture
1 parent 3f96d64 commit d6838a7

11 files changed

+1254
-249
lines changed

lke_clusters.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ const (
1818
LKEClusterNotReady LKEClusterStatus = "not_ready"
1919
)
2020

21+
type LKEClusterStackType string
22+
23+
const (
24+
LKEClusterStackIPv4 LKEClusterStackType = "ipv4"
25+
LKEClusterDualStack LKEClusterStackType = "ipv4-ipv6"
26+
)
27+
2128
// LKECluster represents a LKECluster object
2229
type LKECluster struct {
2330
ID int `json:"id"`
@@ -35,6 +42,11 @@ type LKECluster struct {
3542

3643
// NOTE: APLEnabled is currently in beta and may only function with API version v4beta.
3744
APLEnabled bool `json:"apl_enabled"`
45+
46+
// NOTE: SubnetID, VpcID, and StackType may not currently be available to all users and can only be used with v4beta.
47+
SubnetID int `json:"subnet_id"`
48+
VpcID int `json:"vpc_id"`
49+
StackType LKEClusterStackType `json:"stack_type"`
3850
}
3951

4052
// LKEClusterCreateOptions fields are those accepted by CreateLKECluster
@@ -51,6 +63,11 @@ type LKEClusterCreateOptions struct {
5163

5264
// NOTE: APLEnabled is currently in beta and may only function with API version v4beta.
5365
APLEnabled bool `json:"apl_enabled,omitempty"`
66+
67+
// NOTE: SubnetID, VpcID, and StackType may not currently be available to all users and can only be used with v4beta.
68+
SubnetID *int `json:"subnet_id,omitempty"`
69+
VpcID *int `json:"vpc_id,omitempty"`
70+
StackType *LKEClusterStackType `json:"stack_type,omitempty"`
5471
}
5572

5673
// LKEClusterUpdateOptions fields are those accepted by UpdateLKECluster

lke_clusters_control_plane.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import "context"
55
// LKEClusterControlPlane fields contained within the `control_plane` attribute of an LKE cluster.
66
type LKEClusterControlPlane struct {
77
HighAvailability bool `json:"high_availability"`
8+
9+
// AuditLogsEnabled may not currently be available to all users and can only be used with v4beta.
10+
AuditLogsEnabled bool `json:"audit_logs_enabled,omitempty"`
811
}
912

1013
// LKEClusterControlPlaneACLAddresses describes the
@@ -42,6 +45,9 @@ type LKEClusterControlPlaneACLOptions struct {
4245
type LKEClusterControlPlaneOptions struct {
4346
HighAvailability *bool `json:"high_availability,omitempty"`
4447
ACL *LKEClusterControlPlaneACLOptions `json:"acl,omitempty"`
48+
49+
// AuditLogsEnabled may not currently be available to all users and can only be used with v4beta.
50+
AuditLogsEnabled *bool `json:"audit_logs_enabled,omitempty"`
4551
}
4652

4753
// LKEClusterControlPlaneACLUpdateOptions represents the options

test/integration/fixtures/TestInstance_GetMonthlyTransfer.yaml

Lines changed: 320 additions & 245 deletions
Large diffs are not rendered by default.
Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
---
2+
version: 1
3+
interactions:
4+
- request:
5+
body: ""
6+
form: {}
7+
headers:
8+
Accept:
9+
- application/json
10+
Content-Type:
11+
- application/json
12+
User-Agent:
13+
- linodego/dev https://github.com/linode/linodego
14+
url: https://api.linode.com/v4beta/lke/tiers/enterprise/versions?page=1
15+
method: GET
16+
response:
17+
body: '{"data": [{"id": "v1.31.8+lke5", "tier": "enterprise"}], "page": 1, "pages":
18+
1, "results": 1}'
19+
headers:
20+
Access-Control-Allow-Credentials:
21+
- "true"
22+
Access-Control-Allow-Headers:
23+
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
24+
Access-Control-Allow-Methods:
25+
- HEAD, GET, OPTIONS, POST, PUT, DELETE
26+
Access-Control-Allow-Origin:
27+
- '*'
28+
Access-Control-Expose-Headers:
29+
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
30+
Akamai-Internal-Account:
31+
- '*'
32+
Cache-Control:
33+
- max-age=0, no-cache, no-store
34+
Connection:
35+
- keep-alive
36+
Content-Length:
37+
- "93"
38+
Content-Security-Policy:
39+
- default-src 'none'
40+
Content-Type:
41+
- application/json
42+
Expires:
43+
- Tue, 19 Aug 2025 16:56:21 GMT
44+
Pragma:
45+
- no-cache
46+
Strict-Transport-Security:
47+
- max-age=31536000
48+
Vary:
49+
- Authorization, X-Filter
50+
- Authorization, X-Filter
51+
X-Accepted-Oauth-Scopes:
52+
- lke:read_only
53+
X-Content-Type-Options:
54+
- nosniff
55+
X-Frame-Options:
56+
- DENY
57+
- DENY
58+
X-Oauth-Scopes:
59+
- '*'
60+
X-Xss-Protection:
61+
- 1; mode=block
62+
status: 200 OK
63+
code: 200
64+
duration: ""
65+
- request:
66+
body: '{"node_pools":[{"count":1,"type":"g6-standard-2","disks":null,"tags":["test"],"labels":null,"taints":null}],"label":"go-test-def","region":"no-osl-1","k8s_version":"v1.31.8+lke5","tags":["testing"],"tier":"enterprise","vpc_id":224219,"stack_type":"ipv4-ipv6"}'
67+
form: {}
68+
headers:
69+
Accept:
70+
- application/json
71+
Content-Type:
72+
- application/json
73+
User-Agent:
74+
- linodego/dev https://github.com/linode/linodego
75+
url: https://api.linode.com/v4beta/lke/clusters
76+
method: POST
77+
response:
78+
body: '{"id": 508689, "status": "ready", "created": "2018-01-02T03:04:05", "updated":
79+
"2018-01-02T03:04:05", "label": "go-test-def", "region": "no-osl-1", "k8s_version":
80+
"v1.31.8+lke5", "tier": "enterprise", "control_plane": {"high_availability":
81+
true, "audit_logs_enabled": false}, "apl_enabled": false, "vpc_id": 224219,
82+
"subnet_id": null, "tags": ["testing"], "stack_type": "ipv4-ipv6"}'
83+
headers:
84+
Access-Control-Allow-Credentials:
85+
- "true"
86+
Access-Control-Allow-Headers:
87+
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
88+
Access-Control-Allow-Methods:
89+
- HEAD, GET, OPTIONS, POST, PUT, DELETE
90+
Access-Control-Allow-Origin:
91+
- '*'
92+
Access-Control-Expose-Headers:
93+
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
94+
Akamai-Internal-Account:
95+
- '*'
96+
Cache-Control:
97+
- max-age=0, no-cache, no-store
98+
Connection:
99+
- keep-alive
100+
Content-Length:
101+
- "382"
102+
Content-Security-Policy:
103+
- default-src 'none'
104+
Content-Type:
105+
- application/json
106+
Expires:
107+
- Tue, 19 Aug 2025 16:56:27 GMT
108+
Pragma:
109+
- no-cache
110+
Strict-Transport-Security:
111+
- max-age=31536000
112+
Vary:
113+
- Authorization, X-Filter
114+
X-Accepted-Oauth-Scopes:
115+
- lke:read_write
116+
X-Content-Type-Options:
117+
- nosniff
118+
X-Frame-Options:
119+
- DENY
120+
- DENY
121+
X-Oauth-Scopes:
122+
- '*'
123+
X-Ratelimit-Limit:
124+
- "1840"
125+
X-Xss-Protection:
126+
- 1; mode=block
127+
status: 200 OK
128+
code: 200
129+
duration: ""
130+
- request:
131+
body: ""
132+
form: {}
133+
headers:
134+
Accept:
135+
- application/json
136+
Content-Type:
137+
- application/json
138+
User-Agent:
139+
- linodego/dev https://github.com/linode/linodego
140+
url: https://api.linode.com/v4beta/lke/clusters/508689
141+
method: GET
142+
response:
143+
body: '{"id": 508689, "status": "ready", "created": "2018-01-02T03:04:05", "updated":
144+
"2018-01-02T03:04:05", "label": "go-test-def", "region": "no-osl-1", "k8s_version":
145+
"v1.31.8+lke5", "tier": "enterprise", "control_plane": {"high_availability":
146+
true, "audit_logs_enabled": false}, "apl_enabled": false, "vpc_id": 224219,
147+
"subnet_id": null, "tags": ["testing"], "stack_type": "ipv4-ipv6"}'
148+
headers:
149+
Access-Control-Allow-Credentials:
150+
- "true"
151+
Access-Control-Allow-Headers:
152+
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
153+
Access-Control-Allow-Methods:
154+
- HEAD, GET, OPTIONS, POST, PUT, DELETE
155+
Access-Control-Allow-Origin:
156+
- '*'
157+
Access-Control-Expose-Headers:
158+
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
159+
Akamai-Internal-Account:
160+
- '*'
161+
Cache-Control:
162+
- max-age=0, no-cache, no-store
163+
Connection:
164+
- keep-alive
165+
Content-Length:
166+
- "382"
167+
Content-Security-Policy:
168+
- default-src 'none'
169+
Content-Type:
170+
- application/json
171+
Expires:
172+
- Tue, 19 Aug 2025 16:56:27 GMT
173+
Pragma:
174+
- no-cache
175+
Strict-Transport-Security:
176+
- max-age=31536000
177+
Vary:
178+
- Authorization, X-Filter
179+
- Authorization, X-Filter
180+
X-Accepted-Oauth-Scopes:
181+
- lke:read_only
182+
X-Content-Type-Options:
183+
- nosniff
184+
X-Frame-Options:
185+
- DENY
186+
- DENY
187+
X-Oauth-Scopes:
188+
- '*'
189+
X-Ratelimit-Limit:
190+
- "1840"
191+
X-Xss-Protection:
192+
- 1; mode=block
193+
status: 200 OK
194+
code: 200
195+
duration: ""
196+
- request:
197+
body: ""
198+
form: {}
199+
headers:
200+
Accept:
201+
- application/json
202+
Content-Type:
203+
- application/json
204+
User-Agent:
205+
- linodego/dev https://github.com/linode/linodego
206+
url: https://api.linode.com/v4beta/lke/clusters/508689
207+
method: DELETE
208+
response:
209+
body: '{}'
210+
headers:
211+
Access-Control-Allow-Credentials:
212+
- "true"
213+
Access-Control-Allow-Headers:
214+
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
215+
Access-Control-Allow-Methods:
216+
- HEAD, GET, OPTIONS, POST, PUT, DELETE
217+
Access-Control-Allow-Origin:
218+
- '*'
219+
Access-Control-Expose-Headers:
220+
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
221+
Akamai-Internal-Account:
222+
- '*'
223+
Cache-Control:
224+
- max-age=0, no-cache, no-store
225+
Connection:
226+
- keep-alive
227+
Content-Length:
228+
- "2"
229+
Content-Security-Policy:
230+
- default-src 'none'
231+
Content-Type:
232+
- application/json
233+
Expires:
234+
- Tue, 19 Aug 2025 16:56:29 GMT
235+
Pragma:
236+
- no-cache
237+
Strict-Transport-Security:
238+
- max-age=31536000
239+
Vary:
240+
- Authorization, X-Filter
241+
X-Accepted-Oauth-Scopes:
242+
- lke:read_write
243+
X-Content-Type-Options:
244+
- nosniff
245+
X-Frame-Options:
246+
- DENY
247+
- DENY
248+
X-Oauth-Scopes:
249+
- '*'
250+
X-Ratelimit-Limit:
251+
- "1840"
252+
X-Xss-Protection:
253+
- 1; mode=block
254+
status: 200 OK
255+
code: 200
256+
duration: ""

0 commit comments

Comments
 (0)