@rancher/shell 3.0.9-rc.5 → 3.0.9-rc.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 (142) hide show
  1. package/assets/images/providers/oci-open-containers.svg +22 -0
  2. package/assets/images/providers/traefik.png +0 -0
  3. package/assets/styles/themes/_dark.scss +2 -0
  4. package/assets/styles/themes/_light.scss +2 -0
  5. package/assets/styles/themes/_modern.scss +6 -0
  6. package/assets/translations/en-us.yaml +129 -25
  7. package/components/CruResource.vue +3 -1
  8. package/components/ExplorerProjectsNamespaces.vue +12 -12
  9. package/components/Resource/Detail/Card/StatusCard/__tests__/StatusCard.test.ts +109 -0
  10. package/components/Resource/Detail/Card/StatusCard/index.vue +21 -4
  11. package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/identifying-fields.test.ts +19 -2
  12. package/components/Resource/Detail/Metadata/IdentifyingInformation/identifying-fields.ts +19 -11
  13. package/components/Resource/Detail/ResourcePopover/__tests__/index.test.ts +12 -0
  14. package/components/Resource/Detail/ResourcePopover/index.vue +2 -0
  15. package/components/Resource/Detail/ResourceRow.vue +2 -2
  16. package/components/ResourceList/index.vue +7 -4
  17. package/components/Window/ContainerLogs.vue +48 -37
  18. package/components/fleet/FleetClusterTargets/TargetsList.vue +2 -2
  19. package/components/fleet/FleetClusterTargets/index.vue +6 -1
  20. package/components/fleet/GitRepoAdvancedTab.vue +333 -0
  21. package/components/fleet/GitRepoMetadataTab.vue +43 -0
  22. package/components/fleet/GitRepoRepositoryTab.vue +101 -0
  23. package/components/fleet/GitRepoTargetTab.vue +77 -0
  24. package/components/fleet/HelmOpAdvancedTab.vue +247 -0
  25. package/components/fleet/HelmOpChartTab.vue +158 -0
  26. package/components/fleet/HelmOpMetadataTab.vue +46 -0
  27. package/components/fleet/HelmOpTargetTab.vue +84 -0
  28. package/components/fleet/HelmOpValuesTab.vue +147 -0
  29. package/components/fleet/__tests__/FleetClusterTargets.test.ts +119 -70
  30. package/components/form/NodeScheduling.vue +81 -7
  31. package/components/form/PodAffinity.vue +1 -36
  32. package/components/form/ResourceLabeledSelect.vue +8 -4
  33. package/components/form/ResourceQuota/Namespace.vue +30 -9
  34. package/components/form/ResourceQuota/NamespaceRow.vue +25 -7
  35. package/components/form/ResourceQuota/Project.vue +140 -82
  36. package/components/form/ResourceQuota/ResourceQuotaEntry.vue +145 -0
  37. package/components/form/ResourceQuota/__tests__/Namespace.test.ts +307 -0
  38. package/components/form/ResourceQuota/__tests__/NamespaceRow.test.ts +281 -0
  39. package/components/form/ResourceQuota/__tests__/Project.test.ts +274 -27
  40. package/components/form/ResourceQuota/__tests__/ResourceQuotaEntry.test.ts +215 -0
  41. package/components/form/SchedulingCustomization.vue +14 -6
  42. package/components/form/SelectOrCreateAuthSecret.vue +107 -18
  43. package/components/form/__tests__/NodeScheduling.test.ts +12 -9
  44. package/components/form/__tests__/PodAffinity.test.ts +21 -2
  45. package/components/form/__tests__/SchedulingCustomization.test.ts +240 -0
  46. package/components/formatter/ClusterLink.vue +8 -0
  47. package/components/formatter/SecretOrigin.vue +79 -0
  48. package/config/labels-annotations.js +7 -6
  49. package/config/pagination-table-headers.js +6 -4
  50. package/config/product/explorer.js +1 -11
  51. package/config/query-params.js +3 -0
  52. package/config/settings.ts +15 -2
  53. package/config/table-headers.js +21 -17
  54. package/config/types.js +23 -8
  55. package/detail/workload/index.vue +11 -16
  56. package/dialog/DeactivateDriverDialog.vue +1 -1
  57. package/dialog/Ipv6NetworkingDialog.vue +156 -0
  58. package/dialog/ScalePoolDownDialog.vue +2 -2
  59. package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +1 -1
  60. package/edit/__tests__/fleet.cattle.io.helmop.test.ts +1 -0
  61. package/edit/__tests__/management.cattle.io.project.test.js +56 -128
  62. package/edit/auth/oidc.vue +1 -1
  63. package/edit/catalog.cattle.io.clusterrepo.vue +155 -25
  64. package/edit/fleet.cattle.io.gitrepo.vue +153 -283
  65. package/edit/fleet.cattle.io.helmop.vue +190 -332
  66. package/edit/management.cattle.io.project.vue +5 -42
  67. package/edit/management.cattle.io.setting.vue +6 -0
  68. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +55 -24
  69. package/edit/provisioning.cattle.io.cluster/__tests__/Networking.test.ts +1 -103
  70. package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +13 -1
  71. package/edit/provisioning.cattle.io.cluster/__tests__/rke2-fleet-cluster-agent.test.ts +283 -0
  72. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +65 -49
  73. package/edit/provisioning.cattle.io.cluster/ingress/IngressCards.vue +112 -0
  74. package/edit/provisioning.cattle.io.cluster/ingress/IngressConfiguration.vue +158 -0
  75. package/edit/provisioning.cattle.io.cluster/rke2.vue +171 -72
  76. package/edit/provisioning.cattle.io.cluster/shared.ts +36 -1
  77. package/edit/provisioning.cattle.io.cluster/tabs/AgentConfiguration.vue +2 -1
  78. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +55 -7
  79. package/edit/provisioning.cattle.io.cluster/tabs/Ingress.vue +319 -0
  80. package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +2 -1
  81. package/edit/provisioning.cattle.io.cluster/tabs/etcd/__tests__/S3Config.test.ts +13 -1
  82. package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +10 -44
  83. package/edit/secret/index.vue +1 -1
  84. package/edit/token.vue +68 -29
  85. package/edit/workload/__tests__/index.test.ts +2 -37
  86. package/edit/workload/index.vue +6 -2
  87. package/edit/workload/mixins/workload.js +0 -32
  88. package/list/__tests__/management.cattle.io.setting.test.ts +198 -0
  89. package/list/management.cattle.io.setting.vue +13 -0
  90. package/list/provisioning.cattle.io.cluster.vue +50 -1
  91. package/list/secret.vue +4 -9
  92. package/list/service.vue +6 -8
  93. package/machine-config/amazonec2.vue +11 -4
  94. package/machine-config/components/EC2Networking.vue +46 -30
  95. package/machine-config/components/__tests__/EC2Networking.test.ts +7 -7
  96. package/machine-config/components/__tests__/utils/vpcSubnetMockData.js +0 -9
  97. package/machine-config/digitalocean.vue +3 -3
  98. package/models/__tests__/namespace.test.ts +11 -0
  99. package/models/__tests__/provisioning.cattle.io.cluster.test.ts +96 -0
  100. package/models/__tests__/workload.test.ts +42 -1
  101. package/models/catalog.cattle.io.clusterrepo.js +30 -4
  102. package/models/ext.cattle.io.token.js +48 -0
  103. package/models/kontainerdriver.js +2 -2
  104. package/models/namespace.js +7 -1
  105. package/models/nodedriver.js +2 -2
  106. package/models/provisioning.cattle.io.cluster.js +28 -7
  107. package/models/secret.js +0 -17
  108. package/models/service.js +44 -1
  109. package/models/token.js +4 -0
  110. package/models/workload.js +12 -6
  111. package/package.json +1 -1
  112. package/pages/account/index.vue +96 -67
  113. package/pages/auth/setup.vue +5 -14
  114. package/pages/c/_cluster/apps/charts/__tests__/install.test.ts +4 -1
  115. package/pages/c/_cluster/apps/charts/index.vue +93 -4
  116. package/pages/c/_cluster/apps/charts/install.vue +317 -42
  117. package/pages/c/_cluster/manager/drivers/kontainerDriver/index.vue +5 -4
  118. package/pages/c/_cluster/settings/index.vue +3 -1
  119. package/plugins/dashboard-store/__tests__/getters.test.ts +108 -0
  120. package/plugins/dashboard-store/__tests__/resource-class.test.ts +27 -0
  121. package/plugins/dashboard-store/actions.js +3 -8
  122. package/plugins/dashboard-store/getters.js +7 -5
  123. package/plugins/dashboard-store/mutations.js +4 -1
  124. package/plugins/dashboard-store/resource-class.js +3 -3
  125. package/plugins/steve/__tests__/steve-class.test.ts +102 -141
  126. package/plugins/steve/steve-class.js +12 -3
  127. package/plugins/steve/steve-pagination-utils.ts +6 -2
  128. package/rancher-components/RcIcon/types.ts +2 -0
  129. package/rancher-components/RcItemCard/RcItemCard.vue +64 -19
  130. package/store/prefs.js +3 -0
  131. package/types/aws-sdk.d.ts +121 -0
  132. package/types/resources/node.ts +15 -0
  133. package/types/shell/index.d.ts +536 -506
  134. package/types/store/pagination.types.ts +5 -5
  135. package/utils/__tests__/array.test.ts +1 -29
  136. package/utils/__tests__/cluster-agent-configuration.test.ts +203 -0
  137. package/utils/array.ts +0 -11
  138. package/utils/aws.ts +21 -0
  139. package/utils/cluster.js +22 -2
  140. package/utils/selector-typed.ts +1 -1
  141. package/components/__tests__/ProjectRow.test.ts +0 -206
  142. package/components/form/ResourceQuota/ProjectRow.vue +0 -277
@@ -1,15 +1,21 @@
1
- <script>
1
+ <script lang="ts">
2
2
  import CreateEditView from '@shell/mixins/create-edit-view';
3
3
  import Footer from '@shell/components/form/Footer';
4
4
  import { LabeledInput } from '@components/Form/LabeledInput';
5
- import { RadioGroup } from '@components/Form/Radio';
6
5
  import NameNsDescription from '@shell/components/form/NameNsDescription';
7
6
  import Labels from '@shell/components/form/Labels';
8
7
  import SelectOrCreateAuthSecret from '@shell/components/form/SelectOrCreateAuthSecret';
9
8
  import Banner from '@components/Banner/Banner.vue';
10
9
  import { Checkbox } from '@components/Form/Checkbox';
11
- import { MANAGEMENT, NAMESPACE, CLUSTER_REPO_TYPES } from '@shell/config/types';
10
+ import {
11
+ MANAGEMENT, NAMESPACE, CLUSTER_REPO_TYPES, AUTH_TYPE,
12
+ CLUSTER_REPO_APPCO_AUTH_GENERATE_NAME, CLUSTER_REPO_AUTH_GENERATE_NAME
13
+ } from '@shell/config/types';
12
14
  import UnitInput from '@shell/components/form/UnitInput.vue';
15
+ import { getVersionData } from '@shell/config/version';
16
+ import { RcItemCard } from '@components/RcItemCard';
17
+ import { _CREATE, _EDIT, TARGET, _VIEW } from '@shell/config/query-params';
18
+ import { RcIconType } from '@components/RcIcon/types';
13
19
 
14
20
  export default {
15
21
  name: 'CruCatalogRepo',
@@ -18,30 +24,88 @@ export default {
18
24
 
19
25
  components: {
20
26
  Footer,
21
- RadioGroup,
22
27
  LabeledInput,
23
28
  NameNsDescription,
24
29
  Labels,
25
30
  SelectOrCreateAuthSecret,
26
31
  Banner,
27
32
  Checkbox,
28
- UnitInput
33
+ UnitInput,
34
+ RcItemCard,
29
35
  },
30
36
 
31
37
  mixins: [CreateEditView],
32
38
 
33
39
  data() {
34
- const clusterRepoType = !!this.value.spec.gitRepo ? CLUSTER_REPO_TYPES.GIT_REPO : this.value.isOciType ? CLUSTER_REPO_TYPES.OCI_URL : CLUSTER_REPO_TYPES.HELM_URL;
40
+ // Determine the cluster repo type based on existing values (for edit mode)
41
+ let clusterRepoType = '';
42
+
43
+ if (!!this.value.spec.gitRepo) {
44
+ clusterRepoType = CLUSTER_REPO_TYPES.GIT_REPO;
45
+ } else if (this.value.isOciType) {
46
+ clusterRepoType = this.value?.isSuseAppCollectionFromUI ? CLUSTER_REPO_TYPES.SUSE_APP_COLLECTION : CLUSTER_REPO_TYPES.OCI_URL;
47
+ } else {
48
+ clusterRepoType = CLUSTER_REPO_TYPES.HELM_URL;
49
+ }
50
+
51
+ const clusterRepoTargets = [
52
+ {
53
+ id: CLUSTER_REPO_TYPES.HELM_URL,
54
+ header: { title: { key: 'catalog.repo.target.http.title' } },
55
+ image: { icon: 'helm' as RcIconType, alt: { key: 'catalog.repo.target.http.title' } },
56
+ content: { key: 'catalog.repo.target.http.description' },
57
+ },
58
+ {
59
+ id: CLUSTER_REPO_TYPES.GIT_REPO,
60
+ header: { title: { key: 'catalog.repo.target.git.title' } },
61
+ image: { icon: 'git' as RcIconType, alt: { key: 'catalog.repo.target.git.title' } },
62
+ content: { key: 'catalog.repo.target.git.description' },
63
+ },
64
+ {
65
+ id: CLUSTER_REPO_TYPES.OCI_URL,
66
+ header: { title: { key: 'catalog.repo.target.oci.title' } },
67
+ image: { src: require('@shell/assets/images/providers/oci-open-containers.svg'), alt: { key: 'catalog.repo.target.oci.title' } },
68
+ content: { key: 'catalog.repo.target.oci.description' },
69
+ },
70
+ ];
71
+
72
+ // Only show SUSE App Collection option for RancherPrime
73
+ if (getVersionData()?.RancherPrime === 'true') {
74
+ clusterRepoTargets.push({
75
+ id: CLUSTER_REPO_TYPES.SUSE_APP_COLLECTION,
76
+ header: { title: { key: 'catalog.repo.target.suseAppCollection.title' } },
77
+ image: { src: require('@shell/assets/images/content/suse.svg'), alt: { key: 'catalog.repo.target.suseAppCollection.title' } },
78
+ content: { key: 'catalog.repo.target.suseAppCollection.description' },
79
+ });
80
+ }
35
81
 
36
82
  return {
37
83
  CLUSTER_REPO_TYPES,
84
+ AUTH_TYPE,
85
+ CLUSTER_REPO_APPCO_AUTH_GENERATE_NAME,
86
+ CLUSTER_REPO_AUTH_GENERATE_NAME,
38
87
  clusterRepoType,
39
- ociMinWait: this.value.spec.exponentialBackOffValues?.minWait,
40
- ociMaxWait: this.value.spec.exponentialBackOffValues?.maxWait,
41
- ociMaxRetries: this.value.spec.exponentialBackOffValues?.maxRetries
88
+ ociMinWait: this.value.spec.exponentialBackOffValues?.minWait,
89
+ ociMaxWait: this.value.spec.exponentialBackOffValues?.maxWait,
90
+ ociMaxRetries: this.value.spec.exponentialBackOffValues?.maxRetries,
91
+ getVersionData,
92
+ isView: this.mode === _VIEW,
93
+ clusterRepoTargets,
94
+ previousName: '',
95
+ previousDescription: '',
42
96
  };
43
97
  },
44
98
 
99
+ created() {
100
+ // When creating a new repo with a target query parameter, initialize the form properly
101
+ const targetFromQuery = this.mode === _CREATE ? this.$route.query[TARGET] : null;
102
+
103
+ if (targetFromQuery && Object.values(CLUSTER_REPO_TYPES).includes(targetFromQuery)) {
104
+ // Trigger onTargetChange to properly initialize form fields for the selected target
105
+ this.onTargetChange(targetFromQuery);
106
+ }
107
+ },
108
+
45
109
  computed: {
46
110
  inStore() {
47
111
  return this.$store.getters['currentProduct']?.inStore || MANAGEMENT;
@@ -62,20 +126,33 @@ export default {
62
126
  methods: {
63
127
  onTargetChange(clusterRepoType) {
64
128
  // reset input fields when switching options
129
+ const oldClusterRepoType = this.clusterRepoType;
130
+
131
+ this.clusterRepoType = clusterRepoType;
65
132
  switch (clusterRepoType) {
66
133
  case CLUSTER_REPO_TYPES.GIT_REPO:
67
134
  this.resetOciValues();
68
135
  this.resetHelmValues();
136
+ this.resetNameAndDescription(oldClusterRepoType, this.clusterRepoType);
69
137
  break;
70
138
  case CLUSTER_REPO_TYPES.OCI_URL:
71
139
  // set insecurePlainHttp to false as a secondary flag, alongside checking for 'oci://' in the URL, to determine OCI type later
72
140
  this.value.spec['insecurePlainHttp'] = false;
73
141
  this.resetGitRepoValues();
74
142
  this.resetHelmValues();
143
+ this.resetNameAndDescription(oldClusterRepoType, this.clusterRepoType);
75
144
  break;
76
145
  case CLUSTER_REPO_TYPES.HELM_URL:
77
146
  this.resetOciValues();
78
147
  this.resetGitRepoValues();
148
+ this.resetNameAndDescription(oldClusterRepoType, this.clusterRepoType);
149
+ break;
150
+ case CLUSTER_REPO_TYPES.SUSE_APP_COLLECTION:
151
+ this.resetOciValues();
152
+ this.resetGitRepoValues();
153
+ this.resetHelmValues();
154
+ this.value.spec['url'] = 'oci://dp.apps.rancher.io/charts';
155
+ this.resetNameAndDescription(oldClusterRepoType, this.clusterRepoType);
79
156
  break;
80
157
  }
81
158
  this.resetClientSecret();
@@ -124,6 +201,25 @@ export default {
124
201
  },
125
202
  resetClientSecret() {
126
203
  this.value.spec['clientSecret'] = null;
204
+ },
205
+ resetNameAndDescription(old, neu) {
206
+ if (this.mode === _EDIT) {
207
+ return;
208
+ }
209
+
210
+ if (!this.value?.metadata?.annotations) {
211
+ this.value.metadata.annotations = {};
212
+ }
213
+
214
+ if (neu === CLUSTER_REPO_TYPES.SUSE_APP_COLLECTION) {
215
+ this.previousName = this.value.metadata.name || '';
216
+ this.previousDescription = this.value.metadata.annotations?.['field.cattle.io/description'] || '';
217
+ this.value.metadata['name'] = CLUSTER_REPO_TYPES.SUSE_APP_COLLECTION;
218
+ this.value.metadata.annotations['field.cattle.io/description'] = this.t('catalog.repo.target.suseAppCollection.description');
219
+ } else if (old === CLUSTER_REPO_TYPES.SUSE_APP_COLLECTION) {
220
+ this.value.metadata['name'] = this.previousName;
221
+ this.value.metadata.annotations['field.cattle.io/description'] = this.previousDescription;
222
+ }
127
223
  }
128
224
  },
129
225
  };
@@ -131,28 +227,33 @@ export default {
131
227
 
132
228
  <template>
133
229
  <form>
230
+ <h2>{{ t('catalog.repo.target.label') }}</h2>
231
+ <div class="row mb-10">
232
+ <div class="col span-12 target-groups">
233
+ <RcItemCard
234
+ v-for="card in clusterRepoTargets"
235
+ :id="card.id"
236
+ :key="card.id"
237
+ :header="card.header"
238
+ :image="card.image"
239
+ :content="card.content"
240
+ :selected="clusterRepoType === card.id"
241
+ :clickable="true"
242
+ :disabled="isView"
243
+ variant="small"
244
+ @card-click="onTargetChange(card.id)"
245
+ />
246
+ </div>
247
+ </div>
248
+
134
249
  <NameNsDescription
250
+ :key="clusterRepoType"
135
251
  :value="value"
136
252
  :mode="mode"
137
253
  :namespaced="isNamespaced"
138
254
  @update:value="$emit('input', $event)"
139
255
  />
140
256
 
141
- <h2>{{ t('catalog.repo.target.label') }}</h2>
142
- <div class="row mb-10">
143
- <div class="col span-8">
144
- <RadioGroup
145
- v-model:value="clusterRepoType"
146
- :name="clusterRepoType"
147
- :options="[CLUSTER_REPO_TYPES.HELM_URL, CLUSTER_REPO_TYPES.GIT_REPO, CLUSTER_REPO_TYPES.OCI_URL]"
148
- :labels="[t('catalog.repo.target.http'), t('catalog.repo.target.git'), t('catalog.repo.target.oci', null, true)]"
149
- :mode="mode"
150
- data-testid="clusterrepo-radio-input"
151
- @update:value="onTargetChange"
152
- />
153
- </div>
154
- </div>
155
-
156
257
  <template v-if="clusterRepoType === CLUSTER_REPO_TYPES.OCI_URL">
157
258
  <Banner
158
259
  label-key="catalog.repo.oci.warning"
@@ -201,6 +302,20 @@ export default {
201
302
  </div>
202
303
  </template>
203
304
 
305
+ <template v-else-if="clusterRepoType === CLUSTER_REPO_TYPES.SUSE_APP_COLLECTION">
306
+ <div class="col span-6">
307
+ <LabeledInput
308
+ v-model:value.trim="value.spec.url"
309
+ :required="true"
310
+ :label="t('catalog.repo.oci.urlLabel')"
311
+ :placeholder="t('catalog.repo.oci.placeholder', null, true)"
312
+ :mode="mode"
313
+ data-testid="clusterrepo-oci-url-input"
314
+ :disabled="true"
315
+ />
316
+ </div>
317
+ </template>
318
+
204
319
  <div
205
320
  v-else
206
321
  class="col span-6"
@@ -240,8 +355,12 @@ export default {
240
355
  :limit-to-namespace="false"
241
356
  :in-store="inStore"
242
357
  :allow-ssh="clusterRepoType !== CLUSTER_REPO_TYPES.OCI_URL"
243
- generate-name="clusterrepo-auth-"
358
+ :pre-select="clusterRepoType === CLUSTER_REPO_TYPES.SUSE_APP_COLLECTION ? { selected: AUTH_TYPE._BASIC } : null"
359
+ :allow-none="clusterRepoType !== CLUSTER_REPO_TYPES.SUSE_APP_COLLECTION"
360
+ :generate-name="clusterRepoType === CLUSTER_REPO_TYPES.SUSE_APP_COLLECTION ? CLUSTER_REPO_APPCO_AUTH_GENERATE_NAME : CLUSTER_REPO_AUTH_GENERATE_NAME"
244
361
  :cache-secrets="true"
362
+ :fixed-http-basic-auth="clusterRepoType === CLUSTER_REPO_TYPES.SUSE_APP_COLLECTION"
363
+ :filter-basic-auth="CLUSTER_REPO_APPCO_AUTH_GENERATE_NAME"
245
364
  />
246
365
 
247
366
  <div v-if="clusterRepoType === CLUSTER_REPO_TYPES.OCI_URL">
@@ -334,3 +453,14 @@ export default {
334
453
  />
335
454
  </form>
336
455
  </template>
456
+
457
+ <style lang="css" scoped>
458
+ .target-groups {
459
+ display: grid;
460
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
461
+ grid-gap: var(--gap-md);
462
+ width: 100%;
463
+ height: max-content;
464
+ overflow: hidden;
465
+ }
466
+ </style>