@rancher/shell 0.5.3 → 1.2.0
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/.DS_Store +0 -0
- package/assets/images/providers/aks-black.svg +28 -0
- package/assets/images/providers/aks.svg +31 -0
- package/assets/styles/global/_labeled-input.scss +1 -0
- package/assets/styles/global/_layout.scss +0 -99
- package/assets/translations/en-us.yaml +76 -74
- package/assets/translations/zh-hans.yaml +25 -23
- package/babel.config.js +1 -7
- package/chart/gatekeeper.vue +11 -2
- package/chart/istio.vue +10 -1
- package/chart/logging/index.vue +11 -2
- package/chart/monitoring/alerting/index.vue +21 -7
- package/chart/monitoring/grafana/index.vue +2 -57
- package/chart/monitoring/index.vue +26 -52
- package/chart/monitoring/prometheus/index.vue +43 -37
- package/chart/rancher-backup/index.vue +10 -3
- package/cloud-credential/azure.vue +17 -4
- package/components/AsyncButton.vue +0 -9
- package/components/Carousel.vue +0 -1
- package/components/ChartPsp.vue +76 -0
- package/components/ClusterIconMenu.vue +9 -24
- package/components/CodeMirror.vue +16 -75
- package/components/CopyCode.vue +2 -6
- package/components/CopyToClipboard.vue +1 -2
- package/components/CopyToClipboardText.vue +9 -14
- package/components/CruResource.vue +0 -1
- package/components/EtcdInfoBanner.vue +5 -5
- package/components/ExplorerProjectsNamespaces.vue +1 -25
- package/components/FixedBanner.vue +0 -1
- package/components/IconOrSvg.vue +1 -1
- package/components/Markdown.vue +12 -16
- package/components/Questions/index.vue +1 -1
- package/components/ResourceDetail/Masthead.vue +9 -25
- package/components/ResourceDetail/index.vue +4 -1
- package/components/ResourceList/Masthead.vue +18 -1
- package/components/ResourceTable.vue +2 -14
- package/components/ResourceYaml.vue +5 -34
- package/components/SideNav.vue +65 -43
- package/components/SortableTable/THead.vue +9 -7
- package/components/SortableTable/index.vue +2 -1
- package/components/StatusTable.vue +1 -5
- package/components/TabTitle.vue +84 -0
- package/components/Tabbed/index.vue +0 -12
- package/components/YamlEditor.vue +0 -1
- package/components/__tests__/ChartPsp.test.ts +75 -0
- package/components/__tests__/CopyCode.test.ts +4 -5
- package/components/fleet/FleetBundles.vue +11 -5
- package/components/fleet/FleetRepos.vue +27 -62
- package/components/fleet/FleetResources.vue +1 -6
- package/components/fleet/FleetStatus.vue +3 -3
- package/components/fleet/FleetSummary.vue +30 -35
- package/components/form/ArrayList.vue +8 -1
- package/components/form/ArrayListSelect.vue +9 -9
- package/components/form/BannerSettings.vue +0 -3
- package/components/form/FileSelector.vue +0 -1
- package/components/form/KeyValue.vue +0 -2
- package/components/form/LabeledSelect.vue +0 -4
- package/components/form/Password.vue +1 -3
- package/components/form/Select.vue +1 -1
- package/components/form/SelectOrCreateAuthSecret.vue +4 -4
- package/components/form/__tests__/KeyValue.test.ts +1 -1
- package/components/formatter/Checked.vue +3 -11
- package/components/formatter/ClusterProvider.vue +18 -1
- package/components/formatter/FleetSummaryGraph.vue +11 -23
- package/components/formatter/LiveDate.vue +16 -0
- package/components/formatter/LiveDuration.vue +1 -1
- package/components/formatter/PercentageBar.vue +1 -1
- package/components/formatter/WorkloadDetailEndpoints.vue +22 -12
- package/components/formatter/__tests__/ClusterProvider.test.ts +28 -0
- package/components/nav/Group.vue +2 -2
- package/components/nav/Header.vue +2 -2
- package/components/nav/Jump.vue +9 -19
- package/components/nav/TopLevelMenu.vue +18 -66
- package/components/nav/Type.vue +7 -16
- package/components/nav/WindowManager/ContainerLogs.vue +19 -120
- package/components/nav/WindowManager/ContainerShell.vue +1 -6
- package/components/nav/WindowManager/index.vue +10 -11
- package/components/nav/__tests__/TopLevelMenu.test.ts +1 -34
- package/components/nav/__tests__/Type.test.ts +1 -31
- package/components/nuxt/nuxt-child.js +78 -14
- package/components/nuxt/nuxt.js +1 -1
- package/components/user.retention/user-retention-header.vue +34 -0
- package/composables/useI18n.ts +26 -0
- package/composables/useStore.ts +16 -0
- package/config/harvester-manager-types.js +0 -2
- package/config/home-links.js +32 -2
- package/config/private-label.js +0 -22
- package/config/product/explorer.js +4 -4
- package/config/product/fleet.js +1 -6
- package/config/product/legacy.js +1 -84
- package/config/product/manager.js +15 -8
- package/config/query-params.js +0 -1
- package/config/router.js +368 -385
- package/config/settings.ts +9 -2
- package/config/store.js +1 -1
- package/config/system-namespaces.js +0 -3
- package/config/table-headers.js +27 -47
- package/config/types.js +5 -0
- package/config/uiplugins.js +1 -1
- package/core/plugin-helpers.js +5 -3
- package/core/plugin-routes.ts +114 -56
- package/core/plugin.ts +10 -16
- package/core/plugins-loader.js +9 -7
- package/core/plugins.js +3 -0
- package/core/types-provisioning.ts +0 -7
- package/creators/app/init +0 -19
- package/detail/fleet.cattle.io.bundle.vue +1 -1
- package/detail/fleet.cattle.io.cluster.vue +1 -11
- package/detail/node.vue +0 -42
- package/detail/pod.vue +1 -68
- package/detail/provisioning.cattle.io.cluster.vue +8 -25
- package/detail/workload/index.vue +1 -15
- package/dialog/ScaleMachineDownDialog.vue +17 -34
- package/edit/auth/googleoauth.vue +5 -1
- package/edit/catalog.cattle.io.clusterrepo.vue +7 -20
- package/edit/cloudcredential.vue +0 -2
- package/edit/fleet.cattle.io.gitrepo.vue +4 -3
- package/edit/management.cattle.io.project.vue +52 -1
- package/edit/management.cattle.io.setting.vue +2 -32
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +2 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +1 -1
- package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +3 -12
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +1 -2
- package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.spec.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/{tabs/Basics.vue → Basics.vue} +125 -106
- package/edit/provisioning.cattle.io.cluster/{tabs/MachinePool.vue → MachinePool.vue} +7 -1
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +7 -15
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +237 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/{CustomCommand.test.ts → CustomCommand.tests.ts} +0 -6
- package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +1 -7
- package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/index.vue +40 -109
- package/edit/provisioning.cattle.io.cluster/rke2.vue +689 -152
- package/edit/service.vue +0 -12
- package/edit/token.vue +0 -1
- package/edit/workload/Upgrading.vue +2 -3
- package/edit/workload/index.vue +1 -2
- package/edit/workload/mixins/workload.js +1 -1
- package/initialize/App.js +71 -25
- package/initialize/client.js +162 -21
- package/initialize/index.js +124 -47
- package/initialize/layouts.ts +26 -0
- package/{components/templates → layouts}/blank.vue +1 -1
- package/{components/templates → layouts}/default.vue +98 -8
- package/{components/templates → layouts}/error.vue +19 -10
- package/{components/templates → layouts}/home.vue +1 -4
- package/{components/templates → layouts}/plain.vue +1 -4
- package/{components/templates → layouts}/standalone.vue +1 -1
- package/{components/templates → layouts}/unauthenticated.vue +1 -1
- package/list/catalog.cattle.io.app.vue +0 -1
- package/list/management.cattle.io.feature.vue +7 -1
- package/list/management.cattle.io.setting.vue +0 -1
- package/list/management.cattle.io.user.vue +25 -1
- package/list/node.vue +0 -1
- package/machine-config/__tests__/vmwarevsphere.test.ts +161 -56
- package/machine-config/azure.vue +37 -21
- package/machine-config/vmwarevsphere.vue +47 -42
- package/middleware/authenticated.js +19 -14
- package/mixins/auth-config.js +7 -2
- package/mixins/brand.js +41 -29
- package/mixins/fetch.server.js +73 -0
- package/mixins/labeled-form-element.ts +1 -6
- package/models/__tests__/management.cattle.io.node.ts +0 -85
- package/models/__tests__/namespace.test.ts +9 -49
- package/models/cluster/node.js +4 -4
- package/models/cluster.x-k8s.io.machine.js +1 -1
- package/models/cluster.x-k8s.io.machinedeployment.js +0 -14
- package/models/fleet.cattle.io.cluster.js +0 -4
- package/models/fleet.cattle.io.gitrepo.js +13 -56
- package/models/management.cattle.io.cluster.js +3 -11
- package/models/management.cattle.io.kontainerdriver.js +0 -1
- package/models/management.cattle.io.node.js +14 -18
- package/models/management.cattle.io.nodepool.js +0 -17
- package/models/management.cattle.io.project.js +36 -0
- package/models/management.cattle.io.setting.js +7 -11
- package/models/management.cattle.io.user.js +65 -0
- package/models/namespace.js +1 -1
- package/models/pod.js +0 -20
- package/models/provisioning.cattle.io.cluster.js +9 -91
- package/models/secret.js +18 -126
- package/models/storage.k8s.io.storageclass.js +1 -1
- package/models/workload.js +0 -16
- package/models/workload.service.js +0 -18
- package/package.json +10 -12
- package/pages/about.vue +1 -0
- package/pages/account/create-key.vue +1 -0
- package/pages/account/index.vue +1 -0
- package/pages/auth/login.vue +1 -0
- package/pages/auth/logout.vue +2 -0
- package/pages/auth/setup.vue +4 -37
- package/pages/auth/verify.vue +8 -14
- package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +17 -2
- package/pages/c/_cluster/apps/charts/index.vue +58 -64
- package/pages/c/_cluster/apps/charts/install.helpers.js +13 -2
- package/pages/c/_cluster/apps/charts/install.vue +5 -5
- package/pages/c/_cluster/apps/index.vue +2 -0
- package/pages/c/_cluster/auth/index.vue +2 -0
- package/pages/c/_cluster/auth/user.retention/index.vue +384 -0
- package/pages/c/_cluster/ecm/index.vue +2 -0
- package/pages/c/_cluster/explorer/index.vue +53 -56
- package/pages/c/_cluster/explorer/tools/index.vue +3 -171
- package/pages/c/_cluster/fleet/index.vue +1 -1
- package/pages/c/_cluster/index.vue +2 -0
- package/pages/c/_cluster/manager/pages/_page.vue +5 -4
- package/pages/c/_cluster/monitoring/index.vue +1 -17
- package/pages/c/_cluster/settings/DefaultLinksEditor.vue +1 -1
- package/pages/c/_cluster/settings/banners.vue +2 -0
- package/pages/c/_cluster/settings/brand.vue +2 -3
- package/pages/c/_cluster/settings/index.vue +2 -0
- package/pages/c/_cluster/settings/links.vue +3 -2
- package/pages/c/_cluster/settings/performance.vue +1 -0
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +1 -2
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +46 -10
- package/pages/c/_cluster/uiplugins/index.vue +2 -0
- package/pages/c/index.vue +9 -0
- package/pages/diagnostic.vue +2 -1
- package/pages/fail-whale.vue +1 -0
- package/pages/prefs.vue +1 -0
- package/pages/rio/mesh.vue +508 -0
- package/pages/support/index.vue +8 -2
- package/pkg/auto-import.js +1 -1
- package/plugins/axios.js +36 -0
- package/plugins/back-button.js +5 -3
- package/plugins/clean-html-directive.js +19 -1
- package/plugins/clean-tooltip-directive.js +1 -1
- package/plugins/codemirror-loader.js +1 -1
- package/plugins/codemirror.js +0 -41
- package/plugins/dashboard-store/__tests__/{mutations.test.ts → mutations.spec.ts} +1 -1
- package/plugins/dashboard-store/actions.js +17 -16
- package/plugins/dashboard-store/classify.js +18 -1
- package/plugins/dashboard-store/getters.js +7 -70
- package/plugins/dashboard-store/index.js +12 -0
- package/plugins/dashboard-store/mutations.js +4 -0
- package/plugins/dashboard-store/resource-class.js +20 -65
- package/plugins/i18n.js +1 -1
- package/plugins/steve/__tests__/getters.spec.ts +48 -26
- package/plugins/steve/__tests__/subscribe.spec.ts +106 -0
- package/plugins/steve/actions.js +37 -3
- package/plugins/steve/getters.js +24 -7
- package/plugins/steve/mutations.js +5 -2
- package/plugins/steve/norman-class.js +0 -19
- package/plugins/steve/steve-class.js +0 -22
- package/plugins/steve/subscribe.js +34 -13
- package/plugins/transitions.js +4 -0
- package/plugins/vue-clipboard2.js +4 -0
- package/rancher-components/Accordion/Accordion.vue +3 -2
- package/rancher-components/BadgeState/BadgeState.vue +3 -3
- package/rancher-components/Banner/Banner.test.ts +1 -5
- package/rancher-components/Banner/Banner.vue +2 -2
- package/rancher-components/Card/Card.vue +4 -4
- package/rancher-components/Form/Checkbox/Checkbox.vue +4 -3
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +1 -1
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +55 -24
- package/rancher-components/Form/Radio/RadioButton.test.ts +1 -3
- package/rancher-components/Form/Radio/RadioButton.vue +13 -7
- package/rancher-components/Form/Radio/RadioGroup.vue +4 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -5
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +7 -4
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +9 -4
- package/rancher-components/StringList/StringList.vue +8 -8
- package/rancher-components/components/Accordion/Accordion.vue +3 -2
- package/rancher-components/components/BadgeState/BadgeState.test.ts +12 -0
- package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +2 -19
- package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +14 -11
- package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +1 -1
- package/rancher-components/components/StringList/StringList.test.ts +0 -270
- package/rancher-components/components/StringList/StringList.vue +18 -57
- package/scripts/extension/bundle +7 -19
- package/scripts/extension/helm/scripts/package +3 -11
- package/scripts/extension/parse-tag-name +4 -4
- package/scripts/extension/publish +9 -20
- package/scripts/publish-shell.sh +1 -11
- package/scripts/test-plugins-build.sh +9 -85
- package/store/catalog.js +1 -1
- package/store/features.js +0 -1
- package/store/i18n.js +0 -11
- package/store/index.js +13 -11
- package/store/prefs.js +38 -33
- package/store/type-map.js +82 -157
- package/tsconfig.default.json +46 -0
- package/tsconfig.json +9 -35
- package/types/shell/index.d.ts +404 -465
- package/utils/axios.js +19 -0
- package/utils/create-yaml.js +1 -5
- package/utils/custom-validators.js +2 -0
- package/utils/error.js +1 -16
- package/utils/monitoring.js +2 -37
- package/utils/nuxt.js +39 -18
- package/utils/object.js +0 -24
- package/utils/router.scrollBehavior.js +14 -12
- package/utils/socket.js +1 -0
- package/utils/time.js +1 -1
- package/utils/title.ts +3 -0
- package/utils/url.ts +1 -1
- package/utils/validators/formRules/__tests__/index.test.ts +4 -49
- package/utils/validators/formRules/index.ts +9 -12
- package/utils/validators/setting.js +10 -6
- package/vue.config.js +3 -24
- package/chart/monitoring/steps/uninstall-v1.vue +0 -135
- package/components/Certificates.vue +0 -164
- package/components/__tests__/CodeMirror.spec.ts +0 -99
- package/components/fleet/__tests__/FleetSummary.test.ts +0 -316
- package/components/formatter/FleetClusterSummaryGraph.vue +0 -27
- package/components/formatter/__tests__/Checked.test.ts +0 -19
- package/components/formatter/__tests__/WorkloadDetailEndpoints.test.ts +0 -81
- package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +0 -186
- package/composables/useCompactInput.ts +0 -20
- package/composables/useLabeledFormElement.ts +0 -138
- package/creators/app/files/.gitlab-ci.yml +0 -14
- package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +0 -77
- package/edit/__tests__/service.test.ts +0 -89
- package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +0 -112
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +0 -473
- package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +0 -73
- package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +0 -386
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +0 -137
- package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +0 -157
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +0 -135
- package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +0 -189
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +0 -147
- package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +0 -76
- package/mixins/v1-workload-metrics.js +0 -43
- package/models/__tests__/management.cattle.io.cluster.test.ts +0 -23
- package/models/__tests__/management.cattle.io.nodepool.ts +0 -83
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +0 -241
- package/models/__tests__/secret.test.ts +0 -37
- package/models/__tests__/storage.k8s.io.storageclass.test.ts +0 -22
- package/models/__tests__/workload.test.ts +0 -91
- package/plugins/clean-html.js +0 -53
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +0 -49
- package/plugins/dashboard-store/__tests__/utils/store-mocks.ts +0 -7
- package/plugins/index.js +0 -11
- package/plugins/steve/__tests__/resource-utils.test.ts +0 -159
- package/plugins/steve/__tests__/steve-class.spec.ts +0 -59
- package/plugins/steve/__tests__/utils/steve-mocks.ts +0 -31
- package/plugins/steve/resource-utils.ts +0 -38
- package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +0 -50
- package/server/har-file.js +0 -183
- package/store/__tests__/type-map.test.ts +0 -1122
- package/tsconfig.paths.json +0 -18
- package/utils/azure.js +0 -24
- package/utils/clipboard.js +0 -5
- /package/components/form/__tests__/{NameNsDescription.test.ts → NameNsDescription.ts} +0 -0
- /package/edit/networking.k8s.io.networkpolicy/__tests__/utils/{selectors.test.ts → selectors.ts} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/networking/ACE.vue → ACE.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/AgentConfiguration.vue → AgentConfiguration.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/upgrade/DrainOptions.vue → DrainOptions.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/MemberRoles.vue → MemberRoles.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryConfigs.vue → RegistryConfigs.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryMirrors.vue → RegistryMirrors.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/etcd/S3Config.vue → S3Config.vue} +0 -0
- /package/plugins/dashboard-store/__tests__/{actions.test.ts → actions.spec.ts} +0 -0
- /package/plugins/dashboard-store/__tests__/{getters.test.ts → getters.spec.ts} +0 -0
- /package/rancher-components/BadgeState/{BadgeState.spec.ts → BadgeState.test.ts} +0 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import Basics from '@shell/edit/provisioning.cattle.io.cluster/Basics';
|
|
3
|
+
|
|
4
|
+
const defaultStubs = {
|
|
5
|
+
Banner: true,
|
|
6
|
+
LabeledSelect: true,
|
|
7
|
+
YamlEditor: true,
|
|
8
|
+
Checkbox: true
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const defaultComputed = {
|
|
12
|
+
showk8s21LegacyWarning() {
|
|
13
|
+
return false;
|
|
14
|
+
},
|
|
15
|
+
profileOptions() {
|
|
16
|
+
return [{ label: 'anything', value: 'anything' }];
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const mockAgentArgs = { 'cloud-provider-name': { options: [], profile: { options: [{ anything: 'yes' }] } } };
|
|
21
|
+
const mockServerArgs = { disable: {}, cni: { options: [] } };
|
|
22
|
+
|
|
23
|
+
const rke2Versions =
|
|
24
|
+
[
|
|
25
|
+
{
|
|
26
|
+
id: 'v1.25.0+rke2r1', value: 'v1.25.0+rke2r1', serverArgs: mockServerArgs, agentArgs: mockAgentArgs, charts: {}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'v1.24.0+rke2r1', value: 'v1.24.0+rke2r1', serverArgs: mockServerArgs, agentArgs: mockAgentArgs, charts: {}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'v1.23.0+rke2r1', value: 'v1.23.0+rke2r1', serverArgs: mockServerArgs, agentArgs: mockAgentArgs, charts: {}
|
|
33
|
+
}
|
|
34
|
+
];
|
|
35
|
+
const k3sVersions = [
|
|
36
|
+
{
|
|
37
|
+
id: 'v1.25.0+k3s1', value: 'v1.25.0+k3s1', serverArgs: mockServerArgs, agentArgs: mockAgentArgs, charts: {}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'v1.24.0+k3s1', value: 'v1.24.0+k3s1', serverArgs: mockServerArgs, agentArgs: mockAgentArgs, charts: {}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 'v1.23.0+k3s1', value: 'v1.23.0+k3s1', serverArgs: mockServerArgs, agentArgs: mockAgentArgs, charts: {}
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
const mockVersionOptions = [...rke2Versions, ...k3sVersions];
|
|
47
|
+
|
|
48
|
+
const defaultGetters = {
|
|
49
|
+
currentStore: () => 'current_store',
|
|
50
|
+
'management/schemaFor': jest.fn(),
|
|
51
|
+
'current_store/all': jest.fn(),
|
|
52
|
+
'i18n/t': jest.fn(),
|
|
53
|
+
'i18n/withFallback': jest.fn(),
|
|
54
|
+
'plugins/cloudProviderForDriver': jest.fn()
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const defaultMocks = {
|
|
58
|
+
$route: {
|
|
59
|
+
name: 'anything',
|
|
60
|
+
query: { AS: 'yaml' },
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const defaultSpec = {
|
|
65
|
+
rkeConfig: { etcd: { disableSnapshots: false }, machineGlobalConfig: { cni: 'calico' } },
|
|
66
|
+
chartValues: {},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
describe('component: Basics', () => {
|
|
70
|
+
/**
|
|
71
|
+
* DISCLAIMER ***************************************************************************************
|
|
72
|
+
* Logs are prevented to avoid polluting the test output.
|
|
73
|
+
****************************************************************************************************
|
|
74
|
+
*/
|
|
75
|
+
// eslint-disable-next-line jest/no-hooks
|
|
76
|
+
beforeEach(() => {
|
|
77
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it.each(mockVersionOptions)('should display PSA option', (k8s) => {
|
|
81
|
+
const label = 'whatever';
|
|
82
|
+
const wrapper = mount(Basics, {
|
|
83
|
+
propsData: {
|
|
84
|
+
mode: 'create',
|
|
85
|
+
value: {
|
|
86
|
+
spec: {
|
|
87
|
+
...defaultSpec,
|
|
88
|
+
defaultPodSecurityAdmissionConfigurationTemplateName: label,
|
|
89
|
+
kubernetesVersion: k8s.value
|
|
90
|
+
},
|
|
91
|
+
agentConfig: { 'cloud-provider-name': '' },
|
|
92
|
+
},
|
|
93
|
+
provider: 'whatever',
|
|
94
|
+
userChartValues: {},
|
|
95
|
+
cisOverride: false,
|
|
96
|
+
cisPsaChangeBanner: true,
|
|
97
|
+
allPsas: [],
|
|
98
|
+
needsPsp: false,
|
|
99
|
+
selectedVersion: k8s,
|
|
100
|
+
versionOptions: mockVersionOptions,
|
|
101
|
+
isHarvesterDriver: false,
|
|
102
|
+
isHarvesterIncompatible: false,
|
|
103
|
+
showDeprecatedPatchVersions: false,
|
|
104
|
+
clusterIsAlreadyCreated: false,
|
|
105
|
+
isElementalCluster: false,
|
|
106
|
+
hasPsaTemplates: false,
|
|
107
|
+
isK3s: true,
|
|
108
|
+
haveArgInfo: false,
|
|
109
|
+
showCni: true,
|
|
110
|
+
showCloudProvider: true,
|
|
111
|
+
unsupportedCloudProvider: false,
|
|
112
|
+
cloudProviderOptions: [{ label: 'Default - RKE2 Embedded', value: '' }],
|
|
113
|
+
},
|
|
114
|
+
computed: defaultComputed,
|
|
115
|
+
mocks: {
|
|
116
|
+
...defaultMocks,
|
|
117
|
+
$store: { getters: defaultGetters },
|
|
118
|
+
},
|
|
119
|
+
stubs: defaultStubs
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const select = wrapper.find('[data-testid="rke2-custom-edit-psa"]');
|
|
123
|
+
|
|
124
|
+
expect((select.vm as unknown as any).options[0].label).toBe(`${ label } (Current)`);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it.each([
|
|
128
|
+
['v1.25.0+rke2r1', 'none'],
|
|
129
|
+
['v1.24.0+rke2r1', 'default'],
|
|
130
|
+
['v1.23.0+rke2r1', 'default'],
|
|
131
|
+
['v1.25.0+k3s1', 'none'],
|
|
132
|
+
['v1.24.0+k3s1', 'default'],
|
|
133
|
+
['v1.23.0+k3s1', 'default'],
|
|
134
|
+
])('should display for version %p PSA option label %p', (k8s, partialLabel) => {
|
|
135
|
+
const label = `cluster.rke2.defaultPodSecurityAdmissionConfigurationTemplateName.option.${ partialLabel }`;
|
|
136
|
+
const wrapper = mount(Basics, {
|
|
137
|
+
propsData: {
|
|
138
|
+
mode: 'create',
|
|
139
|
+
value: {
|
|
140
|
+
spec: {
|
|
141
|
+
...defaultSpec,
|
|
142
|
+
defaultPodSecurityAdmissionConfigurationTemplateName: label,
|
|
143
|
+
kubernetesVersion: k8s
|
|
144
|
+
},
|
|
145
|
+
agentConfig: { 'cloud-provider-name': '' },
|
|
146
|
+
},
|
|
147
|
+
provider: 'whatever',
|
|
148
|
+
userChartValues: {},
|
|
149
|
+
cisOverride: false,
|
|
150
|
+
cisPsaChangeBanner: true,
|
|
151
|
+
allPsas: [],
|
|
152
|
+
needsPsp: false,
|
|
153
|
+
selectedVersion: mockVersionOptions[0],
|
|
154
|
+
versionOptions: mockVersionOptions,
|
|
155
|
+
isHarvesterDriver: false,
|
|
156
|
+
isHarvesterIncompatible: false,
|
|
157
|
+
showDeprecatedPatchVersions: false,
|
|
158
|
+
clusterIsAlreadyCreated: false,
|
|
159
|
+
isElementalCluster: false,
|
|
160
|
+
hasPsaTemplates: false,
|
|
161
|
+
isK3s: true,
|
|
162
|
+
haveArgInfo: false,
|
|
163
|
+
showCni: true,
|
|
164
|
+
showCloudProvider: true,
|
|
165
|
+
unsupportedCloudProvider: false,
|
|
166
|
+
cloudProviderOptions: [{ label: 'Default - RKE2 Embedded', value: '' }],
|
|
167
|
+
},
|
|
168
|
+
computed: defaultComputed,
|
|
169
|
+
mocks: {
|
|
170
|
+
...defaultMocks,
|
|
171
|
+
$store: { getters: defaultGetters },
|
|
172
|
+
},
|
|
173
|
+
stubs: defaultStubs
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
const select = wrapper.find('[data-testid="rke2-custom-edit-psa"]');
|
|
177
|
+
|
|
178
|
+
expect((select.vm as unknown as any).options[0].label).toStrictEqual(`${ label } (Current)`);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it.each([
|
|
182
|
+
['anything', false, true],
|
|
183
|
+
['', false, false],
|
|
184
|
+
['', true, false],
|
|
185
|
+
])('given CIS value as %p and its override as %p, it should set PSA dropdown as disabled %p', (cis, override, disabled) => {
|
|
186
|
+
const label = 'whatever';
|
|
187
|
+
const k8s = 'v1.25.0+rke2r1';
|
|
188
|
+
const wrapper = mount(Basics, {
|
|
189
|
+
propsData: {
|
|
190
|
+
mode: 'create',
|
|
191
|
+
value: {
|
|
192
|
+
agentConfig: { profile: cis, 'cloud-provider-name': '' },
|
|
193
|
+
spec: {
|
|
194
|
+
...defaultSpec,
|
|
195
|
+
defaultPodSecurityAdmissionConfigurationTemplateName: label,
|
|
196
|
+
kubernetesVersion: k8s
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
provider: 'custom',
|
|
200
|
+
userChartValues: {},
|
|
201
|
+
cisPsaChangeBanner: true,
|
|
202
|
+
allPsas: [],
|
|
203
|
+
needsPsp: false,
|
|
204
|
+
cisOverride: override,
|
|
205
|
+
selectedVersion: mockVersionOptions[0],
|
|
206
|
+
versionOptions: [{
|
|
207
|
+
value: k8s,
|
|
208
|
+
agentArgs: { profile: { options: [cis] } },
|
|
209
|
+
charts: {},
|
|
210
|
+
profile: { options: [cis] }
|
|
211
|
+
}],
|
|
212
|
+
isHarvesterDriver: false,
|
|
213
|
+
isHarvesterIncompatible: false,
|
|
214
|
+
showDeprecatedPatchVersions: false,
|
|
215
|
+
clusterIsAlreadyCreated: false,
|
|
216
|
+
isElementalCluster: false,
|
|
217
|
+
hasPsaTemplates: true,
|
|
218
|
+
isK3s: true,
|
|
219
|
+
haveArgInfo: false,
|
|
220
|
+
showCni: true,
|
|
221
|
+
showCloudProvider: true,
|
|
222
|
+
unsupportedCloudProvider: false,
|
|
223
|
+
cloudProviderOptions: [{ label: 'Default - RKE2 Embedded', value: '' }],
|
|
224
|
+
},
|
|
225
|
+
computed: { ...defaultComputed },
|
|
226
|
+
mocks: {
|
|
227
|
+
...defaultMocks,
|
|
228
|
+
$store: { getters: defaultGetters },
|
|
229
|
+
},
|
|
230
|
+
stubs: defaultStubs
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
const select = wrapper.find('[data-testid="rke2-custom-edit-psa"]');
|
|
234
|
+
|
|
235
|
+
expect((select.vm as unknown as any).disabled).toBe(disabled);
|
|
236
|
+
});
|
|
237
|
+
});
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils';
|
|
2
2
|
import CustomCommand from '@shell/edit/provisioning.cattle.io.cluster/CustomCommand.vue';
|
|
3
|
-
import { cleanHtmlDirective } from '@shell/plugins/clean-html-directive';
|
|
4
|
-
jest.mock('@shell/utils/clipboard', () => {
|
|
5
|
-
return { copyTextToClipboard: jest.fn(() => Promise.resolve({})) };
|
|
6
|
-
});
|
|
7
3
|
|
|
8
4
|
describe('component: CustomCommand', () => {
|
|
9
5
|
const token = 'MY_TOKEN';
|
|
@@ -39,8 +35,6 @@ describe('component: CustomCommand', () => {
|
|
|
39
35
|
taints: [],
|
|
40
36
|
worker: true,
|
|
41
37
|
}),
|
|
42
|
-
|
|
43
|
-
directives: { cleanHtmlDirective }
|
|
44
38
|
});
|
|
45
39
|
|
|
46
40
|
it('should return linux commands with the right flags based on cluster information', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils';
|
|
2
|
-
import DrainOptions from '@shell/edit/provisioning.cattle.io.cluster/
|
|
2
|
+
import DrainOptions from '@shell/edit/provisioning.cattle.io.cluster/DrainOptions.vue';
|
|
3
3
|
import { DefaultProps } from 'vue/types/options';
|
|
4
4
|
import { ExtendedVue, Vue } from 'vue/types/vue';
|
|
5
5
|
|
|
@@ -39,13 +39,7 @@ const defaultStubs = {
|
|
|
39
39
|
UnitInput: true,
|
|
40
40
|
YamlEditor: true,
|
|
41
41
|
MemberRoles: true,
|
|
42
|
-
Basics: true
|
|
43
|
-
Etcd: true,
|
|
44
|
-
Networking: true,
|
|
45
|
-
Upgrade: true,
|
|
46
|
-
Registries: true,
|
|
47
|
-
AddOnConfig: true,
|
|
48
|
-
Advanced: true
|
|
42
|
+
Basics: true
|
|
49
43
|
};
|
|
50
44
|
|
|
51
45
|
const mockAgentArgs = { 'cloud-provider-name': { options: [], profile: { options: [{ anything: 'yes' }] } } };
|
|
@@ -14,8 +14,8 @@ import { NAME as HARVESTER_MANAGER } from '@shell/config/harvester-manager-types
|
|
|
14
14
|
import { HARVESTER as HARVESTER_FEATURE, mapFeature } from '@shell/store/features';
|
|
15
15
|
import { addObject } from '@shell/utils/array';
|
|
16
16
|
import { HIDE_DESC, mapPref } from '@shell/store/prefs';
|
|
17
|
-
import Labels from '
|
|
18
|
-
import AgentEnv from '
|
|
17
|
+
import Labels from './Labels';
|
|
18
|
+
import AgentEnv from './AgentEnv';
|
|
19
19
|
|
|
20
20
|
const HARVESTER_HIDE_KEY = 'cm-harvester-import';
|
|
21
21
|
|
|
@@ -6,16 +6,16 @@ import SelectIconGrid from '@shell/components/SelectIconGrid';
|
|
|
6
6
|
import EmberPage from '@shell/components/EmberPage';
|
|
7
7
|
import { ToggleSwitch } from '@components/Form/ToggleSwitch';
|
|
8
8
|
import {
|
|
9
|
-
CHART, FROM_CLUSTER, SUB_TYPE,
|
|
9
|
+
CHART, FROM_CLUSTER, SUB_TYPE, _EDIT, _IMPORT, _CONFIG, _VIEW
|
|
10
10
|
} from '@shell/config/query-params';
|
|
11
11
|
import { mapGetters } from 'vuex';
|
|
12
12
|
import { sortBy } from '@shell/utils/sort';
|
|
13
13
|
import { set } from '@shell/utils/object';
|
|
14
|
-
import { PROVISIONER, _RKE1, _RKE2 } from '@shell/store/prefs';
|
|
14
|
+
import { mapPref, PROVISIONER, _RKE1, _RKE2 } from '@shell/store/prefs';
|
|
15
15
|
import { filterAndArrangeCharts } from '@shell/store/catalog';
|
|
16
16
|
import { CATALOG } from '@shell/config/labels-annotations';
|
|
17
17
|
import { CAPI, MANAGEMENT, DEFAULT_WORKSPACE } from '@shell/config/types';
|
|
18
|
-
import { mapFeature, RKE2 as RKE2_FEATURE
|
|
18
|
+
import { mapFeature, RKE2 as RKE2_FEATURE } from '@shell/store/features';
|
|
19
19
|
import { allHash } from '@shell/utils/promise';
|
|
20
20
|
import { BLANK_CLUSTER } from '@shell/store/store-types.js';
|
|
21
21
|
import { ELEMENTAL_PRODUCT_NAME, ELEMENTAL_CLUSTER_PROVIDER } from '../../config/elemental-types';
|
|
@@ -163,7 +163,6 @@ export default {
|
|
|
163
163
|
|
|
164
164
|
data() {
|
|
165
165
|
const subType = this.$route.query[SUB_TYPE] || null;
|
|
166
|
-
const rkeType = this.$route.query[RKE_TYPE] || null;
|
|
167
166
|
const chart = this.$route.query[CHART] || null;
|
|
168
167
|
const isImport = this.realMode === _IMPORT;
|
|
169
168
|
|
|
@@ -172,7 +171,6 @@ export default {
|
|
|
172
171
|
kontainerDrivers: [],
|
|
173
172
|
extensions: [],
|
|
174
173
|
subType,
|
|
175
|
-
rkeType,
|
|
176
174
|
chart,
|
|
177
175
|
isImport,
|
|
178
176
|
providerCluster: null,
|
|
@@ -183,32 +181,12 @@ export default {
|
|
|
183
181
|
computed: {
|
|
184
182
|
...mapGetters({ allCharts: 'catalog/charts' }),
|
|
185
183
|
...mapGetters('type-map', ['activeProducts']),
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
get() {
|
|
190
|
-
if (this.rkeType) {
|
|
191
|
-
return this.rkeType;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return this.$store.getters['prefs/get'](PROVISIONER);
|
|
195
|
-
},
|
|
196
|
-
set(value) {
|
|
197
|
-
this.$store.dispatch('prefs/set', { key: PROVISIONER, value });
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
_RKE1: () => _RKE1,
|
|
201
|
-
_RKE2: () => _RKE2,
|
|
184
|
+
preferredProvisioner: mapPref(PROVISIONER),
|
|
185
|
+
_RKE1: () => _RKE1,
|
|
186
|
+
_RKE2: () => _RKE2,
|
|
202
187
|
|
|
203
188
|
emberLink() {
|
|
204
189
|
if (this.value) {
|
|
205
|
-
if (this.value.provisioner) {
|
|
206
|
-
const matchingSubtype = this.subTypes.find((st) => st.id.toLowerCase() === this.value.provisioner.toLowerCase());
|
|
207
|
-
|
|
208
|
-
if (matchingSubtype) {
|
|
209
|
-
this.selectType(matchingSubtype.id, false);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
190
|
// For custom RKE2 clusters, don't load an Ember page.
|
|
213
191
|
// It should be the dashboard.
|
|
214
192
|
if ( this.value.isRke2 && ((this.value.isCustom && this.mode === _EDIT) || (this.value.isCustom && this.as === _CONFIG && this.mode === _VIEW) || (this.subType || '').toLowerCase() === 'custom')) {
|
|
@@ -227,14 +205,12 @@ export default {
|
|
|
227
205
|
return '';
|
|
228
206
|
}
|
|
229
207
|
if ( this.subType ) {
|
|
230
|
-
// if driver type has a custom form component, don't load an ember page
|
|
231
|
-
if (this.selectedSubType.component) {
|
|
232
|
-
return '';
|
|
233
|
-
}
|
|
234
208
|
// For RKE1 and hosted Kubernetes Clusters, set the ember link
|
|
235
209
|
// so that we load the page rather than using RKE2 create
|
|
236
|
-
|
|
237
|
-
|
|
210
|
+
const selected = this.subTypes.find((s) => s.id === this.subType);
|
|
211
|
+
|
|
212
|
+
if (selected?.link) {
|
|
213
|
+
return selected.link;
|
|
238
214
|
}
|
|
239
215
|
|
|
240
216
|
this.selectType(this.subType, false);
|
|
@@ -251,13 +227,7 @@ export default {
|
|
|
251
227
|
return '';
|
|
252
228
|
},
|
|
253
229
|
|
|
254
|
-
rke2Enabled:
|
|
255
|
-
rke1UiEnabled: mapFeature(RKE1_UI),
|
|
256
|
-
|
|
257
|
-
// todo nb is this info stored anywhere else..?
|
|
258
|
-
selectedSubType() {
|
|
259
|
-
return this.subType ? this.subTypes.find((s) => s.id === this.subType) : null;
|
|
260
|
-
},
|
|
230
|
+
rke2Enabled: mapFeature(RKE2_FEATURE),
|
|
261
231
|
|
|
262
232
|
provisioner: {
|
|
263
233
|
get() {
|
|
@@ -267,10 +237,6 @@ export default {
|
|
|
267
237
|
return _RKE1;
|
|
268
238
|
}
|
|
269
239
|
|
|
270
|
-
if ( !this.rke1UiEnabled ) {
|
|
271
|
-
return _RKE2;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
240
|
return this.preferredProvisioner;
|
|
275
241
|
},
|
|
276
242
|
|
|
@@ -284,7 +250,7 @@ export default {
|
|
|
284
250
|
},
|
|
285
251
|
|
|
286
252
|
isRke2() {
|
|
287
|
-
return this.value.isRke2
|
|
253
|
+
return this.value.isRke2;
|
|
288
254
|
},
|
|
289
255
|
|
|
290
256
|
templateOptions() {
|
|
@@ -301,11 +267,12 @@ export default {
|
|
|
301
267
|
const getters = this.$store.getters;
|
|
302
268
|
const isImport = this.isImport;
|
|
303
269
|
const isElementalActive = !!this.activeProducts.find((item) => item.name === ELEMENTAL_PRODUCT_NAME);
|
|
304
|
-
|
|
270
|
+
|
|
271
|
+
const out = [];
|
|
305
272
|
|
|
306
273
|
const templates = this.templateOptions;
|
|
307
274
|
const vueKontainerTypes = getters['plugins/clusterDrivers'];
|
|
308
|
-
const machineTypes = this.nodeDrivers.filter((x) => x.spec.active && x.state === 'active');
|
|
275
|
+
const machineTypes = this.nodeDrivers.filter((x) => x.spec.active && x.state === 'active').map((x) => x.spec.displayName || x.id);
|
|
309
276
|
|
|
310
277
|
this.kontainerDrivers.filter((x) => (isImport ? x.showImport : x.showCreate)).forEach((obj) => {
|
|
311
278
|
if ( vueKontainerTypes.includes(obj.driverName) ) {
|
|
@@ -330,18 +297,19 @@ export default {
|
|
|
330
297
|
});
|
|
331
298
|
|
|
332
299
|
if (this.isRke1 ) {
|
|
333
|
-
machineTypes.forEach((
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
addType(id, _RKE1, false, `/g/clusters/add/launch/${ id }`, this.iconClasses[id], type);
|
|
300
|
+
machineTypes.forEach((id) => {
|
|
301
|
+
addType(id, 'rke1', false, `/g/clusters/add/launch/${ id }`, this.iconClasses[id]);
|
|
337
302
|
});
|
|
338
303
|
|
|
339
304
|
addType('custom', 'custom1', false, '/g/clusters/add/launch/custom');
|
|
340
305
|
} else {
|
|
341
|
-
machineTypes.forEach((
|
|
342
|
-
|
|
306
|
+
machineTypes.forEach((id) => {
|
|
307
|
+
addType(id, 'rke2', false);
|
|
308
|
+
});
|
|
343
309
|
|
|
344
|
-
|
|
310
|
+
// Add from extensions
|
|
311
|
+
this.extensions.forEach((ext) => {
|
|
312
|
+
addExtensionType(ext, getters);
|
|
345
313
|
});
|
|
346
314
|
|
|
347
315
|
addType('custom', 'custom2', false);
|
|
@@ -350,22 +318,6 @@ export default {
|
|
|
350
318
|
addType(ELEMENTAL_CLUSTER_PROVIDER, 'custom2', false);
|
|
351
319
|
}
|
|
352
320
|
}
|
|
353
|
-
|
|
354
|
-
// Add from extensions
|
|
355
|
-
this.extensions.forEach((ext) => {
|
|
356
|
-
// if the rke toggle is set to rke1, don't add extensions that specify rke2 group
|
|
357
|
-
// default group is rke2
|
|
358
|
-
if (!this.isRke2 && (ext.group === _RKE2 || !ext.group)) {
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
// Do not show the extension provisioner on the import cluster page unless its explicitly set to do so
|
|
362
|
-
if (isImport && !ext.showImport) {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
// Allow extensions to overwrite provisioners with the same id
|
|
366
|
-
out = out.filter((type) => type.id !== ext.id);
|
|
367
|
-
addExtensionType(ext, getters);
|
|
368
|
-
});
|
|
369
321
|
}
|
|
370
322
|
|
|
371
323
|
return out;
|
|
@@ -386,17 +338,16 @@ export default {
|
|
|
386
338
|
description: ext.description,
|
|
387
339
|
icon,
|
|
388
340
|
iconClass,
|
|
389
|
-
group: ext.group ||
|
|
341
|
+
group: ext.group || 'rke2',
|
|
390
342
|
disabled: ext.disabled || false,
|
|
391
343
|
link: ext.link,
|
|
392
|
-
tag: ext.tag
|
|
393
|
-
component: ext.component
|
|
344
|
+
tag: ext.tag
|
|
394
345
|
};
|
|
395
346
|
|
|
396
347
|
out.push(subtype);
|
|
397
348
|
}
|
|
398
349
|
|
|
399
|
-
function addType(id, group, disabled = false,
|
|
350
|
+
function addType(id, group, disabled = false, link = null, iconClass = undefined) {
|
|
400
351
|
const label = getters['i18n/withFallback'](`cluster.provider."${ id }"`, null, id);
|
|
401
352
|
const description = getters['i18n/withFallback'](`cluster.providerDescription."${ id }"`, null, '');
|
|
402
353
|
const tag = '';
|
|
@@ -421,9 +372,8 @@ export default {
|
|
|
421
372
|
iconClass,
|
|
422
373
|
group,
|
|
423
374
|
disabled,
|
|
424
|
-
|
|
425
|
-
tag
|
|
426
|
-
providerConfig
|
|
375
|
+
link,
|
|
376
|
+
tag
|
|
427
377
|
};
|
|
428
378
|
|
|
429
379
|
out.push(subtype);
|
|
@@ -535,13 +485,8 @@ export default {
|
|
|
535
485
|
|
|
536
486
|
return;
|
|
537
487
|
}
|
|
538
|
-
if (obj.link) {
|
|
539
|
-
this.$router.push(obj.link);
|
|
540
488
|
|
|
541
|
-
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
this.$router.applyQuery({ [SUB_TYPE]: id, [RKE_TYPE]: this.preferredProvisioner });
|
|
489
|
+
this.$router.applyQuery({ [SUB_TYPE]: id });
|
|
545
490
|
this.selectType(id);
|
|
546
491
|
},
|
|
547
492
|
|
|
@@ -600,16 +545,16 @@ export default {
|
|
|
600
545
|
>
|
|
601
546
|
<h4>
|
|
602
547
|
<div
|
|
603
|
-
v-if="showRkeToggle(i)
|
|
548
|
+
v-if="showRkeToggle(i)"
|
|
604
549
|
class="grouped-type"
|
|
605
550
|
>
|
|
606
551
|
<ToggleSwitch
|
|
607
552
|
v-model="provisioner"
|
|
608
553
|
data-testid="cluster-manager-create-rke-switch"
|
|
609
554
|
class="rke-switch"
|
|
610
|
-
|
|
555
|
+
off-value="rke1"
|
|
611
556
|
:off-label="t('cluster.toggle.v1')"
|
|
612
|
-
|
|
557
|
+
on-value="rke2"
|
|
613
558
|
:on-label="t('cluster.toggle.v2')"
|
|
614
559
|
/>
|
|
615
560
|
</div>
|
|
@@ -633,28 +578,14 @@ export default {
|
|
|
633
578
|
:mode="mode"
|
|
634
579
|
:provider="subType"
|
|
635
580
|
/>
|
|
636
|
-
<
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
:mode="mode"
|
|
645
|
-
:provider="subType"
|
|
646
|
-
:provider-config="selectedSubType.providerConfig"
|
|
647
|
-
/>
|
|
648
|
-
<Rke2Config
|
|
649
|
-
v-else
|
|
650
|
-
v-model="value"
|
|
651
|
-
:initial-value="initialValue"
|
|
652
|
-
:live-value="liveValue"
|
|
653
|
-
:mode="mode"
|
|
654
|
-
:provider="subType"
|
|
655
|
-
:provider-config="selectedSubType.providerConfig"
|
|
656
|
-
/>
|
|
657
|
-
</template>
|
|
581
|
+
<Rke2Config
|
|
582
|
+
v-else-if="subType"
|
|
583
|
+
v-model="value"
|
|
584
|
+
:initial-value="initialValue"
|
|
585
|
+
:live-value="liveValue"
|
|
586
|
+
:mode="mode"
|
|
587
|
+
:provider="subType"
|
|
588
|
+
/>
|
|
658
589
|
|
|
659
590
|
<template
|
|
660
591
|
v-if="subType"
|