@rancher/shell 0.3.24 → 0.3.25
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/styles/themes/_light.scss +1 -1
- package/assets/translations/en-us.yaml +29 -7
- package/assets/translations/zh-hans.yaml +1 -1
- package/components/ClusterIconMenu.vue +143 -0
- package/components/CruResource.vue +7 -1
- package/components/ExplorerProjectsNamespaces.vue +11 -1
- package/components/FixedBanner.vue +17 -1
- package/components/Markdown.vue +1 -1
- package/components/Questions/__tests__/Yaml.test.ts +3 -2
- package/components/SortableTable/index.vue +3 -2
- package/components/auth/RoleDetailEdit.vue +15 -2
- package/components/auth/login/saml.vue +12 -1
- package/components/form/LabeledSelect.vue +12 -5
- package/components/form/Members/ClusterPermissionsEditor.vue +1 -1
- package/components/form/Members/MembershipEditor.vue +6 -1
- package/components/form/__tests__/KeyValue.test.ts +6 -3
- package/components/form/__tests__/LabeledSelect.test.ts +18 -0
- package/components/formatter/PodsUsage.vue +11 -36
- package/components/formatter/PrincipalGroupBindings.vue +8 -5
- package/components/formatter/__tests__/PodsUsage.test.ts +36 -19
- package/components/nav/Group.vue +25 -27
- package/components/nav/Header.vue +12 -5
- package/components/nav/Pinned.vue +47 -0
- package/components/nav/TopLevelMenu.vue +233 -60
- package/components/nav/Type.vue +57 -3
- package/config/home-links.js +1 -1
- package/config/product/istio.js +15 -5
- package/config/router.js +3 -9
- package/config/table-headers.js +5 -6
- package/config/uiplugins.js +1 -0
- package/core/plugin-helpers.js +3 -0
- package/core/types.ts +6 -1
- package/creators/app/files/.vscode/settings.json +0 -1
- package/detail/__tests__/autoscaling.horizontalpodautoscaler.test.ts +118 -0
- package/detail/autoscaling.horizontalpodautoscaler/index.vue +4 -4
- package/detail/provisioning.cattle.io.cluster.vue +7 -5
- package/edit/__tests__/management.cattle.io.clusterroletemplatebinding.test.ts +58 -0
- package/edit/__tests__/namespace.test.ts +5 -3
- package/edit/management.cattle.io.clusterroletemplatebinding.vue +3 -11
- package/edit/namespace.vue +8 -4
- package/edit/provisioning.cattle.io.cluster/Basics.vue +662 -0
- package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +6 -0
- package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +13 -8
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +11 -2
- package/edit/provisioning.cattle.io.cluster/MemberRoles.vue +40 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +237 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.tests.ts +71 -23
- package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +52 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +65 -142
- package/edit/provisioning.cattle.io.cluster/rke2.vue +194 -598
- package/edit/workload/storage/__tests__/Storage.test.ts +2 -2
- package/edit/workload/storage/persistentVolumeClaim/__tests__/persistentvolumeclaim.test.ts +36 -0
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +15 -7
- package/initialize/index.js +5 -5
- package/layouts/default.vue +6 -6
- package/layouts/home.vue +6 -2
- package/layouts/plain.vue +9 -2
- package/list/fleet.cattle.io.cluster.vue +2 -2
- package/list/management.cattle.io.feature.vue +1 -1
- package/machine-config/vmwarevsphere.vue +48 -7
- package/mixins/brand.js +0 -8
- package/mixins/child-hook.js +2 -2
- package/mixins/create-edit-view/impl.js +3 -3
- package/models/__tests__/management.cattle.io.node.ts +96 -0
- package/models/__tests__/node.ts +74 -0
- package/models/cluster/node.js +6 -5
- package/models/cluster.x-k8s.io.machinedeployment.js +2 -2
- package/models/management.cattle.io.cluster.js +22 -1
- package/models/management.cattle.io.clusterroletemplatebinding.js +3 -3
- package/models/management.cattle.io.globalrole.js +17 -2
- package/models/management.cattle.io.node.js +6 -4
- package/models/management.cattle.io.projectroletemplatebinding.js +3 -3
- package/models/management.cattle.io.roletemplate.js +17 -2
- package/package.json +2 -6
- package/pages/about.vue +2 -0
- package/pages/auth/setup.vue +5 -4
- package/pages/c/_cluster/monitoring/index.vue +8 -3
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +9 -66
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue +182 -0
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +15 -32
- package/pages/c/_cluster/uiplugins/UninstallDialog.vue +8 -46
- package/pages/c/_cluster/uiplugins/index.vue +64 -64
- package/pages/diagnostic.vue +0 -39
- package/pages/home.vue +1 -1
- package/plugins/dashboard-store/normalize.js +4 -4
- package/plugins/int-number.js +5 -2
- package/plugins/positive-int-number.js +19 -0
- package/plugins/steve/__tests__/getters.spec.ts +15 -0
- package/plugins/steve/getters.js +22 -10
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +0 -8
- package/rancher-components/Form/Radio/RadioButton.test.ts +3 -7
- package/store/index.js +4 -0
- package/store/prefs.js +1 -0
- package/types/shell/index.d.ts +13 -4
- package/utils/__tests__/cluster.test.ts +55 -0
- package/utils/__tests__/object.test.ts +21 -2
- package/utils/cluster.js +47 -1
- package/utils/object.js +12 -5
- package/utils/validators/formRules/__tests__/index.test.ts +13 -1
- package/utils/validators/formRules/index.ts +4 -0
- package/utils/validators/role-template.js +9 -1
- package/utils/version.js +1 -1
- package/yarn-error.log +16 -16
- package/components/ClusterProviderIconMenu.vue +0 -161
- package/content/docs/en-us/getting-started.md +0 -224
- package/content/docs/en-us/whats-new.md +0 -29
- package/content/docs/zh-hans/getting-started.md +0 -224
- package/content/docs/zh-hans/whats-new.md +0 -28
- package/pages/docs/_doc.vue +0 -345
- package/pages/docs/toc.js +0 -27
- package/plugins/console.js +0 -34
|
@@ -38,23 +38,44 @@ const defaultStubs = {
|
|
|
38
38
|
Tabbed: true,
|
|
39
39
|
UnitInput: true,
|
|
40
40
|
YamlEditor: true,
|
|
41
|
+
MemberRoles: true,
|
|
42
|
+
Basics: true
|
|
41
43
|
};
|
|
42
44
|
|
|
45
|
+
const mockAgentArgs = { 'cloud-provider-name': { options: [], profile: { options: [{ anything: 'yes' }] } } };
|
|
46
|
+
|
|
43
47
|
const defaultComputed = {
|
|
44
48
|
showForm() {
|
|
45
49
|
return true;
|
|
46
50
|
},
|
|
47
|
-
|
|
48
|
-
return
|
|
49
|
-
|
|
51
|
+
versionOptions() {
|
|
52
|
+
return [
|
|
53
|
+
{
|
|
54
|
+
id: 'v1.25.0+rke2r1', value: 'v1.25.0+rke2r1', serverArgs: {}, agentArgs: mockAgentArgs, charts: {}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'v1.24.0+rke2r1', value: 'v1.24.0+rke2r1', serverArgs: {}, agentArgs: mockAgentArgs, charts: {}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'v1.23.0+rke2r1', value: 'v1.23.0+rke2r1', serverArgs: {}, agentArgs: mockAgentArgs, charts: {}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'v1.25.0+k3s1', value: 'v1.25.0+k3s1', serverArgs: {}, agentArgs: mockAgentArgs, charts: {}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'v1.24.0+k3s1', value: 'v1.24.0+k3s1', serverArgs: {}, agentArgs: mockAgentArgs, charts: {}
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
}
|
|
50
70
|
};
|
|
51
71
|
|
|
52
72
|
const defaultGetters = {
|
|
53
|
-
currentStore:
|
|
54
|
-
'management/schemaFor':
|
|
55
|
-
'current_store/all':
|
|
56
|
-
'i18n/t':
|
|
57
|
-
'i18n/withFallback':
|
|
73
|
+
currentStore: () => 'current_store',
|
|
74
|
+
'management/schemaFor': jest.fn(),
|
|
75
|
+
'current_store/all': jest.fn(),
|
|
76
|
+
'i18n/t': jest.fn(),
|
|
77
|
+
'i18n/withFallback': jest.fn(),
|
|
78
|
+
'plugins/cloudProviderForDriver': jest.fn()
|
|
58
79
|
};
|
|
59
80
|
|
|
60
81
|
const defaultMocks = {
|
|
@@ -78,161 +99,54 @@ describe('component: rke2', () => {
|
|
|
78
99
|
*/
|
|
79
100
|
// eslint-disable-next-line jest/no-hooks
|
|
80
101
|
beforeEach(() => {
|
|
81
|
-
jest.spyOn(console, 'log').mockImplementation(() => {});
|
|
102
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
82
103
|
});
|
|
83
104
|
|
|
84
105
|
it.each([
|
|
85
|
-
'
|
|
86
|
-
'
|
|
87
|
-
|
|
88
|
-
'v1.25.0+
|
|
89
|
-
'v1.24.0+k3s1',
|
|
90
|
-
'v1.23.0+k3s1',
|
|
91
|
-
])('should display PSA option', (k8s) => {
|
|
92
|
-
const label = 'whatever';
|
|
93
|
-
const option = { label, value: label };
|
|
106
|
+
['custom', true],
|
|
107
|
+
['anything else', false] // without proper data, machine pool is always not present
|
|
108
|
+
])('should allow creation of RKE2 cluster with provider %p if pool machines are missing (%p)', (provider, result) => {
|
|
109
|
+
const k8s = 'v1.25.0+rke2r1';
|
|
94
110
|
const wrapper = mount(rke2, {
|
|
95
111
|
propsData: {
|
|
96
112
|
mode: 'create',
|
|
97
113
|
value: {
|
|
98
114
|
spec: {
|
|
99
115
|
...defaultSpec,
|
|
100
|
-
|
|
101
|
-
kubernetesVersion: k8s
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
provider: 'whatever',
|
|
105
|
-
},
|
|
106
|
-
computed: defaultComputed,
|
|
107
|
-
mocks: {
|
|
108
|
-
...defaultMocks,
|
|
109
|
-
$store: {
|
|
110
|
-
getters: defaultGetters,
|
|
111
|
-
dispatch: {
|
|
112
|
-
'management/find': jest.fn(),
|
|
113
|
-
'management/findAll': () => ([option]),
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
stubs: defaultStubs
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
const select = wrapper.find('[data-testid="rke2-custom-edit-psa"]');
|
|
121
|
-
|
|
122
|
-
expect((select.vm as unknown as any).options[0].label).toBe(`${ label } (Current)`);
|
|
123
|
-
});
|
|
116
|
+
kubernetesVersion: k8s,
|
|
124
117
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
['v1.24.0+rke2r1', 'default'],
|
|
128
|
-
['v1.23.0+rke2r1', 'default'],
|
|
129
|
-
['v1.25.0+k3s1', 'none'],
|
|
130
|
-
['v1.24.0+k3s1', 'default'],
|
|
131
|
-
['v1.23.0+k3s1', 'default'],
|
|
132
|
-
])('should display for version %p PSA option label %p', (k8s, partialLabel) => {
|
|
133
|
-
const label = `cluster.rke2.defaultPodSecurityAdmissionConfigurationTemplateName.option.${ partialLabel }`;
|
|
134
|
-
const option = { label, value: label };
|
|
135
|
-
const wrapper = mount(rke2, {
|
|
136
|
-
propsData: {
|
|
137
|
-
mode: 'create',
|
|
138
|
-
value: {
|
|
139
|
-
spec: {
|
|
140
|
-
...defaultSpec,
|
|
141
|
-
defaultPodSecurityAdmissionConfigurationTemplateName: label,
|
|
142
|
-
kubernetesVersion: k8s
|
|
143
|
-
}
|
|
118
|
+
},
|
|
119
|
+
agentConfig: { 'cloud-provider-name': 'any' }
|
|
144
120
|
},
|
|
145
|
-
|
|
121
|
+
selectedVersion: { agentArgs: mockAgentArgs },
|
|
122
|
+
provider,
|
|
146
123
|
},
|
|
147
124
|
computed: defaultComputed,
|
|
148
125
|
mocks: {
|
|
149
126
|
...defaultMocks,
|
|
150
|
-
$store: {
|
|
151
|
-
getters: defaultGetters,
|
|
152
|
-
dispatch: {
|
|
153
|
-
'management/find': jest.fn(),
|
|
154
|
-
'management/findAll': () => ([option]),
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
stubs: defaultStubs
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
const select = wrapper.find('[data-testid="rke2-custom-edit-psa"]');
|
|
162
|
-
|
|
163
|
-
expect((select.vm as unknown as any).options[0].label).toStrictEqual(`${ label } (Current)`);
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
it.each([
|
|
167
|
-
['anything', false, true],
|
|
168
|
-
['', false, false],
|
|
169
|
-
['', true, false],
|
|
170
|
-
])('given CIS value as %p and its override as %p, it should set PSA dropdown as disabled %p', (cis, override, disabled) => {
|
|
171
|
-
const label = 'whatever';
|
|
172
|
-
const k8s = 'v1.25.0+rke2r1';
|
|
173
|
-
const option = { label, value: label };
|
|
174
|
-
const wrapper = mount(rke2, {
|
|
175
|
-
propsData: {
|
|
176
|
-
mode: 'create',
|
|
177
|
-
value: {
|
|
178
|
-
agentConfig: { profile: cis },
|
|
179
|
-
spec: {
|
|
180
|
-
...defaultSpec,
|
|
181
|
-
defaultPodSecurityAdmissionConfigurationTemplateName: label,
|
|
182
|
-
kubernetesVersion: k8s
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
provider: 'custom',
|
|
186
|
-
},
|
|
187
|
-
computed: {
|
|
188
|
-
...defaultComputed,
|
|
189
|
-
agentArgs: () => ({ profile: { options: [cis] } }),
|
|
190
|
-
versionOptions: () => [
|
|
191
|
-
{
|
|
192
|
-
value: k8s,
|
|
193
|
-
agentArgs: { profile: { options: [cis] } },
|
|
194
|
-
charts: {},
|
|
195
|
-
profile: { options: [cis] }
|
|
196
|
-
}
|
|
197
|
-
]
|
|
198
|
-
},
|
|
199
|
-
mocks: {
|
|
200
|
-
...defaultMocks,
|
|
201
|
-
$store: {
|
|
202
|
-
getters: defaultGetters,
|
|
203
|
-
dispatch: {
|
|
204
|
-
'management/find': jest.fn(),
|
|
205
|
-
'management/findAll': () => ([option]),
|
|
206
|
-
}
|
|
207
|
-
},
|
|
127
|
+
$store: { getters: defaultGetters },
|
|
208
128
|
},
|
|
209
129
|
stubs: defaultStubs
|
|
210
130
|
});
|
|
211
131
|
|
|
212
|
-
wrapper.
|
|
213
|
-
|
|
214
|
-
const select = wrapper.find('[data-testid="rke2-custom-edit-psa"]');
|
|
215
|
-
|
|
216
|
-
expect((select.vm as unknown as any).disabled).toBe(disabled);
|
|
132
|
+
expect((wrapper.vm as any).validationPassed).toBe(result);
|
|
217
133
|
});
|
|
218
134
|
|
|
219
|
-
it
|
|
220
|
-
|
|
221
|
-
['anything else', false] // without proper data, machine pool is always not present
|
|
222
|
-
])('should allow creation of RKE2 cluster with provider %p if pool machines are missing (%p)', (provider, result) => {
|
|
223
|
-
const k8s = 'v1.25.0+rke2r1';
|
|
135
|
+
it('should allow creation of K3 clusters if pool machines are missing', () => {
|
|
136
|
+
const k8s = 'v1.25.0+k3s1';
|
|
224
137
|
const wrapper = mount(rke2, {
|
|
225
138
|
propsData: {
|
|
226
139
|
mode: 'create',
|
|
227
140
|
value: {
|
|
228
141
|
spec: {
|
|
229
142
|
...defaultSpec,
|
|
230
|
-
kubernetesVersion: k8s
|
|
231
|
-
|
|
232
|
-
}
|
|
143
|
+
kubernetesVersion: k8s
|
|
144
|
+
},
|
|
145
|
+
agentConfig: { 'cloud-provider-name': 'any' }
|
|
233
146
|
},
|
|
234
|
-
provider
|
|
147
|
+
provider: 'custom'
|
|
235
148
|
},
|
|
149
|
+
data: () => ({ credentialId: 'I am authenticated' }),
|
|
236
150
|
computed: defaultComputed,
|
|
237
151
|
mocks: {
|
|
238
152
|
...defaultMocks,
|
|
@@ -241,10 +155,10 @@ describe('component: rke2', () => {
|
|
|
241
155
|
stubs: defaultStubs
|
|
242
156
|
});
|
|
243
157
|
|
|
244
|
-
expect((wrapper.vm as any).validationPassed).toBe(
|
|
158
|
+
expect((wrapper.vm as any).validationPassed).toBe(true);
|
|
245
159
|
});
|
|
246
160
|
|
|
247
|
-
it('should
|
|
161
|
+
it('should initialize machine pools with drain before delete true', async() => {
|
|
248
162
|
const k8s = 'v1.25.0+k3s1';
|
|
249
163
|
const wrapper = mount(rke2, {
|
|
250
164
|
propsData: {
|
|
@@ -253,7 +167,8 @@ describe('component: rke2', () => {
|
|
|
253
167
|
spec: {
|
|
254
168
|
...defaultSpec,
|
|
255
169
|
kubernetesVersion: k8s
|
|
256
|
-
}
|
|
170
|
+
},
|
|
171
|
+
agentConfig: { 'cloud-provider-name': 'any' }
|
|
257
172
|
},
|
|
258
173
|
provider: 'custom'
|
|
259
174
|
},
|
|
@@ -266,7 +181,9 @@ describe('component: rke2', () => {
|
|
|
266
181
|
stubs: defaultStubs
|
|
267
182
|
});
|
|
268
183
|
|
|
269
|
-
|
|
184
|
+
await wrapper.vm.initSpecs();
|
|
185
|
+
|
|
186
|
+
wrapper.vm.machinePools.forEach((p: any) => expect(p.drainBeforeDelete).toBe(true));
|
|
270
187
|
});
|
|
271
188
|
|
|
272
189
|
// TODO: Complete test after implementing fetch https://github.com/rancher/dashboard/issues/9322
|
|
@@ -275,8 +192,11 @@ describe('component: rke2', () => {
|
|
|
275
192
|
it('adding default values if none', async() => {
|
|
276
193
|
const wrapper = shallowMount(rke2, {
|
|
277
194
|
propsData: {
|
|
278
|
-
mode:
|
|
279
|
-
value:
|
|
195
|
+
mode: 'create',
|
|
196
|
+
value: {
|
|
197
|
+
spec: { ...defaultSpec },
|
|
198
|
+
agentConfig: { 'cloud-provider-name': 'any' }
|
|
199
|
+
},
|
|
280
200
|
provider: 'custom'
|
|
281
201
|
},
|
|
282
202
|
computed: defaultComputed,
|
|
@@ -317,8 +237,11 @@ describe('component: rke2', () => {
|
|
|
317
237
|
it('should display agent configuration tab', async() => {
|
|
318
238
|
const wrapper = shallowMount(rke2, {
|
|
319
239
|
propsData: {
|
|
320
|
-
mode:
|
|
321
|
-
value:
|
|
240
|
+
mode: 'create',
|
|
241
|
+
value: {
|
|
242
|
+
spec: { ...defaultSpec },
|
|
243
|
+
agentConfig: { 'cloud-provider-name': 'any' }
|
|
244
|
+
},
|
|
322
245
|
provider: 'custom'
|
|
323
246
|
},
|
|
324
247
|
computed: defaultComputed,
|