Skip to content

Commit 5db8df3

Browse files
#534 add support for tags with nodepools
1 parent 5fe6ef9 commit 5db8df3

File tree

2 files changed

+38
-20
lines changed

2 files changed

+38
-20
lines changed

src/api/kubernetes.js

+8
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ exports.createNodePool = {
174174
plan: {
175175
type: 'string',
176176
required: true
177+
},
178+
tag: {
179+
type: 'string',
180+
required: false
177181
}
178182
}
179183
}
@@ -248,6 +252,10 @@ exports.updateNodePool = {
248252
node_quantity: {
249253
type: 'number',
250254
required: true
255+
},
256+
tag: {
257+
type: 'string',
258+
required: false
251259
}
252260
}
253261
}

test/api/kubernetes.test.js

+30-20
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const mockParameters = {
99
{
1010
node_quantity: 2,
1111
label: 'my-label',
12-
plan: 'vc2-1c-2gb'
12+
plan: 'vc2-1c-2gb',
13+
tag: 'my-tag'
1314
}
1415
]
1516
},
@@ -33,7 +34,8 @@ const mockParameters = {
3334
'vke-id': '455dcd32-e621-48ee-a10e-0cb5f754e13e',
3435
node_quantity: 2,
3536
label: 'nodepool',
36-
plan: 'vc2-1c-2gb'
37+
plan: 'vc2-1c-2gb',
38+
tag: 'my-tag'
3739
},
3840
listNodePools: {
3941
'vke-id': '455dcd32-e621-48ee-a10e-0cb5f754e13e'
@@ -85,9 +87,10 @@ const mockResponses = {
8587
date_created: '2021-07-07T22:57:01+00:00',
8688
date_updated: '2021-07-07T22:58:44+00:00',
8789
label: 'my-label-48770259',
88-
plan_id: 'vc2-1c-2gb',
90+
tag: 'my-tag',
91+
plan: 'vc2-1c-2gb',
8992
status: 'pending',
90-
count: 2,
93+
node_quantity: 2,
9194
nodes: [
9295
{
9396
id: '43eda5c8-67f7-4c63-88bc-2f568b48b2b0',
@@ -125,9 +128,10 @@ const mockResponses = {
125128
date_created: '2021-07-02T12:12:44+00:00',
126129
date_updated: '2021-07-03T12:12:44+00:00',
127130
label: 'nodepool-48597451',
128-
plan_id: 'vc2-1c-2gb',
131+
tag: 'my-tag',
132+
plan: 'vc2-1c-2gb',
129133
status: 'active',
130-
count: 2,
134+
node_quantity: 2,
131135
nodes: [
132136
{
133137
id: 'cafd4673-2a62-49c4-a045-44d05ecc0a7b',
@@ -162,9 +166,10 @@ const mockResponses = {
162166
date_created: '2021-07-07T22:57:01+00:00',
163167
date_updated: '2021-07-08T12:12:44+00:00',
164168
label: 'my-label-48770259',
165-
plan_id: 'vc2-1c-2gb',
169+
tag: 'my-tag',
170+
plan: 'vc2-1c-2gb',
166171
status: 'active',
167-
count: 2,
172+
node_quantity: 2,
168173
nodes: [
169174
{
170175
id: '43eda5c8-67f7-4c63-88bc-2f568b48b2b0',
@@ -209,9 +214,9 @@ const mockResponses = {
209214
date_created: '2021-07-07T22:57:01+00:00',
210215
date_updated: '2021-07-08T12:12:44+00:00',
211216
label: 'my-label-48770259',
212-
plan_id: 'vc2-1c-2gb',
217+
plan: 'vc2-1c-2gb',
213218
status: 'active',
214-
count: 2,
219+
node_quantity: 2,
215220
nodes: [
216221
{
217222
id: '43eda5c8-67f7-4c63-88bc-2f568b48b2b0',
@@ -262,9 +267,10 @@ const mockResponses = {
262267
date_created: '2021-07-07T23:29:18+00:00',
263268
date_updated: '2021-07-08T23:29:18+00:00',
264269
label: 'nodepool-48770716',
265-
plan_id: 'vc2-1c-2gb',
270+
tag: 'my-tag',
271+
plan: 'vc2-1c-2gb',
266272
status: 'pending',
267-
count: 2,
273+
node_quantity: 2,
268274
nodes: [
269275
{
270276
id: '2f863151-d784-4184-804e-31e4e60945bd',
@@ -288,9 +294,10 @@ const mockResponses = {
288294
date_created: '2021-07-07T23:27:08+00:00',
289295
date_updated: '2021-07-08T12:12:44+00:00',
290296
label: 'my-label-48770703',
291-
plan_id: 'vc2-1c-2gb',
297+
tag: 'my-tag',
298+
plan: 'vc2-1c-2gb',
292299
status: 'active',
293-
count: 2,
300+
node_quantity: 2,
294301
nodes: [
295302
{
296303
id: 'f2e11430-76e5-4dc6-a1c9-ef5682c21ddf',
@@ -310,9 +317,10 @@ const mockResponses = {
310317
id: '4130764b-5276-4552-546f-32513239732b',
311318
date_created: '2021-07-07T23:29:18+00:00',
312319
label: 'nodepool-48770716',
313-
plan_id: 'vc2-1c-2gb',
320+
tag: 'my-tag',
321+
plan: 'vc2-1c-2gb',
314322
status: 'active',
315-
count: 2,
323+
node_quantity: 2,
316324
nodes: [
317325
{
318326
id: '2f863151-d784-4184-804e-31e4e60945bd',
@@ -343,9 +351,10 @@ const mockResponses = {
343351
date_created: '2021-07-07T23:27:08+00:00',
344352
date_updated: '2021-07-08T12:12:44+00:00',
345353
label: 'my-label-48770703',
346-
plan_id: 'vc2-1c-2gb',
354+
tag: 'my-tag',
355+
plan: 'vc2-1c-2gb',
347356
status: 'active',
348-
count: 2,
357+
node_quantity: 2,
349358
nodes: [
350359
{
351360
id: 'f2e11430-76e5-4dc6-a1c9-ef5682c21ddf',
@@ -368,9 +377,10 @@ const mockResponses = {
368377
date_created: '2021-07-07T23:27:08+00:00',
369378
date_updated: '2021-07-08T12:12:44+00:00',
370379
label: 'my-label-48770703',
371-
plan_id: 'vc2-1c-2gb',
380+
tag: 'my-tag',
381+
plan: 'vc2-1c-2gb',
372382
status: 'active',
373-
count: 1,
383+
node_quantity: 1,
374384
nodes: [
375385
{
376386
id: 'f2e11430-76e5-4dc6-a1c9-ef5682c21ddf',

0 commit comments

Comments
 (0)