@rancher/shell 3.0.8 → 3.0.9-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apis/intf/modal.ts +38 -0
- package/apis/intf/slide-in.ts +3 -1
- package/apis/shell/__tests__/slide-in.test.ts +36 -0
- package/apis/shell/slide-in.ts +5 -1
- package/assets/styles/base/_color.scss +1 -0
- package/assets/styles/base/_typography.scss +14 -5
- package/assets/styles/themes/_light.scss +1 -1
- package/assets/styles/themes/_modern.scss +1 -1
- package/assets/translations/en-us.yaml +94 -33
- package/assets/translations/zh-hans.yaml +0 -2
- package/components/ActionMenuShell.vue +4 -4
- package/components/CodeMirror.vue +4 -3
- package/components/DetailText.vue +54 -7
- package/components/Drawer/Chrome.vue +11 -4
- package/components/Drawer/DrawerCard.vue +19 -0
- package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +3 -11
- package/components/Drawer/ResourceDetailDrawer/__tests__/ConfigTab.test.ts +2 -2
- package/components/Drawer/ResourceDetailDrawer/index.vue +3 -20
- package/components/Drawer/types.ts +1 -0
- package/components/DynamicContent/DynamicContentCloseButton.vue +2 -2
- package/components/LocaleSelector.vue +1 -1
- package/components/Markdown.vue +1 -1
- package/components/PopoverCard.vue +3 -3
- package/components/Resource/Detail/Card/ExtrasCard.vue +39 -0
- package/components/Resource/Detail/Card/StateCard/__tests__/composables.test.ts +142 -0
- package/components/Resource/Detail/Card/StateCard/composables.ts +41 -11
- package/components/Resource/Detail/Card/StateCard/index.vue +3 -9
- package/components/Resource/Detail/Card/StateCard/types.ts +6 -0
- package/components/Resource/Detail/Card/{PodsCard → StatusCard}/index.vue +11 -10
- package/components/Resource/Detail/Card/__tests__/PodsCard.test.ts +24 -25
- package/components/Resource/Detail/Cards.vue +27 -0
- package/components/Resource/Detail/Masthead/__tests__/index.test.ts +70 -0
- package/components/Resource/Detail/Masthead/index.vue +5 -0
- package/components/Resource/Detail/Metadata/KeyValueRow.vue +4 -2
- package/components/Resource/Detail/ResourcePopover/ResourcePopoverCard.vue +2 -2
- package/components/Resource/Detail/ResourceRow.types.ts +14 -0
- package/components/Resource/Detail/ResourceRow.vue +23 -35
- package/components/Resource/Detail/StatusRow.vue +5 -2
- package/components/Resource/Detail/TitleBar/__tests__/composables.test.ts +38 -7
- package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +106 -2
- package/components/Resource/Detail/TitleBar/composables.ts +2 -1
- package/components/Resource/Detail/TitleBar/index.vue +41 -6
- package/components/ResourceDetail/Masthead/__tests__/index.test.ts +49 -1
- package/components/ResourceDetail/Masthead/__tests__/latest.test.ts +85 -0
- package/components/ResourceDetail/Masthead/index.vue +1 -0
- package/components/ResourceDetail/Masthead/latest.vue +8 -1
- package/components/ResourceDetail/Masthead/legacy.vue +1 -1
- package/components/Setting.vue +1 -1
- package/components/SortableTable/index.vue +25 -0
- package/components/SortableTable/selection.js +25 -12
- package/components/SortableTable/sorting.js +1 -1
- package/components/Tabbed/Tab.vue +1 -0
- package/components/Tabbed/index.vue +29 -6
- package/components/Window/ContainerShell.vue +10 -13
- package/components/fleet/FleetClusterTargets/TargetsList.vue +47 -29
- package/components/fleet/FleetClusterTargets/index.vue +82 -29
- package/components/fleet/FleetClusters.vue +26 -12
- package/components/fleet/FleetGitRepoPaths.vue +2 -2
- package/components/fleet/FleetResources.vue +14 -0
- package/components/fleet/FleetValuesFrom.vue +2 -2
- package/components/fleet/__tests__/FleetClusterTargets.test.ts +531 -0
- package/components/fleet/__tests__/FleetClusters.test.ts +576 -0
- package/components/fleet/dashboard/ResourceDetails.vue +96 -123
- package/components/form/Conditions.vue +1 -15
- package/components/form/HookOption.vue +5 -0
- package/components/form/LabeledSelect.vue +1 -1
- package/components/form/LifecycleHooks.vue +2 -6
- package/components/form/ResourceLabeledSelect.vue +12 -1
- package/components/form/SeccompProfile.vue +113 -0
- package/components/form/Security.vue +244 -133
- package/components/form/__tests__/LabeledSelect.test.ts +1 -1
- package/components/form/__tests__/SeccompProfile.test.js +124 -0
- package/components/form/__tests__/Security.test.ts +125 -37
- package/components/formatter/Autoscaler.vue +2 -2
- package/components/formatter/FleetSummaryGraph.vue +4 -1
- package/components/nav/Group.vue +5 -0
- package/components/nav/Header.vue +3 -3
- package/components/nav/HeaderPageActionMenu.vue +1 -1
- package/components/nav/NamespaceFilter.vue +6 -6
- package/components/nav/NotificationCenter/index.vue +1 -1
- package/components/nav/TopLevelMenu.helper.ts +41 -16
- package/components/nav/TopLevelMenu.vue +45 -25
- package/components/nav/WorkspaceSwitcher.vue +1 -1
- package/components/nav/__tests__/TopLevelMenu.helper.test.ts +277 -0
- package/components/nav/__tests__/TopLevelMenu.test.ts +160 -4
- package/components/templates/default.vue +0 -3
- package/components/templates/home.vue +0 -3
- package/components/templates/plain.vue +0 -3
- package/composables/useClickOutside.ts +1 -1
- package/config/product/explorer.js +1 -2
- package/config/types.js +41 -8
- package/detail/__tests__/workload.test.ts +8 -16
- package/detail/catalog.cattle.io.app.vue +6 -0
- package/detail/fleet.cattle.io.cluster.vue +6 -0
- package/detail/workload/index.vue +7 -109
- package/edit/__tests__/projectsecret.test.ts +42 -0
- package/edit/auth/__tests__/oidc.test.ts +50 -0
- package/edit/auth/oidc.vue +68 -44
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +140 -59
- package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +41 -5
- package/edit/projectsecret.vue +29 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +89 -200
- package/edit/provisioning.cattle.io.cluster/__tests__/Networking.test.ts +58 -17
- package/edit/provisioning.cattle.io.cluster/rke2.vue +11 -0
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +3 -63
- package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +82 -14
- package/edit/workload/__tests__/index.test.ts +122 -85
- package/edit/workload/index.vue +48 -29
- package/edit/workload/mixins/workload.js +85 -32
- package/list/catalog.cattle.io.clusterrepo.vue +1 -1
- package/list/projectsecret.vue +2 -2
- package/machine-config/__tests__/vmwarevsphere.test.ts +64 -0
- package/machine-config/amazonec2.vue +2 -2
- package/machine-config/vmwarevsphere.vue +58 -4
- package/mixins/__tests__/brand.spec.ts +18 -13
- package/mixins/__tests__/chart.test.ts +63 -0
- package/mixins/chart.js +56 -51
- package/models/__tests__/catalog.cattle.io.app.test.ts +33 -0
- package/models/__tests__/workload.test.ts +333 -0
- package/models/catalog.cattle.io.app.js +8 -0
- package/models/pod.js +14 -0
- package/models/secret.js +1 -1
- package/models/workload.js +93 -27
- package/package.json +4 -4
- package/pages/c/_cluster/apps/charts/__tests__/install.test.ts +91 -0
- package/pages/c/_cluster/apps/charts/install.vue +4 -4
- package/pages/c/_cluster/explorer/EventsTable.vue +2 -2
- package/pages/c/_cluster/fleet/index.vue +18 -12
- package/pages/c/_cluster/manager/hostedprovider/index.vue +1 -19
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -1
- package/pages/c/_cluster/uiplugins/index.vue +1 -1
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +234 -0
- package/plugins/dashboard-store/actions.js +9 -8
- package/plugins/dashboard-store/resource-class.js +97 -1
- package/plugins/steve/__tests__/revision.test.ts +84 -0
- package/plugins/steve/__tests__/steve-pagination-utils.test.ts +30 -0
- package/plugins/steve/__tests__/subscribe.spec.ts +134 -0
- package/plugins/steve/mutations.js +9 -0
- package/plugins/steve/revision.ts +26 -0
- package/plugins/steve/steve-pagination-utils.ts +6 -5
- package/plugins/steve/subscribe.js +211 -51
- package/plugins/subscribe-events.ts +2 -2
- package/rancher-components/Form/Checkbox/Checkbox.vue +13 -0
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +1 -1
- package/rancher-components/Pill/RcCounterBadge/RcCounterBadge.vue +1 -1
- package/rancher-components/Pill/RcStatusBadge/RcStatusBadge.vue +3 -1
- package/rancher-components/Pill/RcStatusIndicator/RcStatusIndicator.vue +3 -1
- package/rancher-components/Pill/RcTag/RcTag.vue +1 -1
- package/rancher-components/Pill/index.ts +4 -0
- package/rancher-components/RcButton/RcButton.test.ts +53 -9
- package/rancher-components/RcButton/RcButton.vue +217 -25
- package/rancher-components/RcButton/types.ts +27 -1
- package/rancher-components/RcDropdown/RcDropdownMenu.vue +4 -4
- package/rancher-components/RcDropdown/types.ts +3 -3
- package/rancher-components/RcIcon/RcIcon.test.ts +42 -0
- package/rancher-components/RcIcon/RcIcon.vue +9 -6
- package/rancher-components/RcIcon/types.ts +13 -9
- package/rancher-components/utils/status.test.ts +10 -15
- package/rancher-components/utils/status.ts +5 -6
- package/store/aws.js +18 -12
- package/store/index.js +4 -8
- package/store/type-map.utils.ts +1 -1
- package/types/kube/kube-api.ts +29 -3
- package/types/rancher/steve.api.ts +40 -0
- package/types/shell/index.d.ts +99 -0
- package/types/store/dashboard-store.types.ts +29 -7
- package/types/store/pagination.types.ts +1 -0
- package/types/store/subscribe-events.types.ts +1 -0
- package/utils/__tests__/azure.test.ts +56 -0
- package/utils/__tests__/back-off.test.ts +364 -245
- package/utils/__tests__/error.test.ts +44 -0
- package/utils/__tests__/fleet.test.ts +8 -1
- package/utils/__tests__/pagination-wrapper.test.ts +167 -0
- package/utils/__tests__/version.test.ts +55 -1
- package/utils/azure.js +12 -0
- package/utils/back-off.ts +302 -69
- package/utils/cspAdaptor.ts +32 -14
- package/utils/dynamic-content/__tests__/index.test.ts +1 -1
- package/utils/dynamic-content/__tests__/new-release.test.ts +48 -7
- package/utils/dynamic-content/__tests__/support-notice.test.ts +1 -4
- package/utils/dynamic-content/index.ts +1 -6
- package/utils/dynamic-content/new-release.ts +5 -3
- package/utils/dynamic-content/types.d.ts +0 -1
- package/utils/error.js +9 -0
- package/utils/fleet.ts +2 -2
- package/utils/inactivity.ts +2 -3
- package/utils/pagination-wrapper.ts +101 -17
- package/utils/validators/formRules/index.ts +3 -0
- package/utils/version.js +38 -0
- package/components/auth/AzureWarning.vue +0 -77
- /package/components/Resource/Detail/{Card/PodsCard/Bubble.vue → Bubble.vue} +0 -0
- /package/components/Resource/Detail/Card/{PodsCard → StatusCard}/composable.ts +0 -0
|
@@ -96,12 +96,6 @@ const defaultCiliumSpec = {
|
|
|
96
96
|
chartValues: {},
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
// ipv6
|
|
100
|
-
const legacyOnValue = { cilium: { ipv6: { enabled: true } } };
|
|
101
|
-
const legacyOffValue = { cilium: { ipv6: { enabled: false } } };
|
|
102
|
-
const newOnValue = { ipv6: { enabled: true } };
|
|
103
|
-
const newOffValue = { ipv6: { enabled: false } };
|
|
104
|
-
|
|
105
99
|
// bandwidth manager
|
|
106
100
|
const bmOnValue = { bandwidthManager: { enabled: true } };
|
|
107
101
|
const bmOffValue = { bandwidthManager: { enabled: false } };
|
|
@@ -321,244 +315,139 @@ describe('component: Basics', () => {
|
|
|
321
315
|
});
|
|
322
316
|
|
|
323
317
|
describe('cilium CNI', () => {
|
|
324
|
-
it('should toggle
|
|
325
|
-
const wrapper = createBasicsTab('v1.
|
|
326
|
-
const
|
|
318
|
+
it('should toggle bandwidth manager support on/off', async() => {
|
|
319
|
+
const wrapper = createBasicsTab('v1.25.0+rke2r1', {});
|
|
320
|
+
const bmCheckbox = wrapper.find('[data-testid="cluster-rke2-cni-cilium-bandwidth-manager-checkbox"]');
|
|
327
321
|
|
|
328
|
-
expect(
|
|
329
|
-
expect(
|
|
322
|
+
expect(bmCheckbox.exists()).toBe(true);
|
|
323
|
+
expect(bmCheckbox.isVisible()).toBe(true);
|
|
330
324
|
|
|
331
|
-
// Click the checkbox - should enable
|
|
332
|
-
await
|
|
325
|
+
// Click the checkbox - should enable bandwidth manager
|
|
326
|
+
await bmCheckbox.find('label').trigger('click');
|
|
333
327
|
await nextTick();
|
|
334
328
|
await nextTick();
|
|
335
329
|
|
|
336
330
|
// Check and update user values with the emitted value
|
|
337
331
|
let latest = (wrapper.emitted()['cilium-values-changed'] || [])[0][0];
|
|
338
332
|
|
|
339
|
-
expect(JSON.stringify(latest)).toStrictEqual(JSON.stringify(
|
|
333
|
+
expect(JSON.stringify(latest)).toStrictEqual(JSON.stringify(bmOnValue));
|
|
340
334
|
|
|
341
335
|
await wrapper.setProps({ userChartValues: { 'rke2-cilium': latest } });
|
|
342
336
|
|
|
343
|
-
// Click the checkbox to turn
|
|
344
|
-
await
|
|
337
|
+
// Click the checkbox to turn bm off again
|
|
338
|
+
await bmCheckbox.find('label').trigger('click');
|
|
345
339
|
await nextTick();
|
|
346
340
|
await nextTick();
|
|
347
341
|
|
|
348
342
|
// Update from the emitted value
|
|
349
343
|
latest = (wrapper.emitted()['cilium-values-changed'] || [])[1][0];
|
|
350
344
|
|
|
351
|
-
expect(JSON.stringify(latest)).toStrictEqual(JSON.stringify(
|
|
345
|
+
expect(JSON.stringify(latest)).toStrictEqual(JSON.stringify(bmOffValue));
|
|
352
346
|
});
|
|
353
347
|
|
|
354
|
-
it('should
|
|
348
|
+
it('should supportbandwidth manager', async() => {
|
|
355
349
|
const wrapper = createBasicsTab('v1.25.0+rke2r1', {});
|
|
356
|
-
const
|
|
350
|
+
const bmCheckbox = wrapper.find('[data-testid="cluster-rke2-cni-cilium-bandwidth-manager-checkbox"]');
|
|
357
351
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
// Click the checkbox - should enable ipv6
|
|
362
|
-
await ipv6Checkbox.find('label').trigger('click');
|
|
352
|
+
// Click the checkbox - should enable bandwidth manager
|
|
353
|
+
await bmCheckbox.find('label').trigger('click');
|
|
363
354
|
await nextTick();
|
|
364
355
|
await nextTick();
|
|
365
356
|
|
|
366
|
-
// Check and update user values with the emitted value
|
|
367
357
|
let latest = (wrapper.emitted()['cilium-values-changed'] || [])[0][0];
|
|
368
358
|
|
|
369
|
-
expect(JSON.stringify(latest)).toStrictEqual(JSON.stringify(newOnValue));
|
|
370
|
-
|
|
371
359
|
await wrapper.setProps({ userChartValues: { 'rke2-cilium': latest } });
|
|
372
360
|
|
|
373
|
-
|
|
374
|
-
await ipv6Checkbox.find('label').trigger('click');
|
|
375
|
-
await nextTick();
|
|
376
|
-
await nextTick();
|
|
377
|
-
|
|
378
|
-
// Update from the emitted value
|
|
379
|
-
latest = (wrapper.emitted()['cilium-values-changed'] || [])[1][0];
|
|
380
|
-
|
|
381
|
-
expect(JSON.stringify(latest)).toStrictEqual(JSON.stringify(newOffValue));
|
|
382
|
-
});
|
|
383
|
-
|
|
384
|
-
it('should migrate when the k8s version is changed', async() => {
|
|
385
|
-
const userChartValues = { 'rke2-cilium': { ipv6: { enabled: true } } };
|
|
386
|
-
const wrapper = createBasicsTab('v1.25.0+rke2r1', userChartValues);
|
|
387
|
-
|
|
388
|
-
// Check that the checkbox is checked
|
|
389
|
-
const ipv6Checkbox = wrapper.find('[data-testid="cluster-rke2-cni-ipv6-checkbox"]').find('input');
|
|
390
|
-
|
|
391
|
-
expect(ipv6Checkbox.exists()).toBe(true);
|
|
392
|
-
expect(ipv6Checkbox.isVisible()).toBe(true);
|
|
393
|
-
expect(ipv6Checkbox.attributes().value).toBe('true');
|
|
394
|
-
|
|
395
|
-
// Change the kubernetes version that needs the legacy format
|
|
396
|
-
const k8s123 = mockVersionOptions.find((v) => v.id === 'v1.23.0+rke2r1');
|
|
361
|
+
const exp = { bandwidthManager: { enabled: true } };
|
|
397
362
|
|
|
398
|
-
|
|
363
|
+
expect(JSON.stringify(latest)).toStrictEqual(JSON.stringify(exp));
|
|
399
364
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
365
|
+
// Check that other properties are preserved
|
|
366
|
+
latest = {
|
|
367
|
+
...latest,
|
|
368
|
+
bandwidthManager: {
|
|
369
|
+
test: true,
|
|
370
|
+
enabled: false
|
|
371
|
+
},
|
|
372
|
+
};
|
|
403
373
|
|
|
404
|
-
|
|
405
|
-
const k8s125 = mockVersionOptions.find((v) => v.id === 'v1.25.0+rke2r1');
|
|
374
|
+
await wrapper.setProps({ userChartValues: { 'rke2-cilium': latest } });
|
|
406
375
|
|
|
407
|
-
|
|
376
|
+
// Click the checkbox to turn bandwidth manager off again
|
|
377
|
+
await bmCheckbox.find('label').trigger('click');
|
|
378
|
+
await nextTick();
|
|
379
|
+
await nextTick();
|
|
408
380
|
|
|
409
381
|
latest = (wrapper.emitted()['cilium-values-changed'] || [])[1][0];
|
|
410
|
-
expect(JSON.stringify(latest)).toStrictEqual(JSON.stringify(newOnValue));
|
|
411
|
-
});
|
|
412
|
-
});
|
|
413
|
-
|
|
414
|
-
it('should toggle bandwidth manager support on/off', async() => {
|
|
415
|
-
const wrapper = createBasicsTab('v1.25.0+rke2r1', {});
|
|
416
|
-
const bmCheckbox = wrapper.find('[data-testid="cluster-rke2-cni-cilium-bandwidth-manager-checkbox"]');
|
|
417
|
-
|
|
418
|
-
expect(bmCheckbox.exists()).toBe(true);
|
|
419
|
-
expect(bmCheckbox.isVisible()).toBe(true);
|
|
420
|
-
|
|
421
|
-
// Click the checkbox - should enable bandwidth manager
|
|
422
|
-
await bmCheckbox.find('label').trigger('click');
|
|
423
|
-
await nextTick();
|
|
424
|
-
await nextTick();
|
|
425
|
-
|
|
426
|
-
// Check and update user values with the emitted value
|
|
427
|
-
let latest = (wrapper.emitted()['cilium-values-changed'] || [])[0][0];
|
|
428
|
-
|
|
429
|
-
expect(JSON.stringify(latest)).toStrictEqual(JSON.stringify(bmOnValue));
|
|
430
|
-
|
|
431
|
-
await wrapper.setProps({ userChartValues: { 'rke2-cilium': latest } });
|
|
432
|
-
|
|
433
|
-
// Click the checkbox to turn ipv6 off again
|
|
434
|
-
await bmCheckbox.find('label').trigger('click');
|
|
435
|
-
await nextTick();
|
|
436
|
-
await nextTick();
|
|
437
382
|
|
|
438
|
-
|
|
439
|
-
latest = (wrapper.emitted()['cilium-values-changed'] || [])[1][0];
|
|
383
|
+
const expected = '{"bandwidthManager":{"test":true,"enabled":true}}';
|
|
440
384
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
it('should support ipv6 and bandwidth manager', async() => {
|
|
445
|
-
const wrapper = createBasicsTab('v1.25.0+rke2r1', {});
|
|
446
|
-
const bmCheckbox = wrapper.find('[data-testid="cluster-rke2-cni-cilium-bandwidth-manager-checkbox"]');
|
|
447
|
-
const ipv6Checkbox = wrapper.find('[data-testid="cluster-rke2-cni-ipv6-checkbox"]');
|
|
448
|
-
|
|
449
|
-
// Click the checkbox - should enable bandwidth manager
|
|
450
|
-
await bmCheckbox.find('label').trigger('click');
|
|
451
|
-
await nextTick();
|
|
452
|
-
await nextTick();
|
|
453
|
-
|
|
454
|
-
let latest = (wrapper.emitted()['cilium-values-changed'] || [])[0][0];
|
|
455
|
-
|
|
456
|
-
await wrapper.setProps({ userChartValues: { 'rke2-cilium': latest } });
|
|
457
|
-
|
|
458
|
-
// Click the checkbox - should enable ipv6
|
|
459
|
-
await ipv6Checkbox.find('label').trigger('click');
|
|
460
|
-
await nextTick();
|
|
461
|
-
await nextTick();
|
|
462
|
-
|
|
463
|
-
// Check and update user values with the emitted value
|
|
464
|
-
latest = (wrapper.emitted()['cilium-values-changed'] || [])[1][0];
|
|
465
|
-
|
|
466
|
-
const combined = {
|
|
467
|
-
bandwidthManager: { enabled: true },
|
|
468
|
-
ipv6: { enabled: true }
|
|
469
|
-
};
|
|
470
|
-
|
|
471
|
-
expect(JSON.stringify(latest)).toStrictEqual(JSON.stringify(combined));
|
|
385
|
+
expect(JSON.stringify(latest)).toStrictEqual(expected);
|
|
386
|
+
});
|
|
472
387
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
388
|
+
it.each([
|
|
389
|
+
['create', true, true, '%cluster.banner.cloudProviderUnsupportedAzure%'],
|
|
390
|
+
['create', false, true, undefined],
|
|
391
|
+
['create', true, false, undefined],
|
|
392
|
+
['edit', true, true, undefined],
|
|
393
|
+
['view', true, true, undefined],
|
|
394
|
+
])('should display Unsupported Azure provider warning message', (mode, showCloudProvider, isAzureProviderUnsupported, warningMessage) => {
|
|
395
|
+
const wrapper = createBasicsTab('v1.31.0+rke2r1', {}, {
|
|
396
|
+
mode,
|
|
397
|
+
showCloudProvider,
|
|
398
|
+
isAzureProviderUnsupported,
|
|
399
|
+
canAzureMigrateOnEdit: true
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
let cloudProviderUnsupportedAzureWarningMessage;
|
|
403
|
+
const warningElement = wrapper.find('[data-testid="clusterBasics__showCloudProviderUnsupportedAzureWarning"]');
|
|
404
|
+
|
|
405
|
+
if (warningElement.exists()) {
|
|
406
|
+
cloudProviderUnsupportedAzureWarningMessage = warningElement.element.textContent;
|
|
483
407
|
}
|
|
484
|
-
};
|
|
485
|
-
|
|
486
|
-
await wrapper.setProps({ userChartValues: { 'rke2-cilium': latest } });
|
|
487
|
-
|
|
488
|
-
// Click the checkbox to turn bandwidth manager off again
|
|
489
|
-
await bmCheckbox.find('label').trigger('click');
|
|
490
|
-
await nextTick();
|
|
491
|
-
await nextTick();
|
|
492
|
-
|
|
493
|
-
latest = (wrapper.emitted()['cilium-values-changed'] || [])[2][0];
|
|
494
|
-
|
|
495
|
-
const expected = '{"bandwidthManager":{"test":true,"enabled":true},"ipv6":{"test":true,"enabled":false}}';
|
|
496
408
|
|
|
497
|
-
|
|
498
|
-
});
|
|
499
|
-
|
|
500
|
-
it.each([
|
|
501
|
-
['create', true, true, '%cluster.banner.cloudProviderUnsupportedAzure%'],
|
|
502
|
-
['create', false, true, undefined],
|
|
503
|
-
['create', true, false, undefined],
|
|
504
|
-
['edit', true, true, undefined],
|
|
505
|
-
['view', true, true, undefined],
|
|
506
|
-
])('should display Unsupported Azure provider warning message', (mode, showCloudProvider, isAzureProviderUnsupported, warningMessage) => {
|
|
507
|
-
const wrapper = createBasicsTab('v1.31.0+rke2r1', {}, {
|
|
508
|
-
mode,
|
|
509
|
-
showCloudProvider,
|
|
510
|
-
isAzureProviderUnsupported,
|
|
511
|
-
canAzureMigrateOnEdit: true
|
|
409
|
+
expect(cloudProviderUnsupportedAzureWarningMessage).toBe(warningMessage);
|
|
512
410
|
});
|
|
513
411
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
412
|
+
it.each([
|
|
413
|
+
['edit', true, true, '%cluster.banner.cloudProviderMigrateAzure%'],
|
|
414
|
+
['edit', false, true, undefined],
|
|
415
|
+
['edit', true, false, undefined],
|
|
416
|
+
['create', true, true, undefined],
|
|
417
|
+
['view', true, true, undefined],
|
|
418
|
+
])('should display Azure Migration warning message', (mode, showCloudProvider, canAzureMigrateOnEdit, warningMessage) => {
|
|
419
|
+
const wrapper = createBasicsTab('v1.31.0+rke2r1', {}, {
|
|
420
|
+
mode,
|
|
421
|
+
showCloudProvider,
|
|
422
|
+
canAzureMigrateOnEdit,
|
|
423
|
+
isAzureProviderUnsupported: true,
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
let cloudProviderMigrateAzureWarningMessage;
|
|
427
|
+
const warningElement = wrapper.find('[data-testid="clusterBasics__showCloudProviderMigrateAzureWarning"]');
|
|
428
|
+
|
|
429
|
+
if (warningElement.exists()) {
|
|
430
|
+
cloudProviderMigrateAzureWarningMessage = warningElement.element.textContent;
|
|
431
|
+
}
|
|
523
432
|
|
|
524
|
-
|
|
525
|
-
['edit', true, true, '%cluster.banner.cloudProviderMigrateAzure%'],
|
|
526
|
-
['edit', false, true, undefined],
|
|
527
|
-
['edit', true, false, undefined],
|
|
528
|
-
['create', true, true, undefined],
|
|
529
|
-
['view', true, true, undefined],
|
|
530
|
-
])('should display Azure Migration warning message', (mode, showCloudProvider, canAzureMigrateOnEdit, warningMessage) => {
|
|
531
|
-
const wrapper = createBasicsTab('v1.31.0+rke2r1', {}, {
|
|
532
|
-
mode,
|
|
533
|
-
showCloudProvider,
|
|
534
|
-
canAzureMigrateOnEdit,
|
|
535
|
-
isAzureProviderUnsupported: true,
|
|
433
|
+
expect(cloudProviderMigrateAzureWarningMessage).toBe(warningMessage);
|
|
536
434
|
});
|
|
537
435
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
])('should disable Cloud Provider', (mode, canAzureMigrateOnEdit, disabled) => {
|
|
554
|
-
const wrapper = createBasicsTab('v1.31.0+rke2r1', {}, {
|
|
555
|
-
mode,
|
|
556
|
-
showCloudProvider: true,
|
|
557
|
-
canAzureMigrateOnEdit,
|
|
436
|
+
it.each([
|
|
437
|
+
['create', true, false],
|
|
438
|
+
['edit', false, true],
|
|
439
|
+
['edit', true, false],
|
|
440
|
+
['view', true, false],
|
|
441
|
+
])('should disable Cloud Provider', (mode, canAzureMigrateOnEdit, disabled) => {
|
|
442
|
+
const wrapper = createBasicsTab('v1.31.0+rke2r1', {}, {
|
|
443
|
+
mode,
|
|
444
|
+
showCloudProvider: true,
|
|
445
|
+
canAzureMigrateOnEdit,
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
const cloudProvider = wrapper.find('[data-testid="clusterBasics__cloudProvider"]');
|
|
449
|
+
|
|
450
|
+
expect(cloudProvider.attributes().disabled).toBe(disabled.toString());
|
|
558
451
|
});
|
|
559
|
-
|
|
560
|
-
const cloudProvider = wrapper.find('[data-testid="clusterBasics__cloudProvider"]');
|
|
561
|
-
|
|
562
|
-
expect(cloudProvider.attributes().disabled).toBe(disabled.toString());
|
|
563
452
|
});
|
|
564
453
|
});
|
|
@@ -75,19 +75,36 @@ describe('component: RKE2Networking', () => {
|
|
|
75
75
|
expect(wrapper.emitted('validationChanged')).toHaveLength(2);
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
it
|
|
79
|
-
['cluster-cidr', '2001:db8::/48'],
|
|
80
|
-
['service-cidr', '2001:db8:1::/112'],
|
|
81
|
-
])('should show an ipv6 warning banner when %p is an ipv6 address', async(field, address) => {
|
|
78
|
+
it('should show a flannel masq input when provisioning k3s and flannel is enabled', () => {
|
|
82
79
|
const spec = { ...defaultSpec } as any;
|
|
83
80
|
|
|
84
|
-
|
|
81
|
+
const wrapper = shallowMount(Networking, {
|
|
82
|
+
propsData: {
|
|
83
|
+
mode: 'create',
|
|
84
|
+
value: { spec },
|
|
85
|
+
selectedVersion: { serverArgs: mockServerArgs, label: 'k3s' },
|
|
86
|
+
},
|
|
87
|
+
global: {
|
|
88
|
+
mocks: {
|
|
89
|
+
...defaultMocks,
|
|
90
|
+
$store: { getters: defaultGetters },
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const input = wrapper.findComponent('[data-testid="cluster-rke2-flannel-masq-checkbox"]');
|
|
96
|
+
|
|
97
|
+
expect(input.exists()).toBe(true);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('should not show a flannel masq input when provisioning rke2', () => {
|
|
101
|
+
const spec = { ...defaultSpec } as any;
|
|
85
102
|
|
|
86
103
|
const wrapper = shallowMount(Networking, {
|
|
87
104
|
propsData: {
|
|
88
105
|
mode: 'create',
|
|
89
106
|
value: { spec },
|
|
90
|
-
selectedVersion: { serverArgs: mockServerArgs },
|
|
107
|
+
selectedVersion: { serverArgs: mockServerArgs, label: 'rke2' },
|
|
91
108
|
},
|
|
92
109
|
global: {
|
|
93
110
|
mocks: {
|
|
@@ -97,25 +114,45 @@ describe('component: RKE2Networking', () => {
|
|
|
97
114
|
},
|
|
98
115
|
});
|
|
99
116
|
|
|
100
|
-
const
|
|
117
|
+
const input = wrapper.findComponent('[data-testid="cluster-rke2-flannel-masq-checkbox"]');
|
|
101
118
|
|
|
102
|
-
expect(
|
|
119
|
+
expect(wrapper.vm.showFlannelMasq).toBe(false);
|
|
120
|
+
expect(input.exists()).toBe(false);
|
|
103
121
|
});
|
|
104
122
|
|
|
105
|
-
it('should
|
|
123
|
+
it('should automatically check the flannel masq input when stack preference is changed from ipv4 to ipv6 or dual', async() => {
|
|
106
124
|
const spec = { ...defaultSpec } as any;
|
|
107
125
|
|
|
108
|
-
spec.rkeConfig.
|
|
109
|
-
cni: 'calico',
|
|
110
|
-
'cluster-cidr': '10.0.0.0/16',
|
|
111
|
-
'service-cidr': '10.0.1.0/16'
|
|
112
|
-
} ;
|
|
126
|
+
spec.rkeConfig.networking.stackPreference = 'ipv4';
|
|
113
127
|
|
|
114
128
|
const wrapper = shallowMount(Networking, {
|
|
115
129
|
propsData: {
|
|
116
130
|
mode: 'create',
|
|
117
131
|
value: { spec },
|
|
118
|
-
selectedVersion: { serverArgs: mockServerArgs },
|
|
132
|
+
selectedVersion: { serverArgs: mockServerArgs, label: 'k3s' },
|
|
133
|
+
},
|
|
134
|
+
global: { mocks: {} }
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const newSpec = { ...spec };
|
|
138
|
+
|
|
139
|
+
newSpec.rkeConfig.networking.stackPreference = 'dual';
|
|
140
|
+
|
|
141
|
+
await wrapper.setProps({ value: { spec: newSpec } });
|
|
142
|
+
|
|
143
|
+
expect(wrapper.emitted('enable-flannel-masq-changed')?.[0]?.[0]).toBe(true);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('should automatically un-check the flannel masq input when stack preference is changed from ipv6 or dual to ipv4', async() => {
|
|
147
|
+
const spec = { ...defaultSpec } as any;
|
|
148
|
+
|
|
149
|
+
spec.rkeConfig.networking.stackPreference = 'ipv6';
|
|
150
|
+
|
|
151
|
+
const wrapper = shallowMount(Networking, {
|
|
152
|
+
propsData: {
|
|
153
|
+
mode: 'create',
|
|
154
|
+
value: { spec },
|
|
155
|
+
selectedVersion: { serverArgs: mockServerArgs, label: 'k3s' },
|
|
119
156
|
},
|
|
120
157
|
global: {
|
|
121
158
|
mocks: {
|
|
@@ -125,9 +162,13 @@ describe('component: RKE2Networking', () => {
|
|
|
125
162
|
},
|
|
126
163
|
});
|
|
127
164
|
|
|
128
|
-
const
|
|
165
|
+
const newSpec = { ...spec };
|
|
166
|
+
|
|
167
|
+
newSpec.rkeConfig.networking.stackPreference = 'ipv4';
|
|
168
|
+
|
|
169
|
+
await wrapper.setProps({ value: { spec: newSpec } });
|
|
129
170
|
|
|
130
|
-
expect(
|
|
171
|
+
expect(wrapper.emitted('enable-flannel-masq-changed')?.[0]?.[0]).toBe(false);
|
|
131
172
|
});
|
|
132
173
|
|
|
133
174
|
it('should not automatically update stack preference or validate it when editing an existing cluster even if its set to ipv4 and the user appears to have ipv6 pools', async() => {
|
|
@@ -2218,6 +2218,15 @@ export default {
|
|
|
2218
2218
|
handleRegistrySecretChanged(neu) {
|
|
2219
2219
|
this.registrySecret = neu;
|
|
2220
2220
|
},
|
|
2221
|
+
|
|
2222
|
+
handleFlannelMasqChanged(neu) {
|
|
2223
|
+
if (neu || neu === false) {
|
|
2224
|
+
this.serverConfig['enable-flannel-masq'] = neu;
|
|
2225
|
+
} else {
|
|
2226
|
+
delete this.serverConfig['enable-flannel-masq'];
|
|
2227
|
+
}
|
|
2228
|
+
},
|
|
2229
|
+
|
|
2221
2230
|
validateClusterName() {
|
|
2222
2231
|
if (!this.value.metadata.name && this.agentConfig?.['cloud-provider-name'] === HARVESTER) {
|
|
2223
2232
|
this.errors.push(this.t('validation.required', { key: this.t('cluster.name.label') }, true));
|
|
@@ -2530,6 +2539,7 @@ export default {
|
|
|
2530
2539
|
:truncate-limit="truncateLimit"
|
|
2531
2540
|
:machine-pools="machinePools"
|
|
2532
2541
|
:has-some-ipv6-pools="hasSomeIpv6Pools"
|
|
2542
|
+
:enable-flannel-masq="serverConfig['enable-flannel-masq']"
|
|
2533
2543
|
@truncate-hostname-changed="truncateHostname"
|
|
2534
2544
|
@cluster-cidr-changed="(val)=>localValue.spec.rkeConfig.machineGlobalConfig['cluster-cidr'] = val"
|
|
2535
2545
|
@service-cidr-changed="(val)=>localValue.spec.rkeConfig.machineGlobalConfig['service-cidr'] = val"
|
|
@@ -2542,6 +2552,7 @@ export default {
|
|
|
2542
2552
|
@fqdn-changed="(val)=>localValue.spec.localClusterAuthEndpoint.fqdn = val"
|
|
2543
2553
|
@stack-preference-changed="(val)=>localValue.spec.rkeConfig.networking.stackPreference = val"
|
|
2544
2554
|
@validationChanged="(val)=>stackPreferenceError = !val"
|
|
2555
|
+
@enable-flannel-masq-changed="handleFlannelMasqChanged"
|
|
2545
2556
|
/>
|
|
2546
2557
|
</Tab>
|
|
2547
2558
|
|
|
@@ -125,13 +125,6 @@ export default {
|
|
|
125
125
|
},
|
|
126
126
|
|
|
127
127
|
watch: {
|
|
128
|
-
selectedVersion(neu, old) {
|
|
129
|
-
if (neu?.value !== old?.value && this.ciliumIpv6) {
|
|
130
|
-
// Re-assign so that the setter updates the structure for the new k8s version if needed
|
|
131
|
-
this.ciliumIpv6 = !!this.ciliumIpv6;
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
|
|
135
128
|
'agentConfig.profile'(newValue) {
|
|
136
129
|
this.showEnablingComplianceWarning = this.provider === 'custom' && this.isEdit && !!newValue && newValue !== this.initialAgentProfile;
|
|
137
130
|
}
|
|
@@ -148,7 +141,7 @@ export default {
|
|
|
148
141
|
return this.serverConfig?.cni === 'none';
|
|
149
142
|
},
|
|
150
143
|
|
|
151
|
-
|
|
144
|
+
showBandwidthManagerControl() {
|
|
152
145
|
return this.serverConfig?.cni === 'cilium' || this.serverConfig?.cni === 'multus,cilium';
|
|
153
146
|
},
|
|
154
147
|
|
|
@@ -320,54 +313,6 @@ export default {
|
|
|
320
313
|
return semver.satisfies(selectedVersion, '>=1.21.0');
|
|
321
314
|
},
|
|
322
315
|
|
|
323
|
-
ciliumIpv6: {
|
|
324
|
-
get() {
|
|
325
|
-
// eslint-disable-next-line no-unused-vars
|
|
326
|
-
const cni = this.serverConfig.cni; // force this property to recalculate if cni was changed away from cilium and chartValues['rke-cilium'] deleted
|
|
327
|
-
|
|
328
|
-
const chart = this.userChartValues[this.chartVersionKey('rke2-cilium')];
|
|
329
|
-
|
|
330
|
-
return chart?.cilium?.ipv6?.enabled || chart?.ipv6?.enabled || false;
|
|
331
|
-
},
|
|
332
|
-
set(neu) {
|
|
333
|
-
const name = this.chartVersionKey('rke2-cilium');
|
|
334
|
-
const values = this.userChartValues[name];
|
|
335
|
-
|
|
336
|
-
// RKE2 older than 1.23.5 uses different Helm chart values structure - need to take that into account
|
|
337
|
-
const version = this.selectedVersion.value;
|
|
338
|
-
let ciliumValues = {};
|
|
339
|
-
|
|
340
|
-
if (semver.gt(version, '1.23.5')) {
|
|
341
|
-
// New style
|
|
342
|
-
ciliumValues = {
|
|
343
|
-
...values,
|
|
344
|
-
ipv6: {
|
|
345
|
-
...values?.ipv6,
|
|
346
|
-
enabled: neu
|
|
347
|
-
}
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
delete ciliumValues.cilium;
|
|
351
|
-
} else {
|
|
352
|
-
// Old style
|
|
353
|
-
ciliumValues = {
|
|
354
|
-
...values,
|
|
355
|
-
cilium: {
|
|
356
|
-
...values?.cilium,
|
|
357
|
-
ipv6: {
|
|
358
|
-
...values?.cilium?.ipv6,
|
|
359
|
-
enabled: neu
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
delete ciliumValues.ipv6;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
this.$emit('cilium-values-changed', ciliumValues);
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
|
|
371
316
|
ciliumBandwidthManager: {
|
|
372
317
|
get() {
|
|
373
318
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -515,6 +460,7 @@ export default {
|
|
|
515
460
|
/>
|
|
516
461
|
</div>
|
|
517
462
|
</div>
|
|
463
|
+
|
|
518
464
|
<div
|
|
519
465
|
v-if="showCni"
|
|
520
466
|
:style="{'align-items':'center'}"
|
|
@@ -531,15 +477,9 @@ export default {
|
|
|
531
477
|
/>
|
|
532
478
|
</div>
|
|
533
479
|
<div
|
|
534
|
-
v-if="
|
|
480
|
+
v-if="showBandwidthManagerControl"
|
|
535
481
|
class="col"
|
|
536
482
|
>
|
|
537
|
-
<Checkbox
|
|
538
|
-
v-model:value="ciliumIpv6"
|
|
539
|
-
data-testid="cluster-rke2-cni-ipv6-checkbox"
|
|
540
|
-
:mode="mode"
|
|
541
|
-
:label="t('cluster.rke2.address.ipv6.enable')"
|
|
542
|
-
/>
|
|
543
483
|
<Checkbox
|
|
544
484
|
v-model:value="ciliumBandwidthManager"
|
|
545
485
|
data-testid="cluster-rke2-cni-cilium-bandwidth-manager-checkbox"
|