@rancher/shell 3.0.0-rc.8 → 3.0.0

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 (84) hide show
  1. package/assets/translations/en-us.yaml +12 -11
  2. package/assets/translations/zh-hans.yaml +1 -4
  3. package/components/EmberPage.vue +0 -8
  4. package/components/ResourceTable.vue +26 -1
  5. package/components/SortableTable/actions.js +1 -1
  6. package/components/SortableTable/index.vue +17 -1
  7. package/components/SortableTable/selection.js +1 -1
  8. package/components/SortableTable/sorting.js +11 -3
  9. package/components/fleet/FleetClusters.vue +0 -3
  10. package/components/form/ColorInput.vue +13 -2
  11. package/components/form/HookOption.vue +31 -29
  12. package/components/form/LabeledSelect.vue +0 -1
  13. package/components/form/LifecycleHooks.vue +2 -2
  14. package/components/form/__tests__/ColorInput.test.ts +27 -0
  15. package/components/formatter/SecretData.vue +1 -1
  16. package/components/nav/Header.vue +10 -13
  17. package/components/nav/TopLevelMenu.vue +0 -40
  18. package/components/nav/WorkspaceSwitcher.vue +0 -1
  19. package/config/private-label.js +2 -1
  20. package/config/router/routes.js +2 -26
  21. package/config/settings.ts +5 -0
  22. package/config/version.js +2 -0
  23. package/detail/catalog.cattle.io.app.vue +17 -4
  24. package/detail/fleet.cattle.io.cluster.vue +11 -9
  25. package/detail/fleet.cattle.io.gitrepo.vue +1 -1
  26. package/edit/cis.cattle.io.clusterscan.vue +4 -3
  27. package/edit/cis.cattle.io.clusterscanbenchmark.vue +2 -0
  28. package/edit/constraints.gatekeeper.sh.constraint/index.vue +2 -0
  29. package/edit/fleet.cattle.io.cluster.vue +4 -0
  30. package/edit/fleet.cattle.io.gitrepo.vue +11 -8
  31. package/edit/helm.cattle.io.projecthelmchart.vue +2 -0
  32. package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +2 -0
  33. package/edit/kontainerDriver.vue +2 -0
  34. package/edit/logging-flow/index.vue +2 -0
  35. package/edit/management.cattle.io.project.vue +2 -1
  36. package/edit/management.cattle.io.projectroletemplatebinding.vue +2 -1
  37. package/edit/management.cattle.io.user.vue +3 -0
  38. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +2 -0
  39. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +2 -0
  40. package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +5 -5
  41. package/edit/monitoring.coreos.com.prometheusrule/index.vue +3 -1
  42. package/edit/monitoring.coreos.com.receiver/index.vue +2 -0
  43. package/edit/monitoring.coreos.com.route.vue +2 -0
  44. package/edit/networking.istio.io.destinationrule/index.vue +2 -0
  45. package/edit/nodeDriver.vue +2 -0
  46. package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +26 -0
  47. package/edit/provisioning.cattle.io.cluster/__tests__/DirectoryConfig.test.ts +63 -149
  48. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +4 -1
  49. package/edit/provisioning.cattle.io.cluster/import.vue +2 -0
  50. package/edit/provisioning.cattle.io.cluster/rke2.vue +5 -3
  51. package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +7 -2
  52. package/edit/provisioning.cattle.io.cluster/tabs/DirectoryConfig.vue +108 -35
  53. package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +1 -1
  54. package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +1 -1
  55. package/edit/ui.cattle.io.navlink.vue +4 -3
  56. package/edit/workload/mixins/workload.js +1 -1
  57. package/mixins/browser-tab-visibility.js +1 -1
  58. package/mixins/chart.js +6 -2
  59. package/mixins/metric-poller.js +1 -1
  60. package/mixins/resource-fetch.js +1 -1
  61. package/models/catalog.cattle.io.app.js +108 -21
  62. package/models/cloudcredential.js +4 -4
  63. package/models/fleet.cattle.io.gitrepo.js +8 -13
  64. package/models/management.cattle.io.cluster.js +13 -2
  65. package/models/management.cattle.io.project.js +4 -0
  66. package/models/provisioning.cattle.io.cluster.js +1 -2
  67. package/models/workload.js +1 -1
  68. package/package.json +11 -4
  69. package/pages/auth/logout.vue +7 -9
  70. package/pages/auth/setup.vue +3 -0
  71. package/pages/c/_cluster/apps/charts/install.vue +11 -3
  72. package/pages/c/_cluster/explorer/__tests__/index.test.ts +7 -4
  73. package/pages/c/_cluster/explorer/index.vue +45 -24
  74. package/pages/c/_cluster/fleet/index.vue +11 -5
  75. package/pages/c/_cluster/uiplugins/index.vue +4 -2
  76. package/pages/diagnostic.vue +1 -0
  77. package/plugins/steve/mutations.js +4 -1
  78. package/plugins/steve/subscribe.js +3 -4
  79. package/types/shell/index.d.ts +13 -0
  80. package/utils/__tests__/object.test.ts +152 -1
  81. package/utils/object.js +37 -0
  82. package/utils/string.js +9 -0
  83. package/utils/validators/formRules/index.ts +1 -1
  84. package/config/product/multi-cluster-apps.js +0 -61
@@ -2,7 +2,6 @@ import { NAME as APPS } from '@shell/config/product/apps';
2
2
  import { NAME as EXPLORER } from '@shell/config/product/explorer';
3
3
  import { NAME as MANAGER } from '@shell/config/product/manager';
4
4
  import { CAPI, MANAGEMENT, BACKUP_RESTORE, CIS } from '@shell/config/types';
5
- import { NAME as MCAPPS, NAME as LEGACY } from '@shell/config/product/multi-cluster-apps';
6
5
  import { NAME as AUTH } from '@shell/config/product/auth';
7
6
 
8
7
  // All these imports are related to the install-redirect.js navigation guard.
@@ -229,12 +228,10 @@ export default [
229
228
  path: '/c/:cluster/legacy',
230
229
  redirect(to) {
231
230
  return {
232
- name: 'c-cluster-legacy-pages-page',
231
+ name: 'c-cluster-legacy-project',
233
232
  params: {
234
233
  ...(to?.params || {}),
235
- cluster: 'local',
236
- product: LEGACY,
237
- page: 'alerts'
234
+ product: EXPLORER,
238
235
  }
239
236
  };
240
237
  },
@@ -262,19 +259,6 @@ export default [
262
259
  };
263
260
  },
264
261
  name: 'c-cluster-manager'
265
- }, {
266
- path: '/c/:cluster/mcapps',
267
- redirect(to) {
268
- return {
269
- name: 'c-cluster-mcapps-pages-page',
270
- params: {
271
- ...(to?.params || {}),
272
- product: MCAPPS,
273
- page: 'catalogs'
274
- }
275
- };
276
- },
277
- name: 'c-cluster-mcapps'
278
262
  }, {
279
263
  path: '/c/:cluster/monitoring',
280
264
  component: () => interopDefault(import('@shell/pages/c/_cluster/monitoring/index.vue')),
@@ -381,10 +365,6 @@ export default [
381
365
  path: '/c/:cluster/auth/user.retention',
382
366
  component: () => interopDefault(import('@shell/pages/c/_cluster/auth/user.retention/index.vue')),
383
367
  name: 'c-cluster-auth-user.retention'
384
- }, {
385
- path: '/c/:cluster/legacy/project/pipelines',
386
- component: () => interopDefault(import('@shell/pages/c/_cluster/legacy/project/pipelines.vue')),
387
- name: 'c-cluster-legacy-project-pipelines'
388
368
  }, {
389
369
  path: '/c/:cluster/manager/cloudCredential/create',
390
370
  component: () => interopDefault(import('@shell/pages/c/_cluster/manager/cloudCredential/create.vue')),
@@ -437,10 +417,6 @@ export default [
437
417
  path: '/c/:cluster/manager/pages/:page?',
438
418
  component: () => interopDefault(import('@shell/pages/c/_cluster/manager/pages/_page.vue')),
439
419
  name: 'c-cluster-manager-pages-page'
440
- }, {
441
- path: '/c/:cluster/mcapps/pages/:page?',
442
- component: () => interopDefault(import('@shell/pages/c/_cluster/mcapps/pages/_page.vue')),
443
- name: 'c-cluster-mcapps-pages-page'
444
420
  }, {
445
421
  path: '/c/:cluster/monitoring/alertmanagerconfig/:alertmanagerconfigid',
446
422
  component: () => interopDefault(import('@shell/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/index.vue')),
@@ -108,6 +108,7 @@ export const SETTING = {
108
108
  USER_LAST_LOGIN_DEFAULT: 'user-last-login-default',
109
109
  DISABLE_INACTIVE_USER_AFTER: 'disable-inactive-user-after',
110
110
  DELETE_INACTIVE_USER_AFTER: 'delete-inactive-user-after',
111
+ K3S_UPGRADER_UNINSTALL_CONCURRENCY: 'k3s-based-upgrader-uninstall-concurrency'
111
112
  } as const;
112
113
 
113
114
  // These are the settings that are allowed to be edited via the UI
@@ -165,6 +166,10 @@ export const ALLOWED_SETTINGS: GlobalSetting = {
165
166
  options: ['strict', 'system-store'],
166
167
  warning: 'agent-tls-mode'
167
168
  },
169
+ [SETTING.K3S_UPGRADER_UNINSTALL_CONCURRENCY]: {
170
+ kind: 'integer',
171
+ ruleSet: [{ name: 'minValue', factoryArg: 1 }]
172
+ }
168
173
  };
169
174
 
170
175
  /**
package/config/version.js CHANGED
@@ -25,3 +25,5 @@ export function setKubeVersionData(v) {
25
25
  // Remove any properties on 'v' we don't want
26
26
  _kubeVersionData = JSON.parse(JSON.stringify(v));
27
27
  }
28
+
29
+ export const CURRENT_RANCHER_VERSION = '2.10';
@@ -9,7 +9,8 @@ import RelatedResources from '@shell/components/RelatedResources';
9
9
  import jsyaml from 'js-yaml';
10
10
  import merge from 'lodash/merge';
11
11
  import { CATALOG } from '@shell/config/types';
12
- import { sortBy } from '~shell/utils/sort';
12
+ import { sortBy } from '@shell/utils/sort';
13
+ import { allHash } from '@shell/utils/promise';
13
14
 
14
15
  export default {
15
16
  name: 'DetailRelease',
@@ -30,9 +31,15 @@ export default {
30
31
  },
31
32
 
32
33
  async fetch() {
33
- await this.$store.dispatch('catalog/load');
34
+ const promises = {
35
+ catalog: this.$store.dispatch('catalog/load'),
36
+ allOperations: this.$store.dispatch('cluster/findAll', { type: CATALOG.OPERATION }),
37
+ secrets: this.value.fetchValues(true),
38
+ };
34
39
 
35
- this.allOperations = await this.$store.dispatch('cluster/findAll', { type: CATALOG.OPERATION });
40
+ const res = await allHash(promises);
41
+
42
+ this.allOperations = res.allOperations;
36
43
  },
37
44
 
38
45
  computed: {
@@ -45,7 +52,7 @@ export default {
45
52
  },
46
53
 
47
54
  valuesYaml() {
48
- const combined = merge(merge({}, this.value?.spec?.chart?.values || {}), this.value?.spec?.values || {});
55
+ const combined = merge(merge({}, this.value?.chartValues || {}), this.value?.values || {});
49
56
 
50
57
  return jsyaml.dump(combined);
51
58
  },
@@ -95,6 +102,12 @@ export default {
95
102
  }
96
103
  },
97
104
  },
105
+
106
+ watch: {
107
+ 'value.secretId'(neu, old) {
108
+ this.value.fetchValues(true);
109
+ }
110
+ },
98
111
  };
99
112
  </script>
100
113
 
@@ -6,6 +6,7 @@ import ResourceTabs from '@shell/components/form/ResourceTabs';
6
6
  import Tab from '@shell/components/Tabbed/Tab';
7
7
  import { MANAGEMENT, FLEET } from '@shell/config/types';
8
8
  import { FLEET as FLEET_LABELS } from '@shell/config/labels-annotations';
9
+ import { allHash } from 'utils/promise';
9
10
 
10
11
  export default {
11
12
  name: 'FleetDetailCluster',
@@ -29,17 +30,18 @@ export default {
29
30
 
30
31
  async fetch() {
31
32
  const clusterId = this.value?.metadata?.labels[FLEET_LABELS.CLUSTER_NAME];
32
-
33
- this.rancherCluster = await this.$store.dispatch('management/find', {
34
- type: MANAGEMENT.CLUSTER,
35
- id: clusterId
33
+ const hash = await allHash({
34
+ rancherCluster: this.$store.dispatch('management/find', {
35
+ type: MANAGEMENT.CLUSTER,
36
+ id: clusterId
37
+ }),
38
+ repos: this.$store.dispatch('management/findAll', { type: FLEET.GIT_REPO }),
39
+ workspaces: this.$store.dispatch('management/findAll', { type: FLEET.WORKSPACE }),
40
+ bundleDeployments: this.$store.dispatch('management/findAll', { type: FLEET.BUNDLE_DEPLOYMENT })
36
41
  });
37
42
 
38
- this.allRepos = await this.$store.dispatch('management/findAll', { type: FLEET.GIT_REPO });
39
-
40
- await this.$store.dispatch('management/findAll', { type: FLEET.WORKSPACE });
41
-
42
- await this.$store.dispatch('management/findAll', { type: FLEET.BUNDLE_DEPLOYMENT });
43
+ this.rancherCluster = hash.rancherCluster;
44
+ this.allRepos = hash.repos;
43
45
  },
44
46
 
45
47
  data() {
@@ -42,7 +42,7 @@ export default {
42
42
  },
43
43
  computed: {
44
44
  gitRepoHasClusters() {
45
- return this.value?.clusterResourceStatus?.length;
45
+ return this.value.status.desiredReadyClusters;
46
46
  },
47
47
  clusterSchema() {
48
48
  return this.$store.getters['management/schemaFor'](FLEET.CLUSTER);
@@ -12,7 +12,7 @@ import { allHash } from '@shell/utils/promise';
12
12
  import { Checkbox } from '@components/Form/Checkbox';
13
13
  import { RadioGroup } from '@components/Form/Radio';
14
14
  import { get } from '@shell/utils/object';
15
- import { _VIEW, _CREATE, _EDIT } from '@shell/config/query-params';
15
+ import { _VIEW, _CREATE } from '@shell/config/query-params';
16
16
  import { isValidCron } from 'cron-validator';
17
17
  import { fetchSpecsScheduledScanConfig } from '@shell/models/cis.cattle.io.clusterscan';
18
18
 
@@ -43,7 +43,8 @@ export default {
43
43
  // in the clusterscan edit/create views the "canBeScheduled" won't run properly
44
44
  await this.schema.fetchResourceFields();
45
45
 
46
- if (this.realMode === _CREATE || this.realMode === _EDIT) {
46
+ // Only initialize on create or if we don't have a spec object (added for resilience)
47
+ if (this.realMode === _CREATE || !this.value.spec) {
47
48
  const includeScheduling = this.value.canBeScheduled();
48
49
  const spec = this.value.spec || {};
49
50
 
@@ -326,7 +327,7 @@ export default {
326
327
  </div>
327
328
  <div class="col span-6">
328
329
  <UnitInput
329
- v-model.number="scheduledScanConfig.retentionCount"
330
+ v-model:value="scheduledScanConfig.retentionCount"
330
331
  :suffix="t('cis.reports')"
331
332
  type="number"
332
333
  :mode="mode"
@@ -18,6 +18,8 @@ export default {
18
18
 
19
19
  mixins: [createEditView],
20
20
 
21
+ inheritAttrs: false,
22
+
21
23
  props: {
22
24
  value: {
23
25
  type: Object,
@@ -48,6 +48,8 @@ export default {
48
48
 
49
49
  mixins: [CreateEditView],
50
50
 
51
+ inheritAttrs: false,
52
+
51
53
  props: {
52
54
  value: {
53
55
  type: Object,
@@ -20,6 +20,8 @@ export default {
20
20
  NameNsDescription,
21
21
  },
22
22
 
23
+ inheritAttrs: false,
24
+
23
25
  mixins: [CreateEditView],
24
26
 
25
27
  props: {
@@ -53,6 +55,7 @@ export default {
53
55
  methods: {
54
56
  async save(buttonDone) {
55
57
  try {
58
+ this.errors = [];
56
59
  await this.value.save();
57
60
 
58
61
  await this.normanCluster.save();
@@ -60,6 +63,7 @@ export default {
60
63
  this.done();
61
64
  buttonDone(true);
62
65
  } catch (e) {
66
+ this.errors.push(e);
63
67
  buttonDone(false);
64
68
  }
65
69
  },
@@ -25,6 +25,7 @@ import { CAPI, CATALOG, FLEET as FLEET_LABELS } from '@shell/config/labels-annot
25
25
  import { SECRET_TYPES } from '@shell/config/secret';
26
26
  import { checkSchemasForFindAllHash } from '@shell/utils/auth';
27
27
  import Checkbox from '@components/Form/Checkbox/Checkbox.vue';
28
+ import FormValidation from '@shell/mixins/form-validation';
28
29
 
29
30
  const _VERIFY = 'verify';
30
31
  const _SKIP = 'skip';
@@ -33,6 +34,8 @@ const _SPECIFY = 'specify';
33
34
  export default {
34
35
  name: 'CruGitRepo',
35
36
 
37
+ inheritAttrs: false,
38
+
36
39
  emits: ['input'],
37
40
 
38
41
  components: {
@@ -50,7 +53,7 @@ export default {
50
53
  SelectOrCreateAuthSecret,
51
54
  },
52
55
 
53
- mixins: [CreateEditView],
56
+ mixins: [CreateEditView, FormValidation],
54
57
 
55
58
  async fetch() {
56
59
  const hash = await checkSchemasForFindAllHash({
@@ -153,7 +156,8 @@ export default {
153
156
  stepRepoInfo,
154
157
  stepTargetInfo,
155
158
  addRepositorySteps,
156
- displayHelmRepoURLRegex: false
159
+ displayHelmRepoURLRegex: false,
160
+ fvFormRuleSets: [{ path: 'spec.repo', rules: ['required'] }]
157
161
  };
158
162
  },
159
163
 
@@ -253,7 +257,7 @@ export default {
253
257
  },
254
258
 
255
259
  stepOneRequires() {
256
- return !!this.value.metadata.name && !!this.refValue;
260
+ return !!this.value.metadata.name && !!this.refValue && !!this.fvFormIsValid;
257
261
  },
258
262
  },
259
263
 
@@ -265,6 +269,8 @@ export default {
265
269
  targetAdvanced: 'updateTargets',
266
270
  tlsMode: 'updateTls',
267
271
  caBundle: 'updateTls',
272
+ 'value.metadata.name': 'stepOneReady',
273
+ 'value.spec.repo': 'stepOneReady',
268
274
 
269
275
  workspace(neu) {
270
276
  if ( this.isCreate ) {
@@ -456,10 +462,6 @@ export default {
456
462
  this.tlsMode = event;
457
463
  },
458
464
 
459
- onUpdateRepoName() {
460
- this.stepOneReady();
461
- },
462
-
463
465
  stepOneReady() {
464
466
  this.addRepositorySteps[0]['ready'] = this.stepOneRequires;
465
467
  },
@@ -528,7 +530,6 @@ export default {
528
530
  :namespaced="false"
529
531
  :mode="mode"
530
532
  @update:value="$emit('input', $event)"
531
- @change="onUpdateRepoName"
532
533
  />
533
534
 
534
535
  <div class="row">
@@ -552,6 +553,8 @@ export default {
552
553
  :mode="mode"
553
554
  label-key="fleet.gitRepo.repo.label"
554
555
  :placeholder="t('fleet.gitRepo.repo.placeholder', null, true)"
556
+ :required="true"
557
+ :rules="fvGetAndReportPathRules('spec.repo')"
555
558
  />
556
559
  </div>
557
560
  <div class="col span-6">
@@ -21,6 +21,8 @@ export default {
21
21
 
22
22
  mixins: [createEditView],
23
23
 
24
+ inheritAttrs: false,
25
+
24
26
  props: {
25
27
  value: {
26
28
  type: Object,
@@ -22,6 +22,8 @@ export default {
22
22
 
23
23
  mixins: [CreateEditView],
24
24
 
25
+ inheritAttrs: false,
26
+
25
27
  props: {
26
28
  value: {
27
29
  type: Object,
@@ -15,6 +15,8 @@ export default {
15
15
 
16
16
  mixins: [CreateEditView, FormValidation],
17
17
 
18
+ inheritAttrs: false,
19
+
18
20
  data() {
19
21
  return {
20
22
  fvFormRuleSets: [
@@ -50,6 +50,8 @@ export default {
50
50
 
51
51
  mixins: [CreateEditView],
52
52
 
53
+ inheritAttrs: false,
54
+
53
55
  async fetch() {
54
56
  const hasAccessToClusterOutputs = this.$store.getters[`cluster/schemaFor`](LOGGING.CLUSTER_OUTPUT);
55
57
  const hasAccessToOutputs = this.$store.getters[`cluster/schemaFor`](LOGGING.OUTPUT);
@@ -103,7 +103,8 @@ export default {
103
103
  this.value.metadata['namespace'] = this.$store.getters['currentCluster'].id;
104
104
  this.value['spec'] = this.value.spec || {};
105
105
  this.value.spec['containerDefaultResourceLimit'] = this.value.spec.containerDefaultResourceLimit || {};
106
- if (!this.$store.getters['auth/principalId'].includes('local://')) {
106
+ // norman (and matching steve) resources treat annotations containing `cattle.io` as immutable, so only do this for the create world
107
+ if (this.isCreate && !this.$store.getters['auth/principalId'].includes('local://')) {
107
108
  this.value.metadata.annotations[CREATOR_PRINCIPAL_ID] = this.$store.getters['auth/principalId'];
108
109
  }
109
110
  },
@@ -11,7 +11,8 @@ export default {
11
11
  ProjectMemberEditor,
12
12
  },
13
13
 
14
- mixins: [CreateEditView],
14
+ mixins: [CreateEditView],
15
+ inheritAttrs: false,
15
16
  async fetch() {
16
17
  await this.$store.dispatch('management/findAll', { type: MANAGEMENT.USER });
17
18
  this.projects = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.PROJECT });
@@ -14,10 +14,13 @@ export default {
14
14
  components: {
15
15
  ChangePassword, GlobalRoleBindings, CruResource, LabeledInput, Loading
16
16
  },
17
+
17
18
  mixins: [
18
19
  CreateEditView
19
20
  ],
20
21
 
22
+ inheritAttrs: false,
23
+
21
24
  data() {
22
25
  const showGlobalRoles = !!this.$store.getters[`management/schemaFor`](MANAGEMENT.GLOBAL_ROLE);
23
26
 
@@ -30,6 +30,8 @@ export default {
30
30
 
31
31
  mixins: [CreateEditView],
32
32
 
33
+ inheritAttrs: false,
34
+
33
35
  async fetch() {
34
36
  const inStore = this.$store.getters['currentProduct'].inStore;
35
37
  const alertmanagerConfigId = this.value.id;
@@ -105,6 +105,8 @@ export default {
105
105
 
106
106
  mixins: [CreateEditView, FormValidation],
107
107
 
108
+ inheritAttrs: false,
109
+
108
110
  async fetch() {
109
111
  /**
110
112
  * example receiver value:
@@ -102,7 +102,7 @@ export default {
102
102
  if (isEmpty(this.value?.annotations)) {
103
103
  this.value['annotations'] = { summary: '' };
104
104
  } else {
105
- this.value.annotations['summary'] = '';
105
+ this.value.annotations = { ...this.value.annotations, summary: '' };
106
106
  }
107
107
  } else {
108
108
  this.value.annotations['summary'] = '';
@@ -124,7 +124,7 @@ export default {
124
124
  if (isEmpty(this.value?.annotations)) {
125
125
  this.value['annotations'] = { message: '' };
126
126
  } else {
127
- this.value.annotations['message'] = '';
127
+ this.value.annotations = { ...this.value.annotations, message: '' };
128
128
  }
129
129
  } else {
130
130
  this.value.annotations['message'] = '';
@@ -146,7 +146,7 @@ export default {
146
146
  if (isEmpty(this.value?.annotations)) {
147
147
  this.value['annotations'] = { description: '' };
148
148
  } else {
149
- this.value.annotations['description'] = '';
149
+ this.value.annotations = { ...this.value.annotations, description: '' };
150
150
  }
151
151
  } else {
152
152
  this.value.annotations['description'] = '';
@@ -168,7 +168,7 @@ export default {
168
168
  if (isEmpty(this.value?.annotations)) {
169
169
  this.value['annotations'] = { runbook_url: '' };
170
170
  } else {
171
- this.value.annotations['runbook_url'] = '';
171
+ this.value.annotations = { ...this.value.annotations, runbook_url: '' };
172
172
  }
173
173
  } else {
174
174
  this.value.annotations['runbook_url'] = '';
@@ -213,7 +213,7 @@ export default {
213
213
  return undefined;
214
214
  },
215
215
  set(v) {
216
- this.value['for'] = [null, undefined].includes(v ? undefined : `${ v }s`);
216
+ this.value['for'] = [null, undefined].includes(v) ? undefined : `${ v }s`;
217
217
  }
218
218
  }
219
219
  },
@@ -29,6 +29,8 @@ export default {
29
29
 
30
30
  mixins: [CreateEditView, FormValidation],
31
31
 
32
+ inheritAttrs: false,
33
+
32
34
  props: {
33
35
  value: {
34
36
  type: Object,
@@ -111,7 +113,7 @@ export default {
111
113
  },
112
114
 
113
115
  updateGroupInterval(group, interval) {
114
- group['interval'] = [null, undefined].includes(interval ? undefined : `${ interval }s`);
116
+ group['interval'] = [null, undefined].includes(interval) ? undefined : `${ interval }s`;
115
117
  },
116
118
 
117
119
  getGroupInterval(interval) {
@@ -37,6 +37,8 @@ export default {
37
37
 
38
38
  mixins: [CreateEditView],
39
39
 
40
+ inheritAttrs: false,
41
+
40
42
  async fetch() {
41
43
  await this.$store.dispatch('cluster/findAll', { type: MONITORING.SPOOFED.ROUTE });
42
44
  },
@@ -35,6 +35,8 @@ export default {
35
35
 
36
36
  mixins: [CreateEditView],
37
37
 
38
+ inheritAttrs: false,
39
+
38
40
  async fetch() {
39
41
  const receivers = this.$store.dispatch('cluster/findAll', { type: MONITORING.SPOOFED.RECEIVER });
40
42
  const routes = this.$store.dispatch('cluster/findAll', { type: MONITORING.SPOOFED.ROUTE });
@@ -24,6 +24,8 @@ export default {
24
24
 
25
25
  mixins: [CreateEditView],
26
26
 
27
+ inheritAttrs: false,
28
+
27
29
  created() {
28
30
  if (!get(this.value, 'spec.trafficPolicy.loadBalancer')) {
29
31
  set(this.value, 'spec.trafficPolicy.loadBalancer', { simple: 'ROUND_ROBIN' });
@@ -15,6 +15,8 @@ export default {
15
15
 
16
16
  mixins: [CreateEditView, FormValidation],
17
17
 
18
+ inheritAttrs: false,
19
+
18
20
  data() {
19
21
  return {
20
22
  fvFormRuleSets: [
@@ -128,6 +128,32 @@ describe('component: Advanced', () => {
128
128
 
129
129
  expect(checkbox.value).toBe('true');
130
130
  });
131
+
132
+ it(`should update agentConfig when 'protect-kernel-defaults' exists`, async() => {
133
+ const value = clone(PROV_CLUSTER);
134
+
135
+ value.spec.rkeConfig.machineGlobalConfig['protect-kernel-defaults'] = false;
136
+ value.spec.rkeConfig.machineSelectorConfig = [{
137
+ config: { 'protect-kernel-defaults': true },
138
+ machineLabelSelector: {}
139
+ }];
140
+ value.agentConfig = value.spec.rkeConfig.machineSelectorConfig[0].config;
141
+
142
+ mountOptions.propsData.mode = _EDIT; // Use edit mode to allow interactions
143
+ mountOptions.propsData.value = value;
144
+
145
+ wrapper = mount(Advanced, mountOptions);
146
+
147
+ const checkboxLabel = wrapper
148
+ .find(`[data-testid="protect-kernel-defaults"]`)
149
+ .find('label');
150
+
151
+ checkboxLabel.trigger('click');
152
+ await wrapper.vm.$nextTick();
153
+
154
+ // Verify that agentConfig is updated
155
+ expect(value.spec.rkeConfig.machineSelectorConfig[0].config['protect-kernel-defaults']).toBe(false);
156
+ });
131
157
  });
132
158
 
133
159
  describe(`'kubelet-arg'`, () => {