@rancher/shell 0.3.4 → 0.3.6

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 (289) hide show
  1. package/assets/images/providers/outscale.svg +19 -0
  2. package/assets/styles/app.scss +1 -1
  3. package/assets/styles/base/_basic.scss +18 -0
  4. package/assets/styles/base/_mixins.scss +0 -11
  5. package/assets/styles/base/_variables.scss +2 -4
  6. package/assets/styles/fonts/_fontstack.scss +11 -11
  7. package/assets/styles/global/_button.scss +12 -2
  8. package/assets/styles/vendor/vue-js-modal.scss +3 -3
  9. package/assets/translations/en-us.yaml +113 -22
  10. package/assets/translations/zh-hans.yaml +113 -24
  11. package/babel.config.js +13 -0
  12. package/chart/gatekeeper.vue +78 -0
  13. package/chart/istio.vue +135 -112
  14. package/chart/logging/index.vue +13 -4
  15. package/chart/monitoring/index.vue +15 -5
  16. package/chart/monitoring/steps/uninstall-v1.vue +2 -2
  17. package/chart/rancher-backup/index.vue +10 -3
  18. package/cloud-credential/aws.vue +1 -1
  19. package/cloud-credential/digitalocean.vue +1 -1
  20. package/cloud-credential/gcp.vue +1 -1
  21. package/cloud-credential/generic.vue +2 -2
  22. package/cloud-credential/linode.vue +1 -1
  23. package/cloud-credential/pnap.vue +1 -1
  24. package/components/ActionMenu.vue +3 -4
  25. package/components/AssignTo.vue +1 -1
  26. package/components/AsyncButton.vue +1 -1
  27. package/components/BannerGraphic.vue +1 -1
  28. package/components/BrandImage.vue +1 -4
  29. package/components/ButtonDropdown.vue +2 -3
  30. package/components/Carousel.vue +85 -37
  31. package/components/ChartPsp.vue +76 -0
  32. package/components/CruResource.vue +6 -2
  33. package/components/DashboardMetrics.vue +12 -10
  34. package/components/DetailText.vue +1 -1
  35. package/components/DisableAuthProviderModal.vue +1 -1
  36. package/components/EmberPage.vue +1 -1
  37. package/components/EtcdInfoBanner.vue +12 -7
  38. package/components/ExplorerMembers.vue +101 -6
  39. package/components/ExplorerProjectsNamespaces.vue +46 -3
  40. package/components/FileDiff.vue +6 -7
  41. package/components/GrafanaDashboard.vue +27 -23
  42. package/components/LazyImage.vue +10 -12
  43. package/components/LogItem.vue +1 -1
  44. package/components/Markdown.vue +1 -1
  45. package/components/PromptRemove.vue +2 -2
  46. package/components/PromptRestore.vue +1 -1
  47. package/components/ResourceDetail/Masthead.vue +16 -0
  48. package/components/ResourceDetail/index.vue +21 -4
  49. package/components/ResourceList/index.vue +1 -1
  50. package/components/ResourceTable.vue +4 -1
  51. package/components/SingleClusterInfo.vue +2 -2
  52. package/components/SortableTable/THead.vue +1 -1
  53. package/components/SortableTable/index.vue +28 -13
  54. package/components/SortableTable/selection.js +58 -50
  55. package/components/Wizard.vue +4 -2
  56. package/components/__tests__/AsyncButton.test.ts +3 -1
  57. package/components/__tests__/ChartPsp.test.ts +75 -0
  58. package/components/__tests__/CruResource.test.ts +3 -1
  59. package/components/auth/Principal.vue +1 -1
  60. package/components/auth/RoleDetailEdit.vue +2 -2
  61. package/components/fleet/FleetBundles.vue +3 -1
  62. package/components/fleet/FleetClusters.vue +1 -2
  63. package/components/fleet/FleetIntro.vue +9 -1
  64. package/components/fleet/FleetNoWorkspaces.vue +62 -0
  65. package/components/fleet/FleetSummary.vue +7 -1
  66. package/components/form/HookOption.vue +14 -10
  67. package/components/form/LabeledSelect.vue +14 -11
  68. package/components/form/Labels.vue +32 -27
  69. package/components/form/MatchExpressions.vue +19 -4
  70. package/components/form/Members/ClusterPermissionsEditor.vue +32 -7
  71. package/components/form/NameNsDescription.vue +32 -46
  72. package/components/form/ProjectMemberEditor.vue +46 -21
  73. package/components/form/ResourceSelector.vue +1 -1
  74. package/components/form/SecretSelector.vue +5 -1
  75. package/components/form/ServiceNameSelect.vue +1 -1
  76. package/components/form/SimpleSecretSelector.vue +9 -9
  77. package/components/form/Tolerations.vue +4 -1
  78. package/components/form/ValueFromResource.vue +14 -9
  79. package/components/form/WorkloadPorts.vue +2 -2
  80. package/components/form/__tests__/LabeledSelect.test.ts +138 -0
  81. package/components/form/__tests__/NameNsDescription.ts +59 -0
  82. package/components/formatter/InternalExternalIP.vue +6 -0
  83. package/components/formatter/InvolvedObjectLink.vue +54 -0
  84. package/components/formatter/Link.vue +20 -4
  85. package/components/formatter/LinkName.vue +6 -1
  86. package/components/formatter/ServiceTargets.vue +1 -1
  87. package/components/formatter/WorkloadHealthScale.vue +8 -2
  88. package/components/nav/Group.vue +2 -2
  89. package/components/nav/NamespaceFilter.vue +23 -11
  90. package/components/nav/TopLevelMenu.vue +2 -4
  91. package/components/nav/Type.vue +1 -1
  92. package/components/nav/WorkspaceSwitcher.vue +46 -5
  93. package/components/nuxt/nuxt-build-indicator.vue +143 -0
  94. package/components/nuxt/nuxt-child.js +122 -0
  95. package/components/nuxt/nuxt-error.vue +98 -0
  96. package/components/nuxt/nuxt-link.client.js +98 -0
  97. package/components/nuxt/nuxt-link.server.js +16 -0
  98. package/components/nuxt/nuxt-loading.vue +154 -0
  99. package/components/nuxt/nuxt.js +101 -0
  100. package/config/labels-annotations.js +17 -0
  101. package/config/middleware.js +12 -0
  102. package/config/product/auth.js +3 -2
  103. package/config/product/explorer.js +34 -6
  104. package/config/product/fleet.js +2 -0
  105. package/config/query-params.js +1 -0
  106. package/config/router.js +414 -0
  107. package/config/store.js +181 -0
  108. package/config/table-headers.js +54 -12
  109. package/config/types.js +18 -8
  110. package/config/uiplugins.js +30 -0
  111. package/content/docs/en-us/whats-new.md +10 -0
  112. package/content/docs/zh-hans/whats-new.md +11 -1
  113. package/core/plugin-routes.ts +23 -0
  114. package/core/plugin.ts +4 -2
  115. package/core/types.ts +258 -1
  116. package/creators/app/app.package.json +2 -1
  117. package/creators/app/files/.eslintrc.js +1 -1
  118. package/creators/app/files/babel.config.js +1 -18
  119. package/creators/app/files/tsconfig.json +0 -1
  120. package/creators/app/files/vue.config.js +6 -0
  121. package/creators/app/init +5 -5
  122. package/creators/pkg/files/.github/workflows/build-extension.yml +110 -0
  123. package/creators/pkg/files/tsconfig.json +0 -1
  124. package/creators/pkg/init +35 -4
  125. package/creators/pkg/pkg.package.json +3 -3
  126. package/creators/update/init +1 -1
  127. package/detail/constraints.gatekeeper.sh.constraint.vue +34 -17
  128. package/detail/fleet.cattle.io.clustergroup.vue +7 -1
  129. package/detail/fleet.cattle.io.gitrepo.vue +19 -11
  130. package/detail/harvesterhci.io.management.cluster.vue +3 -3
  131. package/detail/provisioning.cattle.io.cluster.vue +54 -12
  132. package/detail/workload/index.vue +3 -3
  133. package/dialog/AddClusterMemberDialog.vue +1 -1
  134. package/dialog/AddProjectMemberDialog.vue +2 -2
  135. package/dialog/AddonConfigConfirmationDialog.vue +27 -15
  136. package/dialog/DiagnosticTimingsDialog.vue +1 -1
  137. package/dialog/ForceMachineRemoveDialog.vue +1 -1
  138. package/dialog/GenericPrompt.vue +18 -6
  139. package/dialog/RotateEncryptionKeyDialog.vue +1 -1
  140. package/dialog/SaveAsRKETemplateDialog.vue +1 -1
  141. package/dialog/ScaleMachineDownDialog.vue +1 -1
  142. package/edit/auth/github.vue +8 -8
  143. package/edit/auth/googleoauth.vue +5 -5
  144. package/edit/auth/ldap/index.vue +1 -1
  145. package/edit/auth/oidc.vue +1 -1
  146. package/edit/auth/saml.vue +1 -1
  147. package/edit/cis.cattle.io.clusterscan.vue +1 -1
  148. package/edit/fleet.cattle.io.clustergroup.vue +6 -4
  149. package/edit/fleet.cattle.io.gitrepo.vue +32 -4
  150. package/edit/helm.cattle.io.projecthelmchart.vue +5 -1
  151. package/edit/logging.banzaicloud.io.output/index.vue +18 -5
  152. package/edit/logging.banzaicloud.io.output/providers/loki.vue +1 -0
  153. package/edit/management.cattle.io.fleetworkspace.vue +141 -6
  154. package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +4 -1
  155. package/edit/management.cattle.io.setting.vue +1 -1
  156. package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +2 -2
  157. package/edit/monitoring.coreos.com.receiver/tls.vue +18 -18
  158. package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +4 -4
  159. package/edit/monitoring.coreos.com.receiver/types/webhook.vue +1 -1
  160. package/edit/namespace.vue +14 -10
  161. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +126 -45
  162. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
  163. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +21 -4
  164. package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +1 -0
  165. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +202 -2
  166. package/edit/provisioning.cattle.io.cluster/import.vue +23 -25
  167. package/edit/provisioning.cattle.io.cluster/rke2.vue +344 -102
  168. package/edit/resources.cattle.io.backup.vue +1 -1
  169. package/edit/service.vue +1 -1
  170. package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +2 -2
  171. package/edit/workload/__tests__/Job.test.ts +3 -1
  172. package/edit/workload/index.vue +8 -3
  173. package/edit/workload/mixins/workload.js +22 -7
  174. package/edit/workload/storage/Mount.vue +3 -3
  175. package/initialize/App.js +206 -0
  176. package/initialize/client.js +863 -0
  177. package/initialize/index.js +364 -0
  178. package/layouts/default.vue +7 -3
  179. package/layouts/standalone.vue +13 -0
  180. package/list/catalog.cattle.io.clusterrepo.vue +1 -0
  181. package/list/fleet.cattle.io.bundle.vue +6 -3
  182. package/list/fleet.cattle.io.clusterregistrationtoken.vue +3 -1
  183. package/list/fleet.cattle.io.gitrepo.vue +44 -5
  184. package/list/management.cattle.io.fleetworkspace.vue +45 -0
  185. package/list/node.vue +69 -16
  186. package/list/provisioning.cattle.io.cluster.vue +30 -1
  187. package/list/rbac.authorization.k8s.io.clusterrolebinding.vue +48 -0
  188. package/list/workload.vue +6 -4
  189. package/machine-config/azure.vue +97 -38
  190. package/middleware/authenticated.js +34 -0
  191. package/mixins/chart.js +101 -2
  192. package/mixins/fetch.client.js +95 -0
  193. package/mixins/fetch.server.js +73 -0
  194. package/mixins/labeled-form-element.ts +2 -2
  195. package/mixins/resource-fetch.js +2 -2
  196. package/models/apps.statefulset.js +28 -0
  197. package/models/cluster/node.js +23 -2
  198. package/models/cluster.x-k8s.io.machine.js +4 -2
  199. package/models/clusterroletemplatebinding.js +7 -0
  200. package/models/constraints.gatekeeper.sh.constraint.js +46 -0
  201. package/models/fleet.cattle.io.cluster.js +19 -10
  202. package/models/fleet.cattle.io.gitrepo.js +7 -2
  203. package/models/management.cattle.io.cluster.js +1 -1
  204. package/models/management.cattle.io.fleetworkspace.js +12 -0
  205. package/models/management.cattle.io.gitreporestriction.js +5 -0
  206. package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.js +3 -0
  207. package/models/pod.js +4 -0
  208. package/models/provisioning.cattle.io.cluster.js +7 -5
  209. package/models/rbac.authorization.k8s.io.clusterrolebinding.js +16 -0
  210. package/models/rbac.authorization.k8s.io.rolebinding.js +16 -0
  211. package/package.json +13 -21
  212. package/pages/auth/setup.vue +2 -2
  213. package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +33 -0
  214. package/pages/c/_cluster/apps/charts/chart.vue +4 -4
  215. package/pages/c/_cluster/apps/charts/install.helpers.js +26 -0
  216. package/pages/c/_cluster/apps/charts/install.vue +98 -102
  217. package/pages/c/_cluster/explorer/EventsTable.vue +5 -19
  218. package/pages/c/_cluster/explorer/index.vue +29 -25
  219. package/pages/c/_cluster/explorer/tools/index.vue +8 -8
  220. package/pages/c/_cluster/fleet/index.vue +95 -34
  221. package/pages/c/_cluster/gatekeeper/index.vue +1 -1
  222. package/pages/c/_cluster/istio/index.vue +5 -5
  223. package/pages/c/_cluster/manager/cloudCredential/index.vue +1 -1
  224. package/pages/c/_cluster/monitoring/index.vue +7 -0
  225. package/pages/c/_cluster/uiplugins/InstallDialog.vue +8 -8
  226. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +20 -7
  227. package/pages/c/_cluster/uiplugins/index.vue +49 -17
  228. package/pages/diagnostic.vue +32 -25
  229. package/pages/home.vue +9 -4
  230. package/pages/index.vue +10 -1
  231. package/pages/rio/mesh.vue +1 -2
  232. package/pkg/tsconfig.json +0 -1
  233. package/plugins/clean-html-directive.js +34 -0
  234. package/plugins/dashboard-store/actions.js +32 -9
  235. package/plugins/dashboard-store/index.js +1 -1
  236. package/plugins/dashboard-store/mutations.js +5 -2
  237. package/plugins/dashboard-store/resource-class.js +8 -1
  238. package/plugins/plugin.js +0 -14
  239. package/plugins/portal-vue.js +4 -0
  240. package/plugins/steve/mutations.js +3 -2
  241. package/plugins/steve/steve-description-class.js +5 -1
  242. package/plugins/steve/subscribe.js +63 -54
  243. package/plugins/steve-create-worker.js +14 -0
  244. package/promptRemove/management.cattle.io.globalrole.vue +2 -2
  245. package/promptRemove/management.cattle.io.project.vue +2 -2
  246. package/promptRemove/management.cattle.io.roletemplate.vue +2 -2
  247. package/promptRemove/pod.vue +1 -1
  248. package/public/index.html +65 -0
  249. package/rancher-components/components/Banner/Banner.test.ts +7 -1
  250. package/rancher-components/components/Banner/Banner.vue +2 -1
  251. package/rancher-components/components/Form/Checkbox/Checkbox.vue +2 -0
  252. package/rancher-components/components/Form/Radio/RadioButton.test.ts +31 -0
  253. package/rancher-components/components/Form/Radio/RadioButton.vue +14 -3
  254. package/scripts/build-pkg.sh +1 -0
  255. package/scripts/clean +6 -0
  256. package/scripts/extension/bundle +58 -0
  257. package/scripts/extension/helmpatch +89 -0
  258. package/scripts/extension/publish +333 -0
  259. package/scripts/serve-pkgs +6 -2
  260. package/scripts/test-plugins-build.sh +4 -0
  261. package/store/__tests__/index.test.ts +110 -0
  262. package/store/index.js +145 -58
  263. package/store/type-map.js +6 -2
  264. package/tsconfig.default.json +36 -0
  265. package/tsconfig.json +23 -0
  266. package/types/rancher/index.d.ts +2 -0
  267. package/types/shell/index.d.ts +466 -320
  268. package/utils/__tests__/grafana.test.ts +44 -0
  269. package/utils/__tests__/string.test.ts +12 -0
  270. package/utils/auth.js +65 -0
  271. package/utils/axios.js +190 -0
  272. package/utils/cookie-universal-nuxt.js +10 -0
  273. package/utils/dom.js +15 -0
  274. package/utils/grafana.js +35 -16
  275. package/utils/monitoring.js +2 -1
  276. package/utils/nuxt.js +659 -0
  277. package/utils/position.js +5 -8
  278. package/utils/router.scrollBehavior.js +80 -0
  279. package/utils/select.js +1 -3
  280. package/utils/socket.js +1 -0
  281. package/utils/string.js +13 -0
  282. package/utils/time.js +9 -0
  283. package/vue.config.js +690 -0
  284. package/chart/rancher-alerting-drivers.vue +0 -53
  285. package/chart/rancher-gatekeeper.vue +0 -37
  286. package/creators/app/files/nuxt.config.js +0 -6
  287. package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.ts +0 -4
  288. package/nuxt.config.js +0 -798
  289. package/plugins/dashboard-store/extensions.js +0 -22
@@ -15,6 +15,7 @@ import {
15
15
  DEFAULT_WORKSPACE,
16
16
  SECRET,
17
17
  HCI,
18
+ PSPS,
18
19
  } from '@shell/config/types';
19
20
  import { _CREATE, _EDIT, _VIEW } from '@shell/config/query-params';
20
21
 
@@ -76,6 +77,26 @@ const ADVANCED = 'advanced';
76
77
  const HARVESTER = 'harvester';
77
78
  const HARVESTER_CLOUD_PROVIDER = 'harvester-cloud-provider';
78
79
 
80
+ const NETBIOS_TRUNCATION_LENGTH = 15;
81
+
82
+ /**
83
+ * Classes to be adopted by the node badges in Machine pools
84
+ */
85
+ const NODE_TOTAL = {
86
+ error: {
87
+ color: 'bg-error',
88
+ icon: 'icon-x',
89
+ },
90
+ warning: {
91
+ color: 'bg-warning',
92
+ icon: 'icon-warning',
93
+ },
94
+ success: {
95
+ color: 'bg-success',
96
+ icon: 'icon-checkmark'
97
+ }
98
+ };
99
+
79
100
  export default {
80
101
  components: {
81
102
  ACE,
@@ -129,6 +150,9 @@ export default {
129
150
  },
130
151
 
131
152
  async fetch() {
153
+ // Check presence of PSP in RKE2, which is where we show the templates
154
+ this.psps = await this.checkPsps();
155
+
132
156
  if ( !this.rke2Versions ) {
133
157
  const hash = {
134
158
  rke2Versions: this.$store.dispatch('management/request', { url: '/v1-rke2-release/releases' }),
@@ -282,6 +306,13 @@ export default {
282
306
  const lastDefaultPodSecurityPolicyTemplateName = this.value.spec.defaultPodSecurityPolicyTemplateName;
283
307
  const previousKubernetesVersion = this.value.spec.kubernetesVersion;
284
308
 
309
+ const truncateLimit = this.value.machinePoolDefaults?.hostnameLengthLimit;
310
+
311
+ // Is hostname truncation supported by the backend?
312
+ const provSchema = this.$store.getters['management/schemaFor'](CAPI.RANCHER_CLUSTER);
313
+ const specSchemaName = provSchema?.resourceFields?.spec?.type;
314
+ const specSchema = specSchemaName ? this.$store.getters['management/schemaFor'](specSchemaName) : {};
315
+
285
316
  return {
286
317
  loadedOnce: false,
287
318
  lastIdx: 0,
@@ -312,14 +343,20 @@ export default {
312
343
  path: 'metadata.name', rules: ['subDomain'], translationKey: 'nameNsDescription.name.label'
313
344
  }],
314
345
  harvesterVersionRange: {},
315
- lastDefaultPodSecurityPolicyTemplateName,
346
+ lastDefaultPodSecurityPolicyTemplateName, // Used for reset on k8s version changes
316
347
  previousKubernetesVersion,
317
- harvesterVersion: ''
348
+ cisOverride: false,
349
+ cisPsaChangeBanner: false,
350
+ psps: null, // List of policies if any
351
+ truncateHostnames: truncateLimit === NETBIOS_TRUNCATION_LENGTH,
352
+ truncateLimit,
353
+ supportsTruncation: !!specSchema?.resourceFields?.machinePoolDefaults,
318
354
  };
319
355
  },
320
356
 
321
357
  computed: {
322
358
  ...mapGetters({ allCharts: 'catalog/charts' }),
359
+ ...mapGetters(['currentCluster']),
323
360
  ...mapGetters({ features: 'features/get' }),
324
361
 
325
362
  PUBLIC: () => PUBLIC,
@@ -330,6 +367,17 @@ export default {
330
367
  return this.value.spec.rkeConfig;
331
368
  },
332
369
 
370
+ hostnameTruncationManuallySet() {
371
+ return this.truncateLimit && this.truncateLimit !== NETBIOS_TRUNCATION_LENGTH;
372
+ },
373
+
374
+ /**
375
+ * Check presence of PSPs as template or CLI creation
376
+ */
377
+ hasPsps() {
378
+ return !!this.psps?.count;
379
+ },
380
+
333
381
  isElementalCluster() {
334
382
  return this.provider === ELEMENTAL_CLUSTER_PROVIDER || this.value?.machineProvider?.toLowerCase() === KIND.MACHINE_INV_SELECTOR_TEMPLATES.toLowerCase();
335
383
  },
@@ -353,7 +401,7 @@ export default {
353
401
  },
354
402
 
355
403
  /**
356
- * Return need of PSA if RKE and min k8s version
404
+ * Define introduction of PSA and return need of PSA templates based on min k8s version
357
405
  */
358
406
  needsPSA() {
359
407
  const release = this.value?.spec?.kubernetesVersion || '';
@@ -364,22 +412,18 @@ export default {
364
412
  },
365
413
 
366
414
  /**
367
- * Restrict use of PSP based on min k8s version
415
+ * Define PSP deprecation and restrict use of PSP based on min k8s version
368
416
  */
369
417
  needsPSP() {
370
- const release = this.value?.spec?.kubernetesVersion || '';
371
- const version = release.match(/\d+/g);
372
- const isRequiredVersion = version?.length ? +version[0] === 1 && +version[1] < 25 : false;
373
-
374
- return isRequiredVersion;
418
+ return this.getNeedsPSP();
375
419
  },
376
420
 
377
- // kubeletConfigs() {
378
- // return this.value.spec.rkeConfig.machineSelectorConfig.filter(x => !!x.machineLabelSelector);
379
- // },
380
421
  /**
381
- * Check if k8s release version used is RKE2 ^1.25
422
+ * Define introduction of Rancher defined PSA templates
382
423
  */
424
+ hasPsaTemplates() {
425
+ return !this.needsPSP;
426
+ },
383
427
 
384
428
  unsupportedSelectorConfig() {
385
429
  let global = 0;
@@ -416,8 +460,8 @@ export default {
416
460
  const existingRke2 = this.mode === _EDIT && cur.includes('rke2');
417
461
  const existingK3s = this.mode === _EDIT && cur.includes('k3s');
418
462
 
419
- let allValidRke2Versions = this.getAllOptionsAfterMinVersion(this.rke2Versions, (existingRke2 ? cur : null), this.defaultRke2);
420
- let allValidK3sVersions = this.getAllOptionsAfterMinVersion(this.k3sVersions, (existingK3s ? cur : null), this.defaultK3s);
463
+ let allValidRke2Versions = this.getAllOptionsAfterCurrentVersion(this.rke2Versions, (existingRke2 ? cur : null), this.defaultRke2);
464
+ let allValidK3sVersions = this.getAllOptionsAfterCurrentVersion(this.k3sVersions, (existingK3s ? cur : null), this.defaultK3s);
421
465
 
422
466
  if (!this.showDeprecatedPatchVersions) {
423
467
  // Normally, we only want to show the most recent patch version
@@ -452,8 +496,6 @@ export default {
452
496
 
453
497
  if ( existing ) {
454
498
  existing.disabled = false;
455
- } else {
456
- out.unshift({ label: `${ cur } (current)`, value: cur });
457
499
  }
458
500
  }
459
501
 
@@ -465,7 +507,7 @@ export default {
465
507
  },
466
508
 
467
509
  profileOptions() {
468
- const out = (this.agentArgs.profile?.options || []).map((x) => {
510
+ const out = (this.agentArgs?.profile?.options || []).map((x) => {
469
511
  return { label: x, value: x };
470
512
  });
471
513
 
@@ -477,6 +519,15 @@ export default {
477
519
  return out;
478
520
  },
479
521
 
522
+ /**
523
+ * Allow to display override if PSA is needed and profile is set
524
+ */
525
+ hasCisOverride() {
526
+ return (this.serverConfig?.profile || this.agentConfig?.profile) && this.needsPSA &&
527
+ // Also check other cases on when to display the override
528
+ this.hasPsaTemplates && this.showCisProfile && this.isCisSupported;
529
+ },
530
+
480
531
  pspOptions() {
481
532
  if ( this.isK3s ) {
482
533
  return null;
@@ -505,6 +556,24 @@ export default {
505
556
  return out;
506
557
  },
507
558
 
559
+ /**
560
+ * Disable PSA if CIS hardening is enabled, except override
561
+ */
562
+ isPsaDisabled() {
563
+ const cisValue = this.agentConfig?.profile || this.serverConfig?.profile;
564
+
565
+ return !(!cisValue || this.cisOverride) && this.hasPsaTemplates && this.isCisSupported;
566
+ },
567
+
568
+ /**
569
+ * Get the default label for the PSA template option
570
+ */
571
+ defaultPsaOptionLabel() {
572
+ const optionCase = !this.needsPSP && !this.isK3s ? 'default' : 'none';
573
+
574
+ return this.$store.getters['i18n/t'](`cluster.rke2.defaultPodSecurityAdmissionConfigurationTemplateName.option.${ optionCase }`);
575
+ },
576
+
508
577
  /**
509
578
  * Convert PSA templates into options, sorting and flagging if any selected
510
579
  */
@@ -513,7 +582,7 @@ export default {
513
582
  return [];
514
583
  }
515
584
  const out = [{
516
- label: this.$store.getters['i18n/t']('cluster.rke2.defaultPodSecurityAdmissionConfigurationTemplateName.option'),
585
+ label: this.defaultPsaOptionLabel,
517
586
  value: ''
518
587
  }];
519
588
 
@@ -534,6 +603,15 @@ export default {
534
603
  return out;
535
604
  },
536
605
 
606
+ /**
607
+ * Check if current CIS profile is required and listed in the options
608
+ */
609
+ isCisSupported() {
610
+ const cisProfile = this.serverConfig.profile || this.agentConfig.profile;
611
+
612
+ return !cisProfile || this.profileOptions.map(option => option.value).includes(cisProfile);
613
+ },
614
+
537
615
  disableOptions() {
538
616
  return this.serverArgs.disable.options.map((value) => {
539
617
  return {
@@ -610,7 +688,7 @@ export default {
610
688
  },
611
689
 
612
690
  showCisProfile() {
613
- return (this.provider === 'custom' || this.isElementalCluster) && ( this.serverArgs.profile || this.agentArgs.profile );
691
+ return (this.provider === 'custom' || this.isElementalCluster) && ( this.serverArgs?.profile || this.agentArgs?.profile );
614
692
  },
615
693
 
616
694
  needCredential() {
@@ -659,11 +737,11 @@ export default {
659
737
 
660
738
  for ( const role of roles ) {
661
739
  counts[role] = 0;
662
- out.color[role] = 'bg-success';
663
- out.icon[role] = 'icon-checkmark';
740
+ out.color[role] = NODE_TOTAL.success.color;
741
+ out.icon[role] = NODE_TOTAL.success.icon;
664
742
  }
665
743
 
666
- for ( const row of this.machinePools ) {
744
+ for ( const row of this.machinePools || [] ) {
667
745
  if ( row.remove ) {
668
746
  continue;
669
747
  }
@@ -685,27 +763,27 @@ export default {
685
763
  }
686
764
 
687
765
  if ( counts.etcd === 0 ) {
688
- out.color.etcd = 'bg-error';
689
- out.icon.etcd = 'icon-x';
766
+ out.color.etcd = NODE_TOTAL.error.color;
767
+ out.icon.etcd = NODE_TOTAL.error.icon;
690
768
  } else if ( counts.etcd === 1 || counts.etcd % 2 === 0 || counts.etcd > 7 ) {
691
- out.color.etcd = 'bg-warning';
692
- out.icon.etcd = 'icon-warning';
769
+ out.color.etcd = NODE_TOTAL.warning.color;
770
+ out.icon.etcd = NODE_TOTAL.warning.icon;
693
771
  }
694
772
 
695
773
  if ( counts.controlPlane === 0 ) {
696
- out.color.controlPlane = 'bg-error';
697
- out.icon.controlPlane = 'icon-x';
774
+ out.color.controlPlane = NODE_TOTAL.error.color;
775
+ out.icon.controlPlane = NODE_TOTAL.error.icon;
698
776
  } else if ( counts.controlPlane === 1 ) {
699
- out.color.controlPlane = 'bg-warning';
700
- out.icon.controlPlane = 'icon-warning';
777
+ out.color.controlPlane = NODE_TOTAL.warning.color;
778
+ out.icon.controlPlane = NODE_TOTAL.warning.icon;
701
779
  }
702
780
 
703
781
  if ( counts.worker === 0 ) {
704
- out.color.worker = 'bg-error';
705
- out.icon.worker = 'icon-x';
782
+ out.color.worker = NODE_TOTAL.error.color;
783
+ out.icon.worker = NODE_TOTAL.error.icon;
706
784
  } else if ( counts.worker === 1 ) {
707
- out.color.worker = 'bg-warning';
708
- out.icon.worker = 'icon-warning';
785
+ out.color.worker = NODE_TOTAL.warning.color;
786
+ out.icon.worker = NODE_TOTAL.warning.icon;
709
787
  }
710
788
 
711
789
  return out;
@@ -816,7 +894,7 @@ export default {
816
894
  const first = all[0]?.value;
817
895
  const preferred = all.find(x => x.value === this.defaultRke2)?.value;
818
896
 
819
- const rke2 = this.getAllOptionsAfterMinVersion(this.rke2Versions, null);
897
+ const rke2 = this.getAllOptionsAfterCurrentVersion(this.rke2Versions, null);
820
898
  const showRke2 = rke2.length;
821
899
  let out;
822
900
 
@@ -903,7 +981,6 @@ export default {
903
981
  },
904
982
 
905
983
  isHarvesterIncompatible() {
906
- const CompareVersion = '<v1.2';
907
984
  let ccmRke2Version = (this.chartVersions['harvester-cloud-provider'] || {})['version'];
908
985
  let csiRke2Version = (this.chartVersions['harvester-csi-driver'] || {})['version'];
909
986
 
@@ -919,11 +996,7 @@ export default {
919
996
  }
920
997
 
921
998
  if (ccmVersion && csiVersion) {
922
- if (semver.satisfies(this.harvesterVersion, CompareVersion) || !(this.harvesterVersion || '').startsWith('v')) {
923
- // When harveste version is less than `CompareVersion`, compatibility is not determined,
924
- // At the same time, version numbers like this will not be checked: master-14bbee2c-head
925
- return false;
926
- } else if (semver.satisfies(ccmRke2Version, ccmVersion) &&
999
+ if (semver.satisfies(ccmRke2Version, ccmVersion) &&
927
1000
  semver.satisfies(csiRke2Version, csiVersion)) {
928
1001
  return false;
929
1002
  } else {
@@ -933,19 +1006,6 @@ export default {
933
1006
  return false;
934
1007
  }
935
1008
  },
936
-
937
- displayInvalidPspsBanner() {
938
- const version = VERSION.parse(this.value.spec.kubernetesVersion);
939
-
940
- const major = parseInt(version?.[0] || 0);
941
- const minor = parseInt(version?.[1] || 0);
942
-
943
- if (major === 1 && minor >= 25) {
944
- return this.allPSPs?.length > 0;
945
- }
946
-
947
- return false;
948
- }
949
1009
  },
950
1010
 
951
1011
  watch: {
@@ -1035,6 +1095,32 @@ export default {
1035
1095
  nlToBr,
1036
1096
  set,
1037
1097
 
1098
+ /**
1099
+ * set instanceNameLimit to 15 to all pool machine if truncateHostnames checkbox is clicked
1100
+ */
1101
+ truncateName() {
1102
+ if (this.truncateHostnames) {
1103
+ this.value.machinePoolDefaults = this.value.machinePoolDefaults || {};
1104
+ this.value.machinePoolDefaults.hostnameLengthLimit = 15;
1105
+ } else {
1106
+ delete this.value.machinePoolDefaults.hostnameLengthLimit;
1107
+
1108
+ if (Object.keys(this.value.machinePoolDefaults).length === 0) {
1109
+ delete this.value.machinePoolDefaults;
1110
+ }
1111
+ }
1112
+ },
1113
+ /**
1114
+ * Define PSP deprecation and restrict use of PSP based on min k8s version and current/edited mode
1115
+ */
1116
+ getNeedsPSP(value = this.value) {
1117
+ const release = value?.spec?.kubernetesVersion || '';
1118
+ const version = release.match(/\d+/g);
1119
+ const isRequiredVersion = version?.length ? +version[0] === 1 && +version[1] < 25 : false;
1120
+
1121
+ return isRequiredVersion;
1122
+ },
1123
+
1038
1124
  async initMachinePools(existing) {
1039
1125
  const out = [];
1040
1126
 
@@ -1182,7 +1268,6 @@ export default {
1182
1268
  }
1183
1269
 
1184
1270
  await this.syncMachineConfigWithLatest(entry);
1185
-
1186
1271
  // Capitals and such aren't allowed;
1187
1272
  set(entry.pool, 'name', normalizeName(entry.pool.name) || 'pool');
1188
1273
 
@@ -1232,8 +1317,17 @@ export default {
1232
1317
  }
1233
1318
  },
1234
1319
 
1320
+ /**
1321
+ * Ensure that all the existing node roles pool are at least 1 each
1322
+ */
1323
+ hasRequiredNodes() {
1324
+ return this.nodeTotals?.color && Object.values(this.nodeTotals.color).every(color => color !== NODE_TOTAL.error.color);
1325
+ },
1326
+
1235
1327
  validationPassed() {
1236
- return (this.provider === 'custom' || this.isElementalCluster || !!this.credentialId);
1328
+ const validMachinePools = this.hasMachinePools ? this.hasRequiredNodes() : true;
1329
+
1330
+ return (this.provider === 'custom' || this.isElementalCluster || !!this.credentialId) && validMachinePools;
1237
1331
  },
1238
1332
 
1239
1333
  cancelCredential() {
@@ -1264,7 +1358,27 @@ export default {
1264
1358
 
1265
1359
  showAddonConfirmation() {
1266
1360
  return new Promise((resolve, reject) => {
1267
- this.$store.dispatch('cluster/promptModal', { component: 'AddonConfigConfirmationDialog', resources: [value => resolve(value)] });
1361
+ this.$store.dispatch('cluster/promptModal', {
1362
+ component: 'AddonConfigConfirmationDialog',
1363
+ resources: [value => resolve(value)]
1364
+ });
1365
+ });
1366
+ },
1367
+
1368
+ /**
1369
+ * Inform user to remove PSP for current cluster due deprecation
1370
+ */
1371
+ showPspConfirmation() {
1372
+ return new Promise((resolve, reject) => {
1373
+ this.$store.dispatch('cluster/promptModal', {
1374
+ component: 'GenericPrompt',
1375
+ componentProps: {
1376
+ title: this.t('cluster.rke2.modal.pspChange.title'),
1377
+ body: this.t('cluster.rke2.modal.pspChange.body'),
1378
+ applyMode: 'continue',
1379
+ confirm: resolve
1380
+ },
1381
+ });
1268
1382
  });
1269
1383
  },
1270
1384
 
@@ -1273,7 +1387,16 @@ export default {
1273
1387
  clear(this.errors);
1274
1388
  }
1275
1389
 
1276
- if (this.isEdit && this.liveValue?.spec?.kubernetesVersion !== this.value?.spec?.kubernetesVersion) {
1390
+ const isEditVersion = this.isEdit && this.liveValue?.spec?.kubernetesVersion !== this.value?.spec?.kubernetesVersion;
1391
+ const hasPspManuallyAdded = !!this.value.spec.rkeConfig?.machineGlobalConfig?.['kube-apiserver-arg'];
1392
+
1393
+ if (isEditVersion && !this.needsPSP && hasPspManuallyAdded) {
1394
+ if (!await this.showPspConfirmation()) {
1395
+ return btnCb('cancelled');
1396
+ }
1397
+ }
1398
+
1399
+ if (isEditVersion) {
1277
1400
  const shouldContinue = await this.showAddonConfirmation();
1278
1401
 
1279
1402
  if (!shouldContinue) {
@@ -1350,6 +1473,11 @@ export default {
1350
1473
  return;
1351
1474
  }
1352
1475
 
1476
+ // Remove null profile on machineGlobalConfig - https://github.com/rancher/dashboard/issues/8480
1477
+ if (this.value.spec?.rkeConfig?.machineGlobalConfig?.profile === null) {
1478
+ delete this.value.spec.rkeConfig.machineGlobalConfig.profile;
1479
+ }
1480
+
1353
1481
  await this.save(btnCb);
1354
1482
  },
1355
1483
  // create a secret to reference the harvester cluster kubeconfig in rkeConfig
@@ -1496,7 +1624,7 @@ export default {
1496
1624
  }
1497
1625
  }
1498
1626
 
1499
- if ( !this.serverConfig.profile ) {
1627
+ if ( !this.serverConfig?.profile ) {
1500
1628
  set(this.serverConfig, 'profile', null);
1501
1629
  }
1502
1630
  },
@@ -1625,21 +1753,32 @@ export default {
1625
1753
  set(this.value.spec.rkeConfig.registries, 'configs', configs);
1626
1754
  },
1627
1755
 
1628
- getAllOptionsAfterMinVersion(versions, minVersion, defaultVersion) {
1756
+ getAllOptionsAfterCurrentVersion(versions, currentVersion, defaultVersion) {
1629
1757
  const out = (versions || []).filter(obj => !!obj.serverArgs).map((obj) => {
1630
1758
  let disabled = false;
1631
1759
  let experimental = false;
1760
+ let isCurrentVersion = false;
1761
+ let label = obj.id;
1632
1762
 
1633
- if ( minVersion ) {
1634
- disabled = compare(obj.id, minVersion) < 0;
1763
+ if ( currentVersion ) {
1764
+ disabled = compare(obj.id, currentVersion) < 0;
1765
+ isCurrentVersion = compare(obj.id, currentVersion) === 0;
1635
1766
  }
1636
1767
 
1637
1768
  if ( defaultVersion ) {
1638
1769
  experimental = compare(defaultVersion, obj.id) < 0;
1639
1770
  }
1640
1771
 
1772
+ if (isCurrentVersion) {
1773
+ label = `${ label } ${ this.t('cluster.kubernetesVersion.current') }`;
1774
+ }
1775
+
1776
+ if (experimental) {
1777
+ label = `${ label } ${ this.t('cluster.kubernetesVersion.experimental') }`;
1778
+ }
1779
+
1641
1780
  return {
1642
- label: obj.id + (experimental ? ` (${ this.t('cluster.kubernetesVersion.experimental') })` : ''),
1781
+ label,
1643
1782
  value: obj.id,
1644
1783
  sort: sortable(obj.id),
1645
1784
  serverArgs: obj.serverArgs,
@@ -1648,6 +1787,15 @@ export default {
1648
1787
  disabled,
1649
1788
  };
1650
1789
  });
1790
+
1791
+ if (currentVersion && !out.find(obj => obj.value === currentVersion)) {
1792
+ out.push({
1793
+ label: `${ currentVersion } ${ this.t('cluster.kubernetesVersion.current') }`,
1794
+ value: currentVersion,
1795
+ sort: sortable(currentVersion),
1796
+ });
1797
+ }
1798
+
1651
1799
  const sorted = sortBy(out, 'sort:desc');
1652
1800
 
1653
1801
  const mostRecentPatchVersions = this.getMostRecentPatchVersions(sorted);
@@ -1661,7 +1809,7 @@ export default {
1661
1809
 
1662
1810
  return {
1663
1811
  ...optionData,
1664
- label: `${ optionData.label } (${ this.t('cluster.kubernetesVersion.deprecated') })`
1812
+ label: `${ optionData.label } ${ this.t('cluster.kubernetesVersion.deprecated') }`
1665
1813
  };
1666
1814
  });
1667
1815
 
@@ -1699,7 +1847,7 @@ export default {
1699
1847
  const majorMinor = `${ semver.major(version.value) }.${ semver.minor(version.value) }`;
1700
1848
 
1701
1849
  // Always show current version, else show if we haven't shown anything for this major.minor version yet
1702
- if (version === currentVersion || mostRecentPatchVersions[majorMinor] === version.value) {
1850
+ if (version.value === currentVersion || mostRecentPatchVersions[majorMinor] === version.value) {
1703
1851
  return true;
1704
1852
  }
1705
1853
 
@@ -1757,10 +1905,7 @@ export default {
1757
1905
  const res = await this.$store.dispatch('cluster/request', { url: `${ url }/${ HCI.SETTING }s` });
1758
1906
 
1759
1907
  const version = (res?.data || []).find(s => s.id === 'harvester-csi-ccm-versions');
1760
- // get harvester server-version
1761
- const serverVersion = (res?.data || []).find(s => s.id === 'server-version');
1762
1908
 
1763
- this.harvesterVersion = serverVersion.value;
1764
1909
  if (version) {
1765
1910
  this.harvesterVersionRange = JSON.parse(version.value || version.default || '{}');
1766
1911
  } else {
@@ -1777,6 +1922,52 @@ export default {
1777
1922
  this.initRegistry();
1778
1923
  }
1779
1924
  },
1925
+
1926
+ /**
1927
+ * Check if current cluster has PSP enabled
1928
+ * Consider exclusively RKE2 provisioned clusters in edit mode
1929
+ */
1930
+ async checkPsps() {
1931
+ // As server returns 500 we exclude all the possible cases
1932
+ if (
1933
+ this.mode !== _CREATE &&
1934
+ !this.isK3s &&
1935
+ this.value.state !== 'reconciling' &&
1936
+ this.getNeedsPSP(this.liveValue) // We consider editing only possible PSP cases
1937
+ ) {
1938
+ const clusterId = this.value.mgmtClusterId;
1939
+ const url = `/k8s/clusters/${ clusterId }/v1/${ PSPS }`;
1940
+
1941
+ try {
1942
+ return await this.$store.dispatch('cluster/request', { url });
1943
+ } catch (error) {
1944
+ // PSP may not exists for this cluster and an error is returned without need to handle
1945
+ }
1946
+ }
1947
+ },
1948
+
1949
+ /**
1950
+ * Reset PSA on several input changes for given conditions
1951
+ */
1952
+ togglePsaDefault() {
1953
+ // This option is created from the server and is guaranteed to exist #8032
1954
+ const hardcodedTemplate = 'rancher-restricted';
1955
+ const cisValue = this.agentConfig?.profile || this.serverConfig?.profile;
1956
+
1957
+ if (!this.cisOverride) {
1958
+ if (this.hasPsaTemplates && cisValue) {
1959
+ set(this.value.spec, 'defaultPodSecurityAdmissionConfigurationTemplateName', hardcodedTemplate);
1960
+ }
1961
+
1962
+ this.cisPsaChangeBanner = this.hasPsaTemplates;
1963
+ }
1964
+ },
1965
+
1966
+ handleCisChange() {
1967
+ this.togglePsaDefault();
1968
+ this.updateCisProfile();
1969
+ },
1970
+
1780
1971
  updateCisProfile() {
1781
1972
  // If the user selects any Worker CIS Profile,
1782
1973
  // protect-kernel-defaults should be set to false
@@ -1795,6 +1986,7 @@ export default {
1795
1986
  */
1796
1987
  handleKubernetesChange(value) {
1797
1988
  if (value) {
1989
+ this.togglePsaDefault();
1798
1990
  const version = VERSION.parse(value);
1799
1991
  const major = parseInt(version?.[0] || 0);
1800
1992
  const minor = parseInt(version?.[1] || 0);
@@ -1856,7 +2048,7 @@ export default {
1856
2048
  v-if="isEdit"
1857
2049
  color="warning"
1858
2050
  >
1859
- <span v-html="t('cluster.banner.rke2-k3-reprovisioning', {}, true)" />
2051
+ <span v-clean-html="t('cluster.banner.rke2-k3-reprovisioning', {}, true)" />
1860
2052
  </Banner>
1861
2053
  </div>
1862
2054
  <SelectCredential
@@ -1989,7 +2181,7 @@ export default {
1989
2181
  color="warning"
1990
2182
  >
1991
2183
  <span
1992
- v-html="t('cluster.harvester.warning.cloudProvider.incompatible', null, true)"
2184
+ v-clean-html="t('cluster.harvester.warning.cloudProvider.incompatible', null, true)"
1993
2185
  />
1994
2186
  </Banner>
1995
2187
  <div class="row mb-10">
@@ -2075,40 +2267,29 @@ export default {
2075
2267
  {{ t('cluster.rke2.security.header') }}
2076
2268
  </h3>
2077
2269
  <Banner
2078
- v-if="isEdit && displayInvalidPspsBanner"
2270
+ v-if="isEdit && !needsPSP && hasPsps"
2079
2271
  color="warning"
2080
- >
2081
- <span v-html="t('cluster.banner.invalidPsps', {}, true)" />
2082
- </Banner>
2272
+ :label="t('cluster.banner.invalidPsps')"
2273
+ />
2083
2274
  <Banner
2084
2275
  v-else-if="isCreate && !needsPSP"
2085
2276
  color="info"
2086
- >
2087
- <span v-html="t('cluster.banner.removedPsp', {}, true)" />
2088
- </Banner>
2277
+ :label="t('cluster.banner.removedPsp')"
2278
+ />
2279
+ <Banner
2280
+ v-else-if="isCreate && hasPsps"
2281
+ color="info"
2282
+ :label="t('cluster.banner.deprecatedPsp')"
2283
+ />
2284
+
2089
2285
  <Banner
2090
- v-else-if="isCreate"
2286
+ v-if="showCisProfile && !isCisSupported && isEdit"
2091
2287
  color="info"
2092
2288
  >
2093
- <span v-html="t('cluster.banner.deprecatedPsp', {}, true)" />
2289
+ <p v-clean-html="t('cluster.rke2.banner.cisUnsupported', {cisProfile: serverConfig.profile || agentConfig.profile}, true)" />
2094
2290
  </Banner>
2095
- <div
2096
- v-if="needsPSA"
2097
- class="row mb-10"
2098
- >
2099
- <div class="col span-6">
2100
- <!-- PSA template selector -->
2101
- <LabeledSelect
2102
- v-model="value.spec.defaultPodSecurityAdmissionConfigurationTemplateName"
2103
- :mode="mode"
2104
- data-testid="rke2-custom-edit-psa"
2105
- :options="psaOptions"
2106
- :label="t('cluster.rke2.defaultPodSecurityAdmissionConfigurationTemplateName.label')"
2107
- />
2108
- </div>
2109
- </div>
2110
2291
 
2111
- <div class="row">
2292
+ <div class="row mb-10">
2112
2293
  <div
2113
2294
  v-if="pspOptions && needsPSP"
2114
2295
  class="col span-6"
@@ -2129,22 +2310,62 @@ export default {
2129
2310
  class="col span-6"
2130
2311
  >
2131
2312
  <LabeledSelect
2132
- v-if="serverArgs.profile"
2313
+ v-if="serverArgs && serverArgs.profile"
2133
2314
  v-model="serverConfig.profile"
2134
2315
  :mode="mode"
2135
2316
  :options="profileOptions"
2136
- label="Server CIS Profile"
2317
+ :label="t('cluster.rke2.cis.sever')"
2318
+ @input="handleCisChange"
2137
2319
  />
2138
2320
  <LabeledSelect
2139
- v-else-if="agentArgs.profile"
2321
+ v-else-if="agentArgs && agentArgs.profile"
2140
2322
  v-model="agentConfig.profile"
2323
+ data-testid="rke2-custom-edit-cis-agent"
2141
2324
  :mode="mode"
2142
2325
  :options="profileOptions"
2143
- :label="t('cis.workerProfile')"
2144
- @input="updateCisProfile"
2326
+ :label="t('cluster.rke2.cis.agent')"
2327
+ @input="handleCisChange"
2328
+ />
2329
+ </div>
2330
+ </div>
2331
+
2332
+ <template v-if="hasCisOverride">
2333
+ <Checkbox
2334
+ v-model="cisOverride"
2335
+ :mode="mode"
2336
+ :label="t('cluster.rke2.cis.override')"
2337
+ @input="togglePsaDefault"
2338
+ />
2339
+
2340
+ <Banner
2341
+ v-if="cisOverride"
2342
+ color="warning"
2343
+ :label="t('cluster.rke2.banner.cisOverride')"
2344
+ />
2345
+ <Banner
2346
+ v-if="cisPsaChangeBanner && !cisOverride"
2347
+ color="info"
2348
+ :label="t('cluster.rke2.banner.psaChange')"
2349
+ />
2350
+ </template>
2351
+
2352
+ <div
2353
+ v-if="needsPSA"
2354
+ class="row mb-10 mt-10"
2355
+ >
2356
+ <div class="col span-6">
2357
+ <!-- PSA template selector -->
2358
+ <LabeledSelect
2359
+ v-model="value.spec.defaultPodSecurityAdmissionConfigurationTemplateName"
2360
+ :mode="mode"
2361
+ data-testid="rke2-custom-edit-psa"
2362
+ :options="psaOptions"
2363
+ :disabled="isPsaDisabled"
2364
+ :label="t('cluster.rke2.defaultPodSecurityAdmissionConfigurationTemplateName.label')"
2145
2365
  />
2146
2366
  </div>
2147
2367
  </div>
2368
+
2148
2369
  <div class="row">
2149
2370
  <div class="col span-12 mt-20">
2150
2371
  <Checkbox
@@ -2376,8 +2597,29 @@ export default {
2376
2597
  :label="t('cluster.rke2.address.nodePortRange.label')"
2377
2598
  />
2378
2599
  </div>
2600
+ <div
2601
+ v-if="supportsTruncation"
2602
+ class="col span-6"
2603
+ >
2604
+ <Checkbox
2605
+ v-if="!isView || isView && !hostnameTruncationManuallySet"
2606
+ v-model="truncateHostnames"
2607
+ class="mt-20"
2608
+ :disabled="isEdit || isView || hostnameTruncationManuallySet"
2609
+ :mode="mode"
2610
+ :label="t('cluster.rke2.truncateHostnames')"
2611
+ @input="truncateName"
2612
+ />
2613
+ <Banner
2614
+ v-if="hostnameTruncationManuallySet"
2615
+ color="info"
2616
+ >
2617
+ <div class="text">
2618
+ {{ t('cluster.machinePool.truncationCluster', { limit: truncateLimit }) }}
2619
+ </div>
2620
+ </Banner>
2621
+ </div>
2379
2622
  </div>
2380
-
2381
2623
  <div
2382
2624
  v-if="serverArgs['tls-san']"
2383
2625
  class="row mb-20"