Skip to content

Commit 3607eff

Browse files
authored
Merge pull request #158 from jnschaeffer/add-lke-disks
Add LKEClusterPoolDisk type and disks field to LKEClusterPool
2 parents c0466fb + 04f57bd commit 3607eff

File tree

4 files changed

+132
-138
lines changed

4 files changed

+132
-138
lines changed

lke_cluster_pools.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ const (
1616
LKELinodeNotReady LKELinodeStatus = "not_ready"
1717
)
1818

19+
// LKEClusterPoolDisk represents a Node disk in an LKEClusterPool object
20+
type LKEClusterPoolDisk struct {
21+
Size int `json:"size"`
22+
Type string `json:"type"`
23+
}
24+
1925
// LKEClusterPoolLinode represents a LKEClusterPoolLinode object
2026
type LKEClusterPoolLinode struct {
2127
ID string `json:"id"`
@@ -28,13 +34,15 @@ type LKEClusterPool struct {
2834
ID int `json:"id"`
2935
Count int `json:"count"`
3036
Type string `json:"type"`
37+
Disks []LKEClusterPoolDisk `json:"disks"`
3138
Linodes []LKEClusterPoolLinode `json:"nodes"`
3239
}
3340

3441
// LKEClusterPoolCreateOptions fields are those accepted by CreateLKEClusterPool
3542
type LKEClusterPoolCreateOptions struct {
36-
Count int `json:"count"`
37-
Type string `json:"type"`
43+
Count int `json:"count"`
44+
Type string `json:"type"`
45+
Disks []LKEClusterPoolDisk `json:"disks"`
3846
}
3947

4048
// LKEClusterPoolUpdateOptions fields are those accepted by UpdateLKEClusterPool
@@ -46,6 +54,7 @@ type LKEClusterPoolUpdateOptions struct {
4654
// use in CreateLKEClusterPool
4755
func (l LKEClusterPool) GetCreateOptions() (o LKEClusterPoolCreateOptions) {
4856
o.Count = l.Count
57+
o.Disks = l.Disks
4958
return
5059
}
5160

test/integration/fixtures/TestGetLKEClusterPool_found.yaml

Lines changed: 54 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
version: 1
33
interactions:
44
- request:
5-
body: '{"node_pools":[{"count":1,"type":"g6-standard-2"}],"label":"a83ef3go2h76-linodego-testing","region":"us-central","k8s_version":"1.17","tags":["testing"]}'
5+
body: '{"node_pools":[{"count":1,"type":"g6-standard-2","disks":null}],"label":"a83ef3go2h76-linodego-testing","region":"us-central","k8s_version":"1.17","tags":["testing"]}'
66
form: {}
77
headers:
88
Accept:
99
- application/json
1010
Content-Type:
1111
- application/json
1212
User-Agent:
13-
- linodego 0.12.0 https://github.com/linode/linodego
13+
- linodego https://github.com/linode/linodego
1414
url: https://api.linode.com/v4beta/lke/clusters
1515
method: POST
1616
response:
17-
body: '{"id": 888, "status": "ready", "created": "2018-01-02T03:04:05", "updated":
17+
body: '{"id": 8263, "status": "ready", "created": "2018-01-02T03:04:05", "updated":
1818
"2018-01-02T03:04:05", "label": "a83ef3go2h76-linodego-testing", "region": "us-central",
19-
"k8s_version": "1.17", "tags": []}'
19+
"k8s_version": "1.17", "tags": ["testing"]}'
2020
headers:
2121
Access-Control-Allow-Credentials:
2222
- "true"
@@ -30,18 +30,16 @@ interactions:
3030
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
3131
Cache-Control:
3232
- private, max-age=60, s-maxage=60
33-
Connection:
34-
- keep-alive
3533
Content-Length:
36-
- "195"
34+
- "209"
3735
Content-Security-Policy:
3836
- default-src 'none'
3937
Content-Type:
4038
- application/json
4139
Date:
42-
- Tue, 14 Jan 2020 18:56:46 GMT
40+
- Mon, 27 Jul 2020 16:30:56 GMT
4341
Retry-After:
44-
- "117"
42+
- "0"
4543
Server:
4644
- nginx
4745
Strict-Transport-Security:
@@ -58,33 +56,34 @@ interactions:
5856
X-Oauth-Scopes:
5957
- '*'
6058
X-Ratelimit-Limit:
61-
- "400"
59+
- "800"
6260
X-Ratelimit-Remaining:
63-
- "399"
61+
- "800"
6462
X-Ratelimit-Reset:
65-
- "1579028324"
63+
- "1595867456"
6664
X-Spec-Version:
67-
- 4.12.0
65+
- 4.69.2
6866
X-Xss-Protection:
6967
- 1; mode=block
7068
status: 200 OK
7169
code: 200
7270
duration: ""
7371
- request:
74-
body: ""
72+
body: '{"count":1,"type":"g6-standard-2","disks":[{"size":1000,"type":"ext4"}]}'
7573
form: {}
7674
headers:
7775
Accept:
7876
- application/json
7977
Content-Type:
8078
- application/json
8179
User-Agent:
82-
- linodego 0.12.0 https://github.com/linode/linodego
83-
url: https://api.linode.com/v4beta/lke/clusters/888/pools
84-
method: GET
80+
- linodego https://github.com/linode/linodego
81+
url: https://api.linode.com/v4beta/lke/clusters/8263/pools
82+
method: POST
8583
response:
86-
body: '{"data": [{"id": 1087, "type": "g6-standard-2", "count": 1, "linodes":
87-
[{"id": null, "status": "not_ready"}]}], "page": 1, "pages": 1, "results": 1}'
84+
body: '{"id": 10369, "type": "g6-standard-2", "count": 1, "nodes": [{"id": "10369-5f1f0140ad3e",
85+
"instance_id": null, "status": "not_ready"}], "disks": [{"size": 1000, "type":
86+
"ext4"}]}'
8887
headers:
8988
Access-Control-Allow-Credentials:
9089
- "true"
@@ -97,29 +96,25 @@ interactions:
9796
Access-Control-Expose-Headers:
9897
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
9998
Cache-Control:
100-
- private, max-age=0, s-maxage=0, no-cache, no-store
10199
- private, max-age=60, s-maxage=60
102-
Connection:
103-
- keep-alive
104100
Content-Length:
105-
- "148"
101+
- "178"
106102
Content-Security-Policy:
107103
- default-src 'none'
108104
Content-Type:
109105
- application/json
110106
Date:
111-
- Tue, 14 Jan 2020 18:56:46 GMT
107+
- Mon, 27 Jul 2020 16:30:56 GMT
112108
Retry-After:
113-
- "119"
109+
- "58"
114110
Server:
115111
- nginx
116112
Strict-Transport-Security:
117113
- max-age=31536000
118114
Vary:
119115
- Authorization, X-Filter
120-
- Authorization, X-Filter
121116
X-Accepted-Oauth-Scopes:
122-
- lke:read_only
117+
- lke:read_write
123118
X-Content-Type-Options:
124119
- nosniff
125120
X-Frame-Options:
@@ -128,13 +123,13 @@ interactions:
128123
X-Oauth-Scopes:
129124
- '*'
130125
X-Ratelimit-Limit:
131-
- "400"
126+
- "800"
132127
X-Ratelimit-Remaining:
133-
- "399"
128+
- "799"
134129
X-Ratelimit-Reset:
135-
- "1579028326"
130+
- "1595867515"
136131
X-Spec-Version:
137-
- 4.12.0
132+
- 4.69.2
138133
X-Xss-Protection:
139134
- 1; mode=block
140135
status: 200 OK
@@ -149,12 +144,13 @@ interactions:
149144
Content-Type:
150145
- application/json
151146
User-Agent:
152-
- linodego 0.12.0 https://github.com/linode/linodego
153-
url: https://api.linode.com/v4beta/lke/clusters/888/pools/1087
147+
- linodego https://github.com/linode/linodego
148+
url: https://api.linode.com/v4beta/lke/clusters/8263/pools/10369
154149
method: GET
155150
response:
156-
body: '{"id": 1087, "type": "g6-standard-2", "count": 1, "linodes": [{"id": null,
157-
"status": "not_ready"}]}'
151+
body: '{"id": 10369, "type": "g6-standard-2", "count": 1, "nodes": [{"id": "10369-5f1f0140ad3e",
152+
"instance_id": null, "status": "not_ready"}], "disks": [{"size": 1000, "type":
153+
"ext4"}]}'
158154
headers:
159155
Access-Control-Allow-Credentials:
160156
- "true"
@@ -169,18 +165,16 @@ interactions:
169165
Cache-Control:
170166
- private, max-age=0, s-maxage=0, no-cache, no-store
171167
- private, max-age=60, s-maxage=60
172-
Connection:
173-
- keep-alive
174168
Content-Length:
175-
- "99"
169+
- "178"
176170
Content-Security-Policy:
177171
- default-src 'none'
178172
Content-Type:
179173
- application/json
180174
Date:
181-
- Tue, 14 Jan 2020 18:56:46 GMT
175+
- Mon, 27 Jul 2020 16:30:56 GMT
182176
Retry-After:
183-
- "119"
177+
- "58"
184178
Server:
185179
- nginx
186180
Strict-Transport-Security:
@@ -198,13 +192,13 @@ interactions:
198192
X-Oauth-Scopes:
199193
- '*'
200194
X-Ratelimit-Limit:
201-
- "400"
195+
- "800"
202196
X-Ratelimit-Remaining:
203-
- "399"
197+
- "798"
204198
X-Ratelimit-Reset:
205-
- "1579028326"
199+
- "1595867515"
206200
X-Spec-Version:
207-
- 4.12.0
201+
- 4.69.2
208202
X-Xss-Protection:
209203
- 1; mode=block
210204
status: 200 OK
@@ -219,8 +213,8 @@ interactions:
219213
Content-Type:
220214
- application/json
221215
User-Agent:
222-
- linodego 0.12.0 https://github.com/linode/linodego
223-
url: https://api.linode.com/v4beta/lke/clusters/888/pools/1087
216+
- linodego https://github.com/linode/linodego
217+
url: https://api.linode.com/v4beta/lke/clusters/8263/pools/10369
224218
method: DELETE
225219
response:
226220
body: '{}'
@@ -237,18 +231,16 @@ interactions:
237231
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
238232
Cache-Control:
239233
- private, max-age=60, s-maxage=60
240-
Connection:
241-
- keep-alive
242234
Content-Length:
243235
- "2"
244236
Content-Security-Policy:
245237
- default-src 'none'
246238
Content-Type:
247239
- application/json
248240
Date:
249-
- Tue, 14 Jan 2020 18:56:46 GMT
241+
- Mon, 27 Jul 2020 16:30:57 GMT
250242
Retry-After:
251-
- "119"
243+
- "58"
252244
Server:
253245
- nginx
254246
Strict-Transport-Security:
@@ -265,13 +257,13 @@ interactions:
265257
X-Oauth-Scopes:
266258
- '*'
267259
X-Ratelimit-Limit:
268-
- "400"
260+
- "800"
269261
X-Ratelimit-Remaining:
270-
- "399"
262+
- "797"
271263
X-Ratelimit-Reset:
272-
- "1579028326"
264+
- "1595867516"
273265
X-Spec-Version:
274-
- 4.12.0
266+
- 4.69.2
275267
X-Xss-Protection:
276268
- 1; mode=block
277269
status: 200 OK
@@ -286,8 +278,8 @@ interactions:
286278
Content-Type:
287279
- application/json
288280
User-Agent:
289-
- linodego 0.12.0 https://github.com/linode/linodego
290-
url: https://api.linode.com/v4beta/lke/clusters/888
281+
- linodego https://github.com/linode/linodego
282+
url: https://api.linode.com/v4beta/lke/clusters/8263
291283
method: DELETE
292284
response:
293285
body: '{}'
@@ -304,18 +296,16 @@ interactions:
304296
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
305297
Cache-Control:
306298
- private, max-age=60, s-maxage=60
307-
Connection:
308-
- keep-alive
309299
Content-Length:
310300
- "2"
311301
Content-Security-Policy:
312302
- default-src 'none'
313303
Content-Type:
314304
- application/json
315305
Date:
316-
- Tue, 14 Jan 2020 18:56:46 GMT
306+
- Mon, 27 Jul 2020 16:30:57 GMT
317307
Retry-After:
318-
- "119"
308+
- "58"
319309
Server:
320310
- nginx
321311
Strict-Transport-Security:
@@ -332,13 +322,13 @@ interactions:
332322
X-Oauth-Scopes:
333323
- '*'
334324
X-Ratelimit-Limit:
335-
- "400"
325+
- "800"
336326
X-Ratelimit-Remaining:
337-
- "399"
327+
- "796"
338328
X-Ratelimit-Reset:
339-
- "1579028326"
329+
- "1595867516"
340330
X-Spec-Version:
341-
- 4.12.0
331+
- 4.69.2
342332
X-Xss-Protection:
343333
- 1; mode=block
344334
status: 200 OK

0 commit comments

Comments
 (0)