@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.
Files changed (55) hide show
  1. package/assets/translations/en-us.yaml +19 -21
  2. package/assets/translations/zh-hans.yaml +0 -23
  3. package/chart/gatekeeper.vue +2 -11
  4. package/chart/istio.vue +1 -10
  5. package/chart/logging/index.vue +2 -11
  6. package/chart/monitoring/grafana/index.vue +2 -2
  7. package/chart/monitoring/index.vue +1 -9
  8. package/chart/rancher-backup/index.vue +1 -9
  9. package/components/AsyncButton.vue +9 -0
  10. package/components/Carousel.vue +2 -1
  11. package/components/SortableTable/THead.vue +7 -9
  12. package/components/SortableTable/index.vue +1 -2
  13. package/components/fleet/FleetStatus.vue +3 -3
  14. package/components/fleet/FleetSummary.vue +32 -27
  15. package/components/formatter/ClusterProvider.vue +1 -18
  16. package/components/nav/WindowManager/ContainerLogs.vue +22 -19
  17. package/config/product/manager.js +0 -13
  18. package/config/types.js +0 -4
  19. package/detail/provisioning.cattle.io.cluster.vue +2 -1
  20. package/edit/management.cattle.io.project.vue +1 -52
  21. package/edit/management.cattle.io.setting.vue +31 -2
  22. package/edit/provisioning.cattle.io.cluster/Basics.vue +6 -107
  23. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +0 -3
  24. package/edit/provisioning.cattle.io.cluster/rke2.vue +3 -128
  25. package/edit/workload/index.vue +2 -1
  26. package/machine-config/__tests__/vmwarevsphere.test.ts +72 -0
  27. package/machine-config/vmwarevsphere.vue +68 -13
  28. package/middleware/authenticated.js +4 -2
  29. package/models/__tests__/management.cattle.io.cluster.test.ts +19 -0
  30. package/models/__tests__/provisioning.cattle.io.cluster.test.ts +90 -0
  31. package/models/cluster.x-k8s.io.machine.js +1 -1
  32. package/models/management.cattle.io.cluster.js +4 -0
  33. package/models/management.cattle.io.project.js +0 -36
  34. package/models/management.cattle.io.setting.js +11 -7
  35. package/models/provisioning.cattle.io.cluster.js +16 -4
  36. package/package.json +2 -1
  37. package/pages/auth/setup.vue +38 -1
  38. package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +2 -17
  39. package/pages/c/_cluster/apps/charts/index.vue +0 -15
  40. package/pages/c/_cluster/apps/charts/install.helpers.js +2 -13
  41. package/pages/c/_cluster/apps/charts/install.vue +1 -1
  42. package/pages/c/_cluster/explorer/index.vue +0 -47
  43. package/pages/c/_cluster/manager/pages/_page.vue +4 -5
  44. package/rancher-components/components/StringList/StringList.test.ts +270 -0
  45. package/rancher-components/components/StringList/StringList.vue +57 -18
  46. package/store/prefs.js +0 -3
  47. package/types/shell/index.d.ts +13 -7
  48. package/utils/custom-validators.js +0 -2
  49. package/utils/error.js +16 -1
  50. package/utils/validators/formRules/__tests__/index.test.ts +49 -4
  51. package/utils/validators/formRules/index.ts +12 -9
  52. package/utils/validators/setting.js +6 -10
  53. package/components/ChartPsp.vue +0 -76
  54. package/components/__tests__/ChartPsp.test.ts +0 -75
  55. package/components/formatter/__tests__/ClusterProvider.test.ts +0 -28
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',
@@ -782,10 +782,11 @@ export default {
782
782
  </div>
783
783
  </div>
784
784
  <div
785
- v-if="group.ref && poolSummaryInfo[group.ref]"
785
+ v-if="group.ref"
786
786
  class="right group-header-buttons mr-20"
787
787
  >
788
788
  <MachineSummaryGraph
789
+ v-if="poolSummaryInfo[group.ref]"
789
790
  :row="poolSummaryInfo[group.ref]"
790
791
  :horizontal="true"
791
792
  class="mr-20"
@@ -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, LabeledSelect, NameNsDescription, ProjectMembershipEditor, ResourceQuota, Tabbed, Tab, Banner
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="fvFormIsValid"
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
- needsPsp: {
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) && this.needsPSA &&
151
+ return (this.serverConfig?.profile || this.agentConfig?.profile) &&
193
152
  // Also check other cases on when to display the override
194
- this.hasPsaTemplates && this.showCisProfile && this.isCisSupported;
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.hasPsaTemplates && this.isCisSupported;
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.needsPsp && !this.isK3s ? 'default' : 'none';
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: ''
@@ -515,21 +445,6 @@ export default {
515
445
  <h3>
516
446
  {{ t('cluster.rke2.security.header') }}
517
447
  </h3>
518
- <Banner
519
- v-if="isEdit && !needsPsp && hasPsps"
520
- color="warning"
521
- :label="t('cluster.banner.invalidPsps')"
522
- />
523
- <Banner
524
- v-else-if="isCreate && !needsPsp"
525
- color="info"
526
- :label="t('cluster.banner.removedPsp')"
527
- />
528
- <Banner
529
- v-else-if="isCreate && hasPsps"
530
- color="info"
531
- :label="t('cluster.banner.deprecatedPsp')"
532
- />
533
448
 
534
449
  <Banner
535
450
  v-if="showCisProfile && !isCisSupported && isEdit"
@@ -539,21 +454,6 @@ export default {
539
454
  </Banner>
540
455
 
541
456
  <div class="row mb-10">
542
- <div
543
- v-if="pspOptions && needsPsp"
544
- class="col span-6"
545
- >
546
- <!-- PSP template selector -->
547
- <LabeledSelect
548
- v-model="value.spec.defaultPodSecurityPolicyTemplateName"
549
- data-testid="rke2-custom-edit-psp"
550
- :mode="mode"
551
- :options="pspOptions"
552
- :label="t('cluster.rke2.defaultPodSecurityPolicyTemplateName.label')"
553
- @input="$emit('psp-changed', $event)"
554
- />
555
- </div>
556
-
557
457
  <div
558
458
  v-if="showCisProfile"
559
459
  class="col span-6"
@@ -592,14 +492,13 @@ export default {
592
492
  :label="t('cluster.rke2.banner.cisOverride')"
593
493
  />
594
494
  <Banner
595
- v-if="cisPsaChangeBanner && !cisOverride"
495
+ v-if="!cisOverride"
596
496
  color="info"
597
497
  :label="t('cluster.rke2.banner.psaChange')"
598
498
  />
599
499
  </template>
600
500
 
601
501
  <div
602
- v-if="needsPSA"
603
502
  class="row mb-10 mt-10"
604
503
  >
605
504
  <div class="col span-6">
@@ -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: [{