@rancher/shell 0.3.26 → 0.3.28
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 +8 -23
- package/assets/translations/zh-hans.yaml +2 -26
- package/chart/gatekeeper.vue +2 -11
- package/chart/istio.vue +1 -10
- package/chart/logging/index.vue +2 -11
- package/chart/monitoring/index.vue +1 -9
- package/chart/rancher-backup/index.vue +1 -9
- package/components/AlertTable.vue +8 -6
- package/components/Carousel.vue +2 -1
- package/components/EmberPage.vue +2 -2
- package/components/EtcdInfoBanner.vue +12 -2
- package/components/GlobalRoleBindings.vue +10 -0
- package/components/GrafanaDashboard.vue +8 -3
- package/components/Wizard.vue +17 -1
- package/components/auth/RoleDetailEdit.vue +17 -1
- package/components/form/ArrayList.vue +20 -11
- package/components/form/__tests__/ArrayList.test.ts +44 -0
- package/components/formatter/ClusterProvider.vue +1 -18
- package/components/nav/Header.vue +5 -4
- package/components/nav/TopLevelMenu.vue +38 -15
- package/components/nav/WindowManager/ContainerLogs.vue +22 -19
- package/components/nav/__tests__/TopLevelMenu.test.ts +120 -0
- package/components/nav/__tests__/Type.test.ts +139 -0
- package/config/private-label.js +1 -1
- package/config/product/manager.js +0 -13
- package/config/settings.ts +0 -2
- package/config/types.js +0 -4
- package/core/types.ts +11 -4
- 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 +19 -107
- package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +1 -1
- 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/mixins/workload.js +14 -4
- 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/fleet.cattle.io.cluster.js +11 -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 +1 -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/auth/roles/index.vue +11 -1
- package/pages/c/_cluster/explorer/index.vue +7 -49
- package/pages/c/_cluster/manager/pages/_page.vue +4 -5
- package/pages/c/_cluster/monitoring/index.vue +26 -39
- package/pages/support/index.vue +1 -8
- package/promptRemove/management.cattle.io.project.vue +6 -9
- package/rancher-components/BadgeState/BadgeState.vue +1 -5
- package/rancher-components/Banner/Banner.test.ts +1 -51
- package/rancher-components/Banner/Banner.vue +53 -134
- package/rancher-components/Card/Card.vue +7 -24
- package/rancher-components/Form/Checkbox/Checkbox.test.ts +29 -20
- package/rancher-components/Form/Checkbox/Checkbox.vue +20 -45
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +8 -2
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +10 -22
- package/rancher-components/Form/Radio/RadioButton.vue +13 -30
- package/rancher-components/Form/Radio/RadioGroup.vue +7 -26
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -7
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +38 -25
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +11 -23
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +5 -19
- package/rancher-components/StringList/StringList.test.ts +49 -453
- package/rancher-components/StringList/StringList.vue +58 -92
- package/rancher-components/components/Form/Radio/RadioGroup.test.ts +30 -0
- package/rancher-components/components/Form/Radio/RadioGroup.vue +4 -0
- package/rancher-components/components/StringList/StringList.test.ts +270 -0
- package/rancher-components/components/StringList/StringList.vue +57 -18
- package/store/features.js +1 -0
- package/store/prefs.js +0 -3
- package/types/shell/index.d.ts +26 -17
- package/utils/__tests__/object.test.ts +67 -1
- package/utils/__tests__/version.test.ts +13 -23
- package/utils/cluster.js +1 -1
- package/utils/custom-validators.js +0 -2
- package/utils/error.js +16 -1
- package/utils/grafana.js +1 -2
- package/utils/monitoring.js +25 -1
- package/utils/object.js +4 -3
- package/utils/sort.js +1 -1
- package/utils/validators/formRules/__tests__/index.test.ts +49 -4
- package/utils/validators/formRules/index.ts +13 -10
- package/utils/validators/role-template.js +1 -1
- package/utils/validators/setting.js +6 -10
- package/utils/version.js +0 -13
- package/components/ChartPsp.vue +0 -76
- package/components/__tests__/ChartPsp.test.ts +0 -75
- package/components/formatter/__tests__/ClusterProvider.test.ts +0 -28
- package/rancher-components/Card/Card.test.ts +0 -37
- package/rancher-components/Form/Radio/RadioButton.test.ts +0 -31
- package/yarn-error.log +0 -200
package/config/types.js
CHANGED
|
@@ -53,8 +53,6 @@ export const NODE = 'node';
|
|
|
53
53
|
export const NETWORK_POLICY = 'networking.k8s.io.networkpolicy';
|
|
54
54
|
export const POD = 'pod';
|
|
55
55
|
export const POD_DISRUPTION_BUDGET = 'policy.poddisruptionbudget';
|
|
56
|
-
export const PSP = 'policy.podsecuritypolicy';
|
|
57
|
-
export const PSPS = 'policy.podsecuritypolicies';
|
|
58
56
|
export const PV = 'persistentvolume';
|
|
59
57
|
export const PVC = 'persistentvolumeclaim';
|
|
60
58
|
export const RESOURCE_QUOTA = 'resourcequota';
|
|
@@ -183,8 +181,6 @@ export const MANAGEMENT = {
|
|
|
183
181
|
TOKEN: 'management.cattle.io.token',
|
|
184
182
|
GLOBAL_ROLE: 'management.cattle.io.globalrole',
|
|
185
183
|
GLOBAL_ROLE_BINDING: 'management.cattle.io.globalrolebinding',
|
|
186
|
-
POD_SECURITY_POLICY_TEMPLATE: 'management.cattle.io.podsecuritypolicytemplate',
|
|
187
|
-
PSP_TEMPLATE_BINDING: 'management.cattle.io.podsecuritypolicytemplateprojectbinding',
|
|
188
184
|
PSA: 'management.cattle.io.podsecurityadmissionconfigurationtemplate',
|
|
189
185
|
MANAGED_CHART: 'management.cattle.io.managedchart',
|
|
190
186
|
USER_NOTIFICATION: 'management.cattle.io.rancherusernotification',
|
package/core/types.ts
CHANGED
|
@@ -323,6 +323,11 @@ export interface ConfigureTypeOptions {
|
|
|
323
323
|
*/
|
|
324
324
|
isRemovable?: boolean;
|
|
325
325
|
|
|
326
|
+
/**
|
|
327
|
+
* Resources of this type can be edited
|
|
328
|
+
*/
|
|
329
|
+
isEditable?: boolean;
|
|
330
|
+
|
|
326
331
|
/**
|
|
327
332
|
* This type should be grouped by namespaces when displayed in a table
|
|
328
333
|
*/
|
|
@@ -343,16 +348,18 @@ export interface ConfigureTypeOptions {
|
|
|
343
348
|
*/
|
|
344
349
|
showState?: boolean;
|
|
345
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Define where this type/page should navigate to (menu entry routing)
|
|
353
|
+
*/
|
|
354
|
+
customRoute?: Object;
|
|
355
|
+
|
|
346
356
|
/**
|
|
347
357
|
* Leaving these here for completeness but I don't think these should be advertised as useable to plugin creators.
|
|
348
358
|
*/
|
|
349
359
|
// alias
|
|
350
|
-
// customRoute
|
|
351
|
-
// customRoute
|
|
352
360
|
// depaginate
|
|
353
361
|
// graphConfig
|
|
354
362
|
// hasGraph
|
|
355
|
-
// isEditable
|
|
356
363
|
// limit
|
|
357
364
|
// listGroups
|
|
358
365
|
// localOnly
|
|
@@ -379,7 +386,7 @@ export interface ConfigureVirtualTypeOptions extends ConfigureTypeOptions {
|
|
|
379
386
|
/**
|
|
380
387
|
* The route that this type should correspond to {@link PluginRouteConfig} {@link RouteConfig}
|
|
381
388
|
*/
|
|
382
|
-
route: PluginRouteConfig | RouteConfig;
|
|
389
|
+
route: PluginRouteConfig | RouteConfig | Object;
|
|
383
390
|
}
|
|
384
391
|
|
|
385
392
|
export interface DSLReturnType {
|
|
@@ -5,7 +5,6 @@ import CreateEditView from '@shell/mixins/create-edit-view';
|
|
|
5
5
|
import FormValidation from '@shell/mixins/form-validation';
|
|
6
6
|
import CruResource from '@shell/components/CruResource';
|
|
7
7
|
import Labels from '@shell/components/form/Labels';
|
|
8
|
-
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
9
8
|
import ResourceQuota from '@shell/components/form/ResourceQuota/Project';
|
|
10
9
|
import { HARVESTER_TYPES, RANCHER_TYPES } from '@shell/components/form/ResourceQuota/shared';
|
|
11
10
|
import Tab from '@shell/components/Tabbed/Tab';
|
|
@@ -21,26 +20,15 @@ import { Banner } from '@components/Banner';
|
|
|
21
20
|
|
|
22
21
|
export default {
|
|
23
22
|
components: {
|
|
24
|
-
ContainerResourceLimit, CruResource, Labels,
|
|
23
|
+
ContainerResourceLimit, CruResource, Labels, NameNsDescription, ProjectMembershipEditor, ResourceQuota, Tabbed, Tab, Banner
|
|
25
24
|
},
|
|
26
25
|
|
|
27
26
|
mixins: [CreateEditView, FormValidation],
|
|
28
|
-
async fetch() {
|
|
29
|
-
if ( this.$store.getters['management/canList'](MANAGEMENT.POD_SECURITY_POLICY_TEMPLATE) ) {
|
|
30
|
-
this.allPSPs = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.POD_SECURITY_POLICY_TEMPLATE });
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// User can only change the PSP if the user has permissions to see the binding schema for PSP Templates
|
|
34
|
-
const pspBindingSchema = this.$store.getters['management/schemaFor'](MANAGEMENT.PSP_TEMPLATE_BINDING);
|
|
35
|
-
|
|
36
|
-
this.canEditPSPBindings = !!pspBindingSchema;
|
|
37
|
-
},
|
|
38
27
|
data() {
|
|
39
28
|
this.$set(this.value, 'spec', this.value.spec || {});
|
|
40
29
|
this.$set(this.value.spec, 'podSecurityPolicyTemplateId', this.value.status?.podSecurityPolicyTemplateId || '');
|
|
41
30
|
|
|
42
31
|
return {
|
|
43
|
-
allPSPs: [],
|
|
44
32
|
projectRoleTemplateBindingSchema: this.$store.getters[`management/schemaFor`](MANAGEMENT.PROJECT_ROLE_TEMPLATE_BINDING),
|
|
45
33
|
createLocation: {
|
|
46
34
|
name: 'c-cluster-product-resource-create',
|
|
@@ -57,7 +45,6 @@ export default {
|
|
|
57
45
|
HARVESTER_TYPES,
|
|
58
46
|
RANCHER_TYPES,
|
|
59
47
|
fvFormRuleSets: [{ path: 'spec.displayName', rules: ['required'] }],
|
|
60
|
-
canEditPSPBindings: true,
|
|
61
48
|
};
|
|
62
49
|
},
|
|
63
50
|
computed: {
|
|
@@ -91,31 +78,6 @@ export default {
|
|
|
91
78
|
return (this.currentCluster?.spec?.kubernetesVersion || '').includes('k3s');
|
|
92
79
|
},
|
|
93
80
|
|
|
94
|
-
pspOptions() {
|
|
95
|
-
if ( this.isK3s || !this.currentCluster.spec.defaultPodSecurityPolicyTemplateName ) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const out = [{ label: this.t('project.psp.default'), value: '' }];
|
|
100
|
-
|
|
101
|
-
if ( this.allPSPs ) {
|
|
102
|
-
for ( const pspt of this.allPSPs ) {
|
|
103
|
-
out.push({
|
|
104
|
-
label: pspt.nameDisplay,
|
|
105
|
-
value: pspt.id,
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const cur = this.value.status?.podSecurityPolicyTemplateId;
|
|
111
|
-
|
|
112
|
-
if ( cur && !out.find((x) => x.value === cur) ) {
|
|
113
|
-
out.unshift({ label: this.t('project.psp.current', { value: cur }), value: cur });
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return out;
|
|
117
|
-
},
|
|
118
|
-
|
|
119
81
|
isHarvester() {
|
|
120
82
|
return this.$store.getters['currentProduct'].inStore === HARVESTER;
|
|
121
83
|
},
|
|
@@ -223,19 +185,6 @@ export default {
|
|
|
223
185
|
:normalize-name="false"
|
|
224
186
|
:rules="{ name: fvGetAndReportPathRules('spec.displayName'), namespace: [], description: [] }"
|
|
225
187
|
/>
|
|
226
|
-
<div class="row mb-20">
|
|
227
|
-
<div class="col span-3">
|
|
228
|
-
<LabeledSelect
|
|
229
|
-
v-if="pspOptions"
|
|
230
|
-
v-model="value.spec.podSecurityPolicyTemplateId"
|
|
231
|
-
class="psp"
|
|
232
|
-
:mode="mode"
|
|
233
|
-
:options="pspOptions"
|
|
234
|
-
:disabled="!canEditPSPBindings"
|
|
235
|
-
:label="t('project.psp.label')"
|
|
236
|
-
/>
|
|
237
|
-
</div>
|
|
238
|
-
</div>
|
|
239
188
|
<Tabbed :side-tabs="true">
|
|
240
189
|
<Tab
|
|
241
190
|
v-if="canViewMembers"
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import CruResource from '@shell/components/CruResource';
|
|
3
3
|
import { LabeledInput } from '@components/Form/LabeledInput';
|
|
4
4
|
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
5
|
+
import { Banner } from '@components/Banner';
|
|
5
6
|
import CreateEditView from '@shell/mixins/create-edit-view';
|
|
6
7
|
import { TextAreaAutoGrow } from '@components/Form/TextArea';
|
|
7
8
|
import formRulesGenerator from '@shell/utils/validators/formRules/index';
|
|
@@ -11,6 +12,7 @@ import { RadioGroup } from '@components/Form/Radio';
|
|
|
11
12
|
import FormValidation from '@shell/mixins/form-validation';
|
|
12
13
|
import { setBrand } from '@shell/config/private-label';
|
|
13
14
|
import { keyBy, mapValues } from 'lodash';
|
|
15
|
+
import { isLocalhost, isServerUrl } from '@shell/utils/validators/setting';
|
|
14
16
|
|
|
15
17
|
export default {
|
|
16
18
|
components: {
|
|
@@ -18,7 +20,8 @@ export default {
|
|
|
18
20
|
LabeledInput,
|
|
19
21
|
LabeledSelect,
|
|
20
22
|
RadioGroup,
|
|
21
|
-
TextAreaAutoGrow
|
|
23
|
+
TextAreaAutoGrow,
|
|
24
|
+
Banner
|
|
22
25
|
},
|
|
23
26
|
|
|
24
27
|
mixins: [CreateEditView, FormValidation],
|
|
@@ -63,6 +66,14 @@ export default {
|
|
|
63
66
|
|
|
64
67
|
return factoryArg ? rule(factoryArg) : rule;
|
|
65
68
|
}) : {};
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
showLocalhostWarning() {
|
|
72
|
+
return isServerUrl(this.value.id) && isLocalhost(this.value.value);
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
validationPassed() {
|
|
76
|
+
return this.fvFormIsValid && this.fvGetPathErrors(['value']).length === 0;
|
|
66
77
|
}
|
|
67
78
|
},
|
|
68
79
|
|
|
@@ -98,6 +109,11 @@ export default {
|
|
|
98
109
|
if (ev && ev.srcElement) {
|
|
99
110
|
ev.srcElement.blur();
|
|
100
111
|
}
|
|
112
|
+
|
|
113
|
+
if (isServerUrl(this.value.id) && !this.value.default) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
101
117
|
this.value.value = this.value.default;
|
|
102
118
|
}
|
|
103
119
|
}
|
|
@@ -113,7 +129,7 @@ export default {
|
|
|
113
129
|
:resource="value"
|
|
114
130
|
:subtypes="[]"
|
|
115
131
|
:can-yaml="false"
|
|
116
|
-
:validation-passed="
|
|
132
|
+
:validation-passed="validationPassed"
|
|
117
133
|
@error="e=>errors = e"
|
|
118
134
|
@finish="saveSettings"
|
|
119
135
|
@cancel="done"
|
|
@@ -138,6 +154,19 @@ export default {
|
|
|
138
154
|
</button>
|
|
139
155
|
</div>
|
|
140
156
|
|
|
157
|
+
<Banner
|
|
158
|
+
v-if="showLocalhostWarning"
|
|
159
|
+
color="warning"
|
|
160
|
+
:label="t('validation.setting.serverUrl.localhost')"
|
|
161
|
+
/>
|
|
162
|
+
|
|
163
|
+
<Banner
|
|
164
|
+
v-for="(err, i) in fvGetPathErrors(['value'])"
|
|
165
|
+
:key="i"
|
|
166
|
+
color="error"
|
|
167
|
+
:label="err"
|
|
168
|
+
/>
|
|
169
|
+
|
|
141
170
|
<div class="mt-20">
|
|
142
171
|
<div v-if="setting.kind === 'enum'">
|
|
143
172
|
<LabeledSelect
|
|
@@ -40,12 +40,6 @@ export default {
|
|
|
40
40
|
required: true,
|
|
41
41
|
},
|
|
42
42
|
|
|
43
|
-
psps: {
|
|
44
|
-
type: Object,
|
|
45
|
-
default: null,
|
|
46
|
-
required: false
|
|
47
|
-
},
|
|
48
|
-
|
|
49
43
|
credential: {
|
|
50
44
|
type: Object,
|
|
51
45
|
default: null,
|
|
@@ -61,15 +55,6 @@ export default {
|
|
|
61
55
|
required: true
|
|
62
56
|
},
|
|
63
57
|
|
|
64
|
-
cisPsaChangeBanner: {
|
|
65
|
-
type: Boolean,
|
|
66
|
-
required: true
|
|
67
|
-
},
|
|
68
|
-
allPsps: {
|
|
69
|
-
type: Array,
|
|
70
|
-
required: false,
|
|
71
|
-
default: null
|
|
72
|
-
},
|
|
73
58
|
allPsas: {
|
|
74
59
|
type: Array,
|
|
75
60
|
required: true
|
|
@@ -80,10 +65,7 @@ export default {
|
|
|
80
65
|
required: false,
|
|
81
66
|
default: null
|
|
82
67
|
},
|
|
83
|
-
|
|
84
|
-
type: Boolean,
|
|
85
|
-
required: true
|
|
86
|
-
},
|
|
68
|
+
|
|
87
69
|
selectedVersion: {
|
|
88
70
|
type: Object,
|
|
89
71
|
required: true
|
|
@@ -112,10 +94,6 @@ export default {
|
|
|
112
94
|
type: Boolean,
|
|
113
95
|
required: true
|
|
114
96
|
},
|
|
115
|
-
hasPsaTemplates: {
|
|
116
|
-
type: Boolean,
|
|
117
|
-
required: true
|
|
118
|
-
},
|
|
119
97
|
isK3s: {
|
|
120
98
|
type: Boolean,
|
|
121
99
|
required: true
|
|
@@ -145,14 +123,6 @@ export default {
|
|
|
145
123
|
computed: {
|
|
146
124
|
...mapGetters({ features: 'features/get' }),
|
|
147
125
|
|
|
148
|
-
/**
|
|
149
|
-
* Check presence of PSPs as template or CLI creation
|
|
150
|
-
*/
|
|
151
|
-
|
|
152
|
-
hasPsps() {
|
|
153
|
-
return !!this.psps?.count;
|
|
154
|
-
},
|
|
155
|
-
|
|
156
126
|
serverConfig() {
|
|
157
127
|
return this.value.spec.rkeConfig.machineGlobalConfig;
|
|
158
128
|
},
|
|
@@ -161,17 +131,6 @@ export default {
|
|
|
161
131
|
return this.value.agentConfig;
|
|
162
132
|
},
|
|
163
133
|
|
|
164
|
-
/**
|
|
165
|
-
* Define introduction of PSA and return need of PSA templates based on min k8s version
|
|
166
|
-
*/
|
|
167
|
-
needsPSA() {
|
|
168
|
-
const release = this.value?.spec?.kubernetesVersion || '';
|
|
169
|
-
const version = release.match(/\d+/g);
|
|
170
|
-
const isRequiredVersion = version?.length ? +version[0] > 1 || +version[1] >= 23 : false;
|
|
171
|
-
|
|
172
|
-
return isRequiredVersion;
|
|
173
|
-
},
|
|
174
|
-
|
|
175
134
|
profileOptions() {
|
|
176
135
|
const out = (this.agentArgs?.profile?.options || []).map((x) => {
|
|
177
136
|
return { label: x, value: x };
|
|
@@ -189,35 +148,9 @@ export default {
|
|
|
189
148
|
* Allow to display override if PSA is needed and profile is set
|
|
190
149
|
*/
|
|
191
150
|
hasCisOverride() {
|
|
192
|
-
return (this.serverConfig?.profile || this.agentConfig?.profile) &&
|
|
151
|
+
return (this.serverConfig?.profile || this.agentConfig?.profile) &&
|
|
193
152
|
// Also check other cases on when to display the override
|
|
194
|
-
this.
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
pspOptions() {
|
|
198
|
-
if ( this.isK3s ) {
|
|
199
|
-
return null;
|
|
200
|
-
}
|
|
201
|
-
const out = [{
|
|
202
|
-
label: this.$store.getters['i18n/t']('cluster.rke2.defaultPodSecurityPolicyTemplateName.option'),
|
|
203
|
-
value: ''
|
|
204
|
-
}];
|
|
205
|
-
|
|
206
|
-
if ( this.allPsps ) {
|
|
207
|
-
for ( const pspt of this.allPsps ) {
|
|
208
|
-
out.push({
|
|
209
|
-
label: pspt.nameDisplay,
|
|
210
|
-
value: pspt.id,
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
const cur = this.value.spec.defaultPodSecurityPolicyTemplateName;
|
|
215
|
-
|
|
216
|
-
if ( cur && !out.find((x) => x.value === cur) ) {
|
|
217
|
-
out.unshift({ label: `${ cur } (Current)`, value: cur });
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return out;
|
|
153
|
+
this.showCisProfile && this.isCisSupported;
|
|
221
154
|
},
|
|
222
155
|
|
|
223
156
|
/**
|
|
@@ -226,14 +159,14 @@ export default {
|
|
|
226
159
|
isPsaDisabled() {
|
|
227
160
|
const cisValue = this.agentConfig?.profile || this.serverConfig?.profile;
|
|
228
161
|
|
|
229
|
-
return !(!cisValue || this.cisOverride) && this.
|
|
162
|
+
return !(!cisValue || this.cisOverride) && this.isCisSupported;
|
|
230
163
|
},
|
|
231
164
|
|
|
232
165
|
/**
|
|
233
166
|
* Get the default label for the PSA template option
|
|
234
167
|
*/
|
|
235
168
|
defaultPsaOptionLabel() {
|
|
236
|
-
const optionCase = !this.
|
|
169
|
+
const optionCase = !this.isK3s ? 'default' : 'none';
|
|
237
170
|
|
|
238
171
|
return this.$store.getters['i18n/t'](`cluster.rke2.defaultPodSecurityAdmissionConfigurationTemplateName.option.${ optionCase }`);
|
|
239
172
|
},
|
|
@@ -242,9 +175,6 @@ export default {
|
|
|
242
175
|
* Convert PSA templates into options, sorting and flagging if any selected
|
|
243
176
|
*/
|
|
244
177
|
psaOptions() {
|
|
245
|
-
if ( !this.needsPSA ) {
|
|
246
|
-
return [];
|
|
247
|
-
}
|
|
248
178
|
const out = [{
|
|
249
179
|
label: this.defaultPsaOptionLabel,
|
|
250
180
|
value: ''
|
|
@@ -377,6 +307,13 @@ export default {
|
|
|
377
307
|
const canNotEdit = this.clusterIsAlreadyCreated && !this.unsupportedCloudProvider;
|
|
378
308
|
|
|
379
309
|
return canNotEdit;
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Display warning about additional configuration needed for cloud provider Amazon if kube >= 1.27
|
|
314
|
+
*/
|
|
315
|
+
showCloudProviderAmazonAdditionalConfigWarning() {
|
|
316
|
+
return !!semver.gte(this.value.spec.kubernetesVersion, 'v1.27.0') && this.agentConfig['cloud-provider-name'] === 'aws';
|
|
380
317
|
}
|
|
381
318
|
},
|
|
382
319
|
|
|
@@ -413,6 +350,12 @@ export default {
|
|
|
413
350
|
v-clean-html="t('cluster.harvester.warning.cloudProvider.incompatible', null, true)"
|
|
414
351
|
/>
|
|
415
352
|
</Banner>
|
|
353
|
+
<Banner
|
|
354
|
+
v-if="showCloudProviderAmazonAdditionalConfigWarning"
|
|
355
|
+
color="warning"
|
|
356
|
+
>
|
|
357
|
+
<span v-clean-html="t('cluster.banner.cloudProviderAddConfig', {}, true)" />
|
|
358
|
+
</Banner>
|
|
416
359
|
<div class="row mb-10">
|
|
417
360
|
<div class="col span-6">
|
|
418
361
|
<LabeledSelect
|
|
@@ -502,21 +445,6 @@ export default {
|
|
|
502
445
|
<h3>
|
|
503
446
|
{{ t('cluster.rke2.security.header') }}
|
|
504
447
|
</h3>
|
|
505
|
-
<Banner
|
|
506
|
-
v-if="isEdit && !needsPsp && hasPsps"
|
|
507
|
-
color="warning"
|
|
508
|
-
:label="t('cluster.banner.invalidPsps')"
|
|
509
|
-
/>
|
|
510
|
-
<Banner
|
|
511
|
-
v-else-if="isCreate && !needsPsp"
|
|
512
|
-
color="info"
|
|
513
|
-
:label="t('cluster.banner.removedPsp')"
|
|
514
|
-
/>
|
|
515
|
-
<Banner
|
|
516
|
-
v-else-if="isCreate && hasPsps"
|
|
517
|
-
color="info"
|
|
518
|
-
:label="t('cluster.banner.deprecatedPsp')"
|
|
519
|
-
/>
|
|
520
448
|
|
|
521
449
|
<Banner
|
|
522
450
|
v-if="showCisProfile && !isCisSupported && isEdit"
|
|
@@ -526,21 +454,6 @@ export default {
|
|
|
526
454
|
</Banner>
|
|
527
455
|
|
|
528
456
|
<div class="row mb-10">
|
|
529
|
-
<div
|
|
530
|
-
v-if="pspOptions && needsPsp"
|
|
531
|
-
class="col span-6"
|
|
532
|
-
>
|
|
533
|
-
<!-- PSP template selector -->
|
|
534
|
-
<LabeledSelect
|
|
535
|
-
v-model="value.spec.defaultPodSecurityPolicyTemplateName"
|
|
536
|
-
data-testid="rke2-custom-edit-psp"
|
|
537
|
-
:mode="mode"
|
|
538
|
-
:options="pspOptions"
|
|
539
|
-
:label="t('cluster.rke2.defaultPodSecurityPolicyTemplateName.label')"
|
|
540
|
-
@input="$emit('psp-changed', $event)"
|
|
541
|
-
/>
|
|
542
|
-
</div>
|
|
543
|
-
|
|
544
457
|
<div
|
|
545
458
|
v-if="showCisProfile"
|
|
546
459
|
class="col span-6"
|
|
@@ -579,14 +492,13 @@ export default {
|
|
|
579
492
|
:label="t('cluster.rke2.banner.cisOverride')"
|
|
580
493
|
/>
|
|
581
494
|
<Banner
|
|
582
|
-
v-if="
|
|
495
|
+
v-if="!cisOverride"
|
|
583
496
|
color="info"
|
|
584
497
|
:label="t('cluster.rke2.banner.psaChange')"
|
|
585
498
|
/>
|
|
586
499
|
</template>
|
|
587
500
|
|
|
588
501
|
<div
|
|
589
|
-
v-if="needsPSA"
|
|
590
502
|
class="row mb-10 mt-10"
|
|
591
503
|
>
|
|
592
504
|
<div class="col span-6">
|
|
@@ -55,7 +55,7 @@ export default {
|
|
|
55
55
|
this.controlPlane && out.push('--controlplane');
|
|
56
56
|
this.worker && out.push('--worker');
|
|
57
57
|
this.address && out.push(`--address ${ sanitizeIP(this.address) }`);
|
|
58
|
-
this.internalAddress && out.push(`--internal-address ${
|
|
58
|
+
this.internalAddress && out.push(`--internal-address ${ sanitizeIP(this.internalAddress) }`);
|
|
59
59
|
this.nodeName && out.push(`--node-name ${ sanitizeValue(this.nodeName) }`);
|
|
60
60
|
|
|
61
61
|
for ( const key in this.labels ) {
|
|
@@ -95,7 +95,6 @@ describe('component: Basics', () => {
|
|
|
95
95
|
cisOverride: false,
|
|
96
96
|
cisPsaChangeBanner: true,
|
|
97
97
|
allPsas: [],
|
|
98
|
-
needsPsp: false,
|
|
99
98
|
selectedVersion: k8s,
|
|
100
99
|
versionOptions: mockVersionOptions,
|
|
101
100
|
isHarvesterDriver: false,
|
|
@@ -149,7 +148,6 @@ describe('component: Basics', () => {
|
|
|
149
148
|
cisOverride: false,
|
|
150
149
|
cisPsaChangeBanner: true,
|
|
151
150
|
allPsas: [],
|
|
152
|
-
needsPsp: false,
|
|
153
151
|
selectedVersion: mockVersionOptions[0],
|
|
154
152
|
versionOptions: mockVersionOptions,
|
|
155
153
|
isHarvesterDriver: false,
|
|
@@ -200,7 +198,6 @@ describe('component: Basics', () => {
|
|
|
200
198
|
userChartValues: {},
|
|
201
199
|
cisPsaChangeBanner: true,
|
|
202
200
|
allPsas: [],
|
|
203
|
-
needsPsp: false,
|
|
204
201
|
cisOverride: override,
|
|
205
202
|
selectedVersion: mockVersionOptions[0],
|
|
206
203
|
versionOptions: [{
|