@rancher/shell 0.3.27 → 0.3.29
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/assets/translations/en-us.yaml +19 -21
- package/assets/translations/zh-hans.yaml +0 -23
- package/chart/gatekeeper.vue +2 -11
- package/chart/istio.vue +1 -10
- package/chart/logging/index.vue +2 -11
- package/chart/monitoring/grafana/index.vue +2 -2
- package/chart/monitoring/index.vue +1 -9
- package/chart/rancher-backup/index.vue +1 -9
- package/components/AsyncButton.vue +9 -0
- package/components/Carousel.vue +2 -1
- package/components/SortableTable/THead.vue +7 -9
- package/components/SortableTable/index.vue +1 -2
- package/components/fleet/FleetStatus.vue +3 -3
- package/components/fleet/FleetSummary.vue +32 -27
- package/components/formatter/ClusterProvider.vue +1 -18
- package/components/nav/WindowManager/ContainerLogs.vue +22 -19
- package/config/product/manager.js +0 -13
- package/config/types.js +0 -4
- package/detail/provisioning.cattle.io.cluster.vue +2 -1
- package/edit/management.cattle.io.project.vue +1 -52
- package/edit/management.cattle.io.setting.vue +31 -2
- package/edit/provisioning.cattle.io.cluster/Basics.vue +6 -107
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +0 -3
- package/edit/provisioning.cattle.io.cluster/rke2.vue +3 -128
- package/edit/workload/index.vue +2 -1
- package/machine-config/__tests__/vmwarevsphere.test.ts +72 -0
- package/machine-config/vmwarevsphere.vue +68 -13
- package/middleware/authenticated.js +4 -2
- package/models/__tests__/management.cattle.io.cluster.test.ts +19 -0
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +90 -0
- package/models/cluster.x-k8s.io.machine.js +1 -1
- package/models/management.cattle.io.cluster.js +4 -0
- package/models/management.cattle.io.project.js +0 -36
- package/models/management.cattle.io.setting.js +11 -7
- package/models/provisioning.cattle.io.cluster.js +16 -4
- package/package.json +2 -1
- package/pages/auth/setup.vue +38 -1
- package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +2 -17
- package/pages/c/_cluster/apps/charts/index.vue +0 -15
- package/pages/c/_cluster/apps/charts/install.helpers.js +2 -13
- package/pages/c/_cluster/apps/charts/install.vue +1 -1
- package/pages/c/_cluster/explorer/index.vue +0 -47
- package/pages/c/_cluster/manager/pages/_page.vue +4 -5
- package/rancher-components/components/StringList/StringList.test.ts +270 -0
- package/rancher-components/components/StringList/StringList.vue +57 -18
- package/store/prefs.js +0 -3
- package/types/shell/index.d.ts +13 -7
- package/utils/custom-validators.js +0 -2
- package/utils/error.js +16 -1
- package/utils/validators/formRules/__tests__/index.test.ts +49 -4
- package/utils/validators/formRules/index.ts +12 -9
- package/utils/validators/setting.js +6 -10
- package/components/ChartPsp.vue +0 -76
- package/components/__tests__/ChartPsp.test.ts +0 -75
- package/components/formatter/__tests__/ClusterProvider.test.ts +0 -28
package/components/ChartPsp.vue
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Checkbox } from '@components/Form/Checkbox';
|
|
3
|
-
import { mapGetters } from 'vuex';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
components: { Checkbox },
|
|
7
|
-
props: {
|
|
8
|
-
value: {
|
|
9
|
-
type: Object,
|
|
10
|
-
default: () => {
|
|
11
|
-
return {};
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
mode: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: 'edit'
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Optional title section prior checkbox
|
|
21
|
-
*/
|
|
22
|
-
title: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: null
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Cluster information
|
|
29
|
-
*/
|
|
30
|
-
cluster: {
|
|
31
|
-
type: Object,
|
|
32
|
-
default: null
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
created() {
|
|
36
|
-
if (!this.value.global.cattle) {
|
|
37
|
-
this.$set(this.value.global, 'cattle', { psp: { enabled: false } });
|
|
38
|
-
}
|
|
39
|
-
if (!this.value.global.cattle.psp) {
|
|
40
|
-
this.$set(this.value.global.cattle, 'psp', { enabled: false });
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
computed: {
|
|
44
|
-
...mapGetters({ t: 'i18n/t' }),
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Display checkbox only if contains PSP or K8S version is less than 1.25
|
|
48
|
-
*/
|
|
49
|
-
hasCheckbox() {
|
|
50
|
-
const clusterVersion = this.cluster?.kubernetesVersion || '';
|
|
51
|
-
const version = clusterVersion.match(/\d+/g);
|
|
52
|
-
const isRequiredVersion = version?.length ? +version[0] === 1 && +version[1] < 25 : false;
|
|
53
|
-
|
|
54
|
-
return isRequiredVersion;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
<template>
|
|
61
|
-
<div
|
|
62
|
-
v-if="hasCheckbox"
|
|
63
|
-
class="mt-10 mb-10"
|
|
64
|
-
>
|
|
65
|
-
<h3 v-if="title">
|
|
66
|
-
{{ title }}
|
|
67
|
-
</h3>
|
|
68
|
-
|
|
69
|
-
<Checkbox
|
|
70
|
-
v-model="value.global.cattle.psp.enabled"
|
|
71
|
-
data-testid="psp-checkbox"
|
|
72
|
-
:mode="mode"
|
|
73
|
-
:label="t('catalog.chart.enablePSP')"
|
|
74
|
-
/>
|
|
75
|
-
</div>
|
|
76
|
-
</template>
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { shallowMount, mount } from '@vue/test-utils';
|
|
2
|
-
import ChartPsp from '@shell/components/ChartPsp.vue';
|
|
3
|
-
|
|
4
|
-
describe('component: ChartPsp', () => {
|
|
5
|
-
it.each([
|
|
6
|
-
true, false
|
|
7
|
-
])('should render checkbox referencing value.global.cattle.psp.enabled as %p', (value) => {
|
|
8
|
-
const version = 'v1.24.11+rke2r1';
|
|
9
|
-
const wrapper = shallowMount(ChartPsp, {
|
|
10
|
-
propsData: {
|
|
11
|
-
value: { global: { cattle: { psp: { enabled: value } } } },
|
|
12
|
-
cluster: { kubernetesVersion: version }
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
expect(wrapper.findComponent({ name: 'Checkbox' }).props().value).toBe(value);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it.each([
|
|
20
|
-
['v1.24.11+rke2r1'],
|
|
21
|
-
])('should display the checkbox for cluster with k8s version %p', (version) => {
|
|
22
|
-
const wrapper = shallowMount(ChartPsp, {
|
|
23
|
-
propsData: {
|
|
24
|
-
value: { global: { cattle: { psp: { enabled: false } } } },
|
|
25
|
-
cluster: { kubernetesVersion: version }
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const input = wrapper.find(`[data-testid="psp-checkbox"]`).element as HTMLInputElement;
|
|
30
|
-
|
|
31
|
-
expect(input).toBeDefined();
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it.each([
|
|
35
|
-
['v1.25.11+rke2r1'],
|
|
36
|
-
])('should not display the checkbox for cluster with k8s version %p', (version) => {
|
|
37
|
-
const wrapper = shallowMount(ChartPsp, {
|
|
38
|
-
propsData: {
|
|
39
|
-
value: { global: { cattle: { psp: { enabled: false } } } },
|
|
40
|
-
cluster: { kubernetesVersion: version }
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const input = wrapper.find(`[data-testid="psp-checkbox"]`).element as HTMLInputElement;
|
|
45
|
-
|
|
46
|
-
expect(input).toBeUndefined();
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('should update value.global.cattle.psp.enabled when checkbox is toggled', async() => {
|
|
50
|
-
const chartValues = { global: {} } as any;
|
|
51
|
-
const version = 'v1.24.11+rke2r1';
|
|
52
|
-
const wrapper = mount(ChartPsp, {
|
|
53
|
-
propsData: {
|
|
54
|
-
value: chartValues,
|
|
55
|
-
cluster: { kubernetesVersion: version }
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
await wrapper.find('.checkbox-container').trigger('click');
|
|
60
|
-
|
|
61
|
-
expect(chartValues.global.cattle.psp.enabled).toBe(true);
|
|
62
|
-
|
|
63
|
-
await wrapper.find('.checkbox-container').trigger('click');
|
|
64
|
-
expect(chartValues.global.cattle.psp.enabled).toBe(false);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it.each([
|
|
68
|
-
{ global: {} } as any,
|
|
69
|
-
{ global: { cattle: {} } } as any,
|
|
70
|
-
])('should define cattle.psp.enabled and set to false', (chartValues) => {
|
|
71
|
-
shallowMount(ChartPsp, { propsData: { value: chartValues } });
|
|
72
|
-
|
|
73
|
-
expect(chartValues.global.cattle.psp.enabled).toBe(false);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { mount } from '@vue/test-utils';
|
|
2
|
-
import ClusterProvider from '@shell/components/formatter/ClusterProvider.vue';
|
|
3
|
-
|
|
4
|
-
describe('component: ClusterProvider', () => {
|
|
5
|
-
const importedGkeClusterInfo = { mgmt: { spec: { gkeConfig: { imported: true } } } };
|
|
6
|
-
const importedAksClusterInfo = { mgmt: { spec: { aksConfig: { imported: true } } } };
|
|
7
|
-
const importedEksClusterInfo = { mgmt: { spec: { eksConfig: { imported: true } } } };
|
|
8
|
-
const notImportedGkeClusterInfo = { mgmt: { spec: { gkeConfig: { imported: false } } } };
|
|
9
|
-
const importedClusterInfoWithProviderForEmberParam = { mgmt: { providerForEmberParam: 'import' } };
|
|
10
|
-
|
|
11
|
-
describe('isImported', () => {
|
|
12
|
-
const testCases = [
|
|
13
|
-
[importedGkeClusterInfo, true],
|
|
14
|
-
[importedAksClusterInfo, true],
|
|
15
|
-
[importedEksClusterInfo, true],
|
|
16
|
-
[notImportedGkeClusterInfo, false],
|
|
17
|
-
[importedClusterInfoWithProviderForEmberParam, true],
|
|
18
|
-
[{}, false],
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
it.each(testCases)('should return the isImported value properly based on the props data', (row, expected) => {
|
|
22
|
-
const wrapper = mount(ClusterProvider, { propsData: { row } });
|
|
23
|
-
|
|
24
|
-
expect(wrapper.vm.$data.isImported).toBe(expected);
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
});
|
|
28
|
-
});
|