@rancher/shell 3.0.12-rc.4 → 3.0.12-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 (159) hide show
  1. package/apis/intf/resources-api/resource-base.ts +42 -2
  2. package/apis/intf/resources-api/resource-instance.ts +101 -0
  3. package/apis/intf/resources-api/resources-api.ts +177 -23
  4. package/apis/intf/resources.ts +8 -6
  5. package/apis/resources/__tests__/resources-api-class.test.ts +309 -28
  6. package/apis/resources/resources-api-class.ts +232 -43
  7. package/assets/images/providers/traefik.png +0 -0
  8. package/assets/styles/global/_button.scss +1 -1
  9. package/assets/translations/en-us.yaml +49 -14
  10. package/chart/__tests__/rancher-monitoring-dashboards-index.test.ts +269 -0
  11. package/chart/rancher-monitoring-dashboards/index.vue +155 -0
  12. package/cloud-credential/__tests__/generic.test.ts +132 -0
  13. package/cloud-credential/generic.vue +33 -3
  14. package/components/ActionDropdownShell.vue +5 -3
  15. package/components/ButtonGroup.vue +26 -1
  16. package/components/CruResource.vue +51 -2
  17. package/components/EtcdInfoBanner.vue +2 -12
  18. package/components/GrafanaDashboard.vue +2 -8
  19. package/components/PromptRestore.vue +93 -32
  20. package/components/Questions/index.vue +1 -0
  21. package/components/Resource/Detail/Masthead/__tests__/index.test.ts +68 -14
  22. package/components/Resource/Detail/Masthead/index.vue +8 -3
  23. package/components/ResourceTable.vue +1 -0
  24. package/components/SortableTable/index.vue +4 -3
  25. package/components/Wizard.vue +14 -1
  26. package/components/__tests__/ButtonGroup.test.ts +56 -0
  27. package/components/__tests__/PromptRestore.test.ts +169 -19
  28. package/components/fleet/GitRepoAdvancedTab.vue +1 -0
  29. package/components/fleet/GitRepoMetadataTab.vue +5 -0
  30. package/components/fleet/HelmOpAppCoConfigTab.vue +4 -0
  31. package/components/fleet/HelmOpMetadataTab.vue +5 -0
  32. package/components/form/FileSelector.vue +39 -1
  33. package/components/form/PrivateRegistry.constants.ts +7 -0
  34. package/components/form/PrivateRegistry.vue +253 -18
  35. package/components/form/Security.vue +1 -1
  36. package/components/form/SelectOrCreateAuthSecret.vue +140 -17
  37. package/components/form/__tests__/FileSelector.test.ts +23 -0
  38. package/components/form/__tests__/PrivateRegistry.test.ts +463 -73
  39. package/components/form/__tests__/SelectOrCreateAuthSecret.test.ts +122 -0
  40. package/components/formatter/EtcdSnapshotName.vue +73 -0
  41. package/components/formatter/Translate.vue +22 -1
  42. package/components/nav/Group.vue +5 -10
  43. package/components/nav/Header.vue +8 -1
  44. package/components/nav/TopLevelMenu.vue +1 -30
  45. package/components/nav/__tests__/Group.test.ts +61 -0
  46. package/components/templates/default.vue +7 -0
  47. package/config/features.js +1 -0
  48. package/config/labels-annotations.js +3 -0
  49. package/config/product/manager.js +6 -0
  50. package/config/secret.ts +10 -0
  51. package/config/settings.ts +6 -2
  52. package/config/table-headers.js +5 -2
  53. package/config/types.js +7 -0
  54. package/core/__tests__/plugin-products-apply.test.ts +787 -0
  55. package/core/__tests__/plugin-products-extend.test.ts +189 -0
  56. package/core/__tests__/plugin-products-helpers.test.ts +81 -78
  57. package/core/__tests__/plugin-products-new.test.ts +389 -0
  58. package/core/__tests__/plugin-products-scenarios.test.ts +980 -0
  59. package/core/__tests__/plugin-products-side-menu.test.ts +1935 -0
  60. package/core/plugin-products-base.ts +201 -93
  61. package/core/plugin-products-extending.ts +1 -1
  62. package/core/plugin-products-external.ts +380 -0
  63. package/core/plugin-products-helpers.ts +28 -24
  64. package/core/plugin-products-internal.ts +207 -0
  65. package/core/plugin-products-top-level.ts +10 -5
  66. package/core/plugin-products-type-guards.ts +17 -6
  67. package/core/plugin-products.ts +5 -7
  68. package/core/plugin-types.ts +1 -389
  69. package/core/plugin.ts +10 -11
  70. package/core/types.ts +6 -202
  71. package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +52 -0
  72. package/detail/pod.vue +1 -1
  73. package/detail/provisioning.cattle.io.cluster.vue +79 -5
  74. package/dialog/RotateEncryptionKeyDialog.vue +33 -9
  75. package/dialog/__tests__/RotateEncryptionKeyDialog.test.ts +78 -0
  76. package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +92 -0
  77. package/edit/__tests__/fleet.cattle.io.helmop.test.ts +101 -0
  78. package/edit/__tests__/management.cattle.io.setting.test.ts +2 -1
  79. package/edit/auth/AuthProviderWarningBanners.vue +12 -0
  80. package/edit/auth/__tests__/AuthProviderWarningBanners.test.ts +10 -1
  81. package/edit/auth/__tests__/azuread.test.ts +1 -0
  82. package/edit/auth/__tests__/github.test.ts +1 -0
  83. package/edit/auth/__tests__/oidc.test.ts +1 -0
  84. package/edit/auth/__tests__/saml.test.ts +1 -0
  85. package/edit/auth/ldap/__tests__/index.test.ts +1 -0
  86. package/edit/compliance.cattle.io.clusterscanprofile.vue +39 -41
  87. package/edit/fleet.cattle.io.gitrepo.vue +70 -16
  88. package/edit/fleet.cattle.io.helmop.vue +51 -5
  89. package/edit/helm.cattle.io.projecthelmchart.vue +1 -0
  90. package/edit/{management.cattle.io.setting.vue → management.cattle.io.setting/index.vue} +32 -9
  91. package/edit/management.cattle.io.setting/system-default-registry-pull-secrets.vue +81 -0
  92. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +3 -12
  93. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +18 -0
  94. package/edit/provisioning.cattle.io.cluster/index.vue +1 -1
  95. package/edit/provisioning.cattle.io.cluster/rke2.vue +6 -2
  96. package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +0 -1
  97. package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +2 -2
  98. package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +14 -55
  99. package/list/management.cattle.io.user.vue +24 -5
  100. package/list/utils/management.cattle.io.cluster.utils.ts +1 -1
  101. package/machine-config/__tests__/generic.test.ts +163 -0
  102. package/machine-config/components/EC2Networking.vue +31 -7
  103. package/machine-config/components/__tests__/EC2Networking.test.ts +38 -15
  104. package/machine-config/generic.vue +32 -5
  105. package/mixins/resource-fetch.js +1 -1
  106. package/models/__tests__/provisioning.cattle.io.cluster.test.ts +156 -0
  107. package/models/__tests__/rke-machine.cattle.io.vmwarevspheremachinetemplate.test.ts +22 -0
  108. package/models/__tests__/secret.test.ts +68 -1
  109. package/models/management.cattle.io.cluster.js +21 -3
  110. package/models/pod.js +25 -12
  111. package/models/provisioning.cattle.io.cluster.js +59 -9
  112. package/models/rke-machine.cattle.io.vmwarevspheremachinetemplate.js +9 -0
  113. package/models/rke.cattle.io.etcdsnapshot.js +17 -9
  114. package/models/secret.js +19 -0
  115. package/models/workload.js +12 -7
  116. package/package.json +1 -1
  117. package/pages/auth/login.vue +1 -1
  118. package/pages/c/_cluster/apps/charts/__tests__/install.test.ts +569 -81
  119. package/pages/c/_cluster/apps/charts/install.vue +143 -28
  120. package/pages/c/_cluster/auth/config/index.vue +11 -4
  121. package/pages/c/_cluster/monitoring/index.vue +6 -1
  122. package/pkg/require-asset.lib.js +25 -0
  123. package/pkg/vue.config.js +7 -0
  124. package/plugins/dashboard-store/__tests__/resource-class.test.ts +84 -0
  125. package/plugins/dashboard-store/getters.js +0 -1
  126. package/plugins/dashboard-store/resource-class.js +62 -15
  127. package/plugins/steve/__tests__/steve-class-resource-api.test.ts +147 -0
  128. package/plugins/steve/steve-class.js +43 -0
  129. package/plugins/steve/subscribe.js +11 -0
  130. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +115 -0
  131. package/rancher-components/Form/LabeledInput/LabeledInput.vue +83 -3
  132. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +30 -0
  133. package/rancher-components/Form/TextArea/__tests__/TextAreaAutoGrow.test.ts +95 -0
  134. package/rancher-components/RcButton/index.ts +1 -1
  135. package/rancher-components/RcDropdown/RcDropdownTrigger.vue +6 -1
  136. package/store/__tests__/auth.test.ts +18 -0
  137. package/store/__tests__/features.test.ts +131 -0
  138. package/store/__tests__/growl.test.ts +374 -0
  139. package/store/__tests__/modal.test.ts +131 -0
  140. package/store/__tests__/notifications.test.ts +466 -1
  141. package/store/__tests__/slideInPanel.test.ts +88 -0
  142. package/store/__tests__/type-map.utils.test.ts +433 -0
  143. package/store/__tests__/ui-context.test.ts +255 -0
  144. package/store/auth.js +11 -1
  145. package/store/features.js +5 -0
  146. package/store/plugins.js +6 -0
  147. package/types/rancher/steve.api.ts +2 -2
  148. package/types/shell/index.d.ts +120 -0
  149. package/types/store/dashboard-store.types.ts +2 -2
  150. package/types/store/type-map.ts +262 -1
  151. package/utils/__tests__/operation-cr.test.ts +34 -0
  152. package/utils/async.ts +2 -0
  153. package/utils/grafana.js +2 -17
  154. package/utils/monitoring.js +38 -1
  155. package/utils/operation-cr.js +19 -0
  156. package/utils/require-asset.ts +7 -0
  157. package/utils/validators/__tests__/private-registry.test.ts +27 -15
  158. package/utils/validators/private-registry.ts +15 -4
  159. package/core/__tests__/plugin-products.test.ts +0 -4694
@@ -1,9 +1,11 @@
1
1
  import {
2
- ResourceType, FindMethodOptions, FindAllMethodOptions, FindFilteredPageOptions, FindFilteredLabelSelectorOptions,
3
- FindFilteredPageResponse, FindFilteredLabelSelectorResponse
2
+ ResourceType, CreateResourceData, FindMethodOptions, FindAllMethodOptions, FindFilteredPageOptions, FindFilteredLabelSelectorOptions,
3
+ FindFilteredPageResponse, FindFilteredLabelSelectorResponse, SteveResource,
4
+ FindFilteredPageOptionsTransient,
4
5
  } from '@shell/apis/intf/resources-api/resource-base';
6
+ import { ResourceInstance } from '@shell/apis/intf/resources-api/resource-instance';
5
7
  import { ResourcesApi } from '@shell/apis/intf/resources-api/resources-api';
6
- import { SteveListResponse, SteveGetResponse } from '@shell/types/rancher/steve.api';
8
+ import { ActionFindPageTransientResponse } from '@shell/types/store/dashboard-store.types';
7
9
  import { Store } from 'vuex';
8
10
 
9
11
  export class ResourcesApiClassImpl implements ResourcesApi {
@@ -11,11 +13,32 @@ export class ResourcesApiClassImpl implements ResourcesApi {
11
13
 
12
14
  private storeType: 'cluster' | 'management' | string;
13
15
 
16
+ private createLogMessage(message: string, level: 'error' | 'warning' = 'error') {
17
+ return `Resource API ${ level } - ${ this.storeType } - ${ message }`;
18
+ }
19
+
20
+ private surfaceWarning(message: string, e?: any): void {
21
+ console.warn(this.createLogMessage(message, 'warning'), e); // eslint-disable-line no-console
22
+ }
23
+
14
24
  private surfaceError(message: string, e?: any): never {
15
- console.error(`Resource API error - ${ this.storeType } - ${ message }`); // eslint-disable-line no-console
25
+ console.error(this.createLogMessage(message), e); // eslint-disable-line no-console
26
+
16
27
  throw new Error(`Resource API error - ${ this.storeType } - ${ message }`, { cause: e });
17
28
  }
18
29
 
30
+ private resourceUrl(resourceType: ResourceType, resourceId?: string): string {
31
+ if (this.isNamespaced(resourceType) && resourceId && !resourceId.includes('/')) {
32
+ if (!resourceId) {
33
+ this.surfaceError(`Resource "${ resourceType }" is namespaced`);
34
+ } else {
35
+ this.surfaceError(`Resource "${ resourceType }" is namespaced. The resourceId must be in "namespace/name" format, but received "${ resourceId }"`);
36
+ }
37
+ }
38
+
39
+ return this.store.getters[`${ this.storeType }/urlFor`](resourceType, resourceId);
40
+ }
41
+
19
42
  private isNamespaced(resourceType: ResourceType): boolean {
20
43
  const schema = this.store.getters[`${ this.storeType }/schemaFor`]?.(resourceType);
21
44
 
@@ -30,8 +53,9 @@ export class ResourcesApiClassImpl implements ResourcesApi {
30
53
  /**
31
54
  * Finds a specific resource by its type and ID.
32
55
  *
33
- * @template T - The type of the resource (defaults to SteveGetResponse)
34
- * @param resourceType - The type of the resource to find (use **{@link K8S}** constant). See also {@link ResourceType}.
56
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
57
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
58
+ * @param resourceType - The type of the resource to find (examples in **{@link K8S}**). See also {@link ResourceType}.
35
59
  * @param resourceId - The unique identifier of the resource to find. If the resource is namespaced, this should be in the format `namespace/name`.
36
60
  * @param options - Optional find arguments
37
61
  * @returns The found resource item or null if not found.
@@ -49,11 +73,11 @@ export class ResourcesApiClassImpl implements ResourcesApi {
49
73
  * const node = await resources.cluster.find(K8S.NODE, 'worker-1');
50
74
  * ```
51
75
  */
52
- async find<T = SteveGetResponse>(
76
+ async find<T = Record<string, any>, I = ResourceInstance<T>>(
53
77
  resourceType: ResourceType,
54
78
  resourceId: string,
55
79
  options?: FindMethodOptions
56
- ): Promise<T | null> {
80
+ ): Promise<I | null> {
57
81
  if (this.isNamespaced(resourceType) && !resourceId.includes('/')) {
58
82
  this.surfaceError(`Resource "${ resourceType }" is namespaced. The resourceId must be in "namespace/name" format, but received "${ resourceId }"`);
59
83
  }
@@ -65,8 +89,14 @@ export class ResourcesApiClassImpl implements ResourcesApi {
65
89
  opt: options || {}
66
90
  });
67
91
 
68
- return (resource as T) ?? null;
92
+ return resource as I;
69
93
  } catch (e: unknown) {
94
+ if ((e as any)?.status === 404) {
95
+ this.surfaceWarning(`Failed to find resource ${ resourceType }/${ resourceId }: ${ (e as Error).message }`, e);
96
+
97
+ return null;
98
+ }
99
+
70
100
  this.surfaceError(`Failed to find resource ${ resourceType }/${ resourceId }: ${ (e as Error).message }`, e);
71
101
  }
72
102
  }
@@ -74,18 +104,40 @@ export class ResourcesApiClassImpl implements ResourcesApi {
74
104
  /**
75
105
  * Finds resources using pagination mode with server-side filtering, sorting, and pagination.
76
106
  *
107
+ * The response is not cached
108
+ *
109
+ * Requires `ui-sql-cache` to be enabled.
110
+ *
111
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
112
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
113
+ * @param resourceType - The type of the resources to find (examples in **{@link K8S}**). See also {@link ResourceType}.
114
+ * @param options - Pagination options with server-side filtering and sorting via the Steve API's pagination cache. See {@link FindFilteredPageOptions}.
115
+ * @returns Response containing resource items
116
+ * @throws Error if pagination mode is requested but `ui-sql-cache` is not enabled.
117
+ */
118
+ findFiltered<T = Record<string, any>, I = ActionFindPageTransientResponse<ResourceInstance<T>>>(
119
+ resourceType: ResourceType,
120
+ options: FindFilteredPageOptionsTransient
121
+ ): Promise<I>;
122
+
123
+ /**
124
+ * Finds resources using pagination mode with server-side filtering, sorting, and pagination.
125
+ *
126
+ * The response is cached.
127
+ *
77
128
  * Requires `ui-sql-cache` to be enabled.
78
129
  *
79
- * @template T - The type of the resources (defaults to SteveListResponse)
80
- * @param resourceType - The type of the resources to find
81
- * @param options - Pagination options with server-side filtering and sorting
82
- * @returns Response containing resource items (may be transient if requested, otherwise cached array)
83
- * @throws If pagination mode is requested but `ui-sql-cache` is not enabled
130
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
131
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
132
+ * @param resourceType - The type of the resources to find (examples in **{@link K8S}**). See also {@link ResourceType}.
133
+ * @param options - Pagination options with server-side filtering and sorting via the Steve API's pagination cache. See {@link FindFilteredPageOptions}.
134
+ * @returns Response containing resource items
135
+ * @throws Error if pagination mode is requested but `ui-sql-cache` is not enabled.
84
136
  */
85
- findFiltered<T = SteveListResponse>(
137
+ findFiltered<T = Record<string, any>, I = ResourceInstance<T>>(
86
138
  resourceType: ResourceType,
87
139
  options: FindFilteredPageOptions
88
- ): Promise<FindFilteredPageResponse<T>>;
140
+ ): Promise<I[]>;
89
141
 
90
142
  /**
91
143
  * Finds resources using label selector matching.
@@ -94,23 +146,25 @@ export class ResourcesApiClassImpl implements ResourcesApi {
94
146
  * - If `ui-sql-cache` is enabled: uses server-side pagination
95
147
  * - Otherwise: uses native Kubernetes API pagination
96
148
  *
97
- * @template T - The type of the resources (defaults to SteveListResponse)
98
- * @param resourceType - The type of the resources to find
99
- * @param options - Label selector options for filtering
100
- * @returns Response containing resource items (may be transient if requested, otherwise cached array)
149
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
150
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
151
+ * @param resourceType - The type of the resources to find (examples in **{@link K8S}**). See also {@link ResourceType}.
152
+ * @param options - Label selector options for filtering. See {@link FindFilteredLabelSelectorOptions}.
153
+ * @returns Response containing resource items.
154
+ *
101
155
  */
102
- findFiltered<T = SteveListResponse>(
156
+ findFiltered<T = Record<string, any>, I = FindFilteredLabelSelectorResponse<ResourceInstance<T>>>(
103
157
  resourceType: ResourceType,
104
158
  options: FindFilteredLabelSelectorOptions
105
- ): Promise<FindFilteredLabelSelectorResponse<T>>;
159
+ ): Promise<I>;
106
160
 
107
161
  /**
108
162
  * @internal Implementation - use one of the overloads above
109
163
  */
110
- async findFiltered<T = SteveListResponse>(
164
+ async findFiltered<T = Record<string, any>, I = ResourceInstance<T>>(
111
165
  resourceType: ResourceType,
112
- options: FindFilteredPageOptions | FindFilteredLabelSelectorOptions
113
- ): Promise<FindFilteredPageResponse<T> | FindFilteredLabelSelectorResponse<T>> {
166
+ options: FindFilteredPageOptions | FindFilteredPageOptionsTransient | FindFilteredLabelSelectorOptions
167
+ ): Promise<I[] | ResourceInstance<T>[] | ActionFindPageTransientResponse<ResourceInstance<T>>> {
114
168
  try {
115
169
  if ('pagination' in options) { // pagination mode
116
170
  const canPaginate = this.store.getters[`${ this.storeType }/paginationEnabled`]?.(resourceType);
@@ -125,7 +179,11 @@ export class ResourcesApiClassImpl implements ResourcesApi {
125
179
  opt: safeOption
126
180
  });
127
181
 
128
- return response as FindFilteredPageResponse<T>;
182
+ if (options.transient) {
183
+ return response as ResourceInstance<T>[];
184
+ }
185
+
186
+ return response as FindFilteredPageResponse<ResourceInstance<T>>;
129
187
  } else if ('labelSelector' in options) { // label selector mode
130
188
  const safeOption = options as FindFilteredLabelSelectorOptions;
131
189
  const { labelSelector, namespaced, ...rest } = safeOption;
@@ -138,7 +196,7 @@ export class ResourcesApiClassImpl implements ResourcesApi {
138
196
  opt: rest
139
197
  });
140
198
 
141
- return resources as FindFilteredLabelSelectorResponse<T>;
199
+ return resources as FindFilteredLabelSelectorResponse<ResourceInstance<T>>;
142
200
  } else {
143
201
  return this.surfaceError('findFiltered request was made with unknown options');
144
202
  }
@@ -151,37 +209,168 @@ export class ResourcesApiClassImpl implements ResourcesApi {
151
209
  * Fetches all resources of a specific type with advanced options.
152
210
  * This method provides additional capabilities like incremental loading and namespace filtering.
153
211
  *
154
- * @template T - The type of the resources (defaults to SteveListResponse)
155
- * @param resourceType - The type of the resources to find (use **{@link K8S}** constant). See also {@link ResourceType}.
212
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
213
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
214
+ * @param resourceType - The type of the resources to find (examples in **{@link K8S}**). See also {@link ResourceType}.
156
215
  * @param options - Optional advanced fetch options (incremental loading, namespace filtering, etc.)
157
216
  * @returns An array of resource items or an empty array if none are found.
217
+ */
218
+ async findAll<T = Record<string, any>, I = ResourceInstance<T>>(
219
+ resourceType: ResourceType,
220
+ options?: FindAllMethodOptions
221
+ ): Promise<I[]> {
222
+ try {
223
+ const resources = await this.store.dispatch(`${ this.storeType }/findAll`, {
224
+ type: resourceType,
225
+ opt: options || {}
226
+ });
227
+
228
+ return (resources || []) as I[];
229
+ } catch (e: unknown) {
230
+ this.surfaceError(`Failed to find all resources ${ resourceType }: ${ (e as Error).message }`, e);
231
+ }
232
+ }
233
+
234
+ /**
235
+ * Creates a new resource.
236
+ *
237
+ * The `data` object must include a `type` property identifying the resource type.
238
+ * This is a raw HTTP operation — it does not check permissions or update the store cache.
239
+ *
240
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
241
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
242
+ * @param data - The resource data to create. Must include a `type` property (examples in **{@link K8S}**). See also {@link CreateResourceData}.
243
+ * @returns The created resource instance.
244
+ */
245
+ async create<T = Record<string, any>, I = SteveResource<T>>(
246
+ data: CreateResourceData
247
+ ): Promise<I> {
248
+ try {
249
+ if (!data.type) {
250
+ return this.surfaceError('Resource data must include a "type" property');
251
+ }
252
+
253
+ const url = this.resourceUrl(data.type);
254
+
255
+ const res = await this.store.dispatch(`${ this.storeType }/request`, {
256
+ opt: {
257
+ url,
258
+ method: 'POST',
259
+ headers: { 'content-type': 'application/json' },
260
+ data,
261
+ }
262
+ });
263
+
264
+ return res as I;
265
+ } catch (e: unknown) {
266
+ this.surfaceError(`Failed to create resource of type "${ data.type }": ${ (e as Error).message }`, e);
267
+ }
268
+ }
269
+
270
+ /**
271
+ * Applies a partial update to a resource using HTTP PATCH (merge-patch).
272
+ *
273
+ * Only the fields provided in `data` are sent to the server.
274
+ * This is a raw HTTP operation — it does not check permissions or update the store cache.
275
+ *
276
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
277
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
278
+ * @param resourceType - The type of the resource (examples in **{@link K8S}**). See also {@link ResourceType}.
279
+ * @param resourceId - The unique identifier. If namespaced, use `namespace/name` format.
280
+ * @param data - An object containing only the fields to update.
281
+ * @returns The server response.
282
+ */
283
+ async update<T = Record<string, any>, I = SteveResource<T>>(
284
+ resourceType: ResourceType,
285
+ resourceId: string,
286
+ data: Record<string, any>
287
+ ): Promise<I> {
288
+ try {
289
+ const url = this.resourceUrl(resourceType, resourceId);
290
+ const res = await this.store.dispatch(`${ this.storeType }/request`, {
291
+ opt: {
292
+ url,
293
+ method: 'patch',
294
+ headers: { 'content-type': 'application/strategic-merge-patch+json' },
295
+ data,
296
+ }
297
+ });
298
+
299
+ return res as I;
300
+ } catch (e: unknown) {
301
+ this.surfaceError(`Failed to update resource ${ resourceType }/${ resourceId }: ${ (e as Error).message }`, e);
302
+ }
303
+ }
304
+
305
+ /**
306
+ * Performs a full replacement update of a resource using HTTP PUT.
307
+ *
308
+ * Runs `cleanForSave` on the data before sending.
309
+ * This is a raw HTTP operation — it does not check permissions or update the store cache.
310
+ *
311
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
312
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
313
+ * @param resourceType - The type of the resource (examples in **{@link K8S}**). See also {@link ResourceType}.
314
+ * @param resourceId - The unique identifier. If namespaced, use `namespace/name` format.
315
+ * @param data - The complete resource data to send as the replacement.
316
+ * @returns The server response.
317
+ */
318
+ async replace<T = Record<string, any>, I = SteveResource<T>>(
319
+ resourceType: ResourceType,
320
+ resourceId: string,
321
+ data: Record<string, any>
322
+ ): Promise<I> {
323
+ try {
324
+ const url = this.resourceUrl(resourceType, resourceId);
325
+ const model = await this.store.dispatch(`${ this.storeType }/create`, data);
326
+ const cleanData = model.cleanForSave({ ...data });
327
+ const res = await this.store.dispatch(`${ this.storeType }/request`, {
328
+ opt: {
329
+ url,
330
+ method: 'put',
331
+ headers: { 'content-type': 'application/json' },
332
+ data: cleanData,
333
+ }
334
+ });
335
+
336
+ return res as I;
337
+ } catch (e: unknown) {
338
+ this.surfaceError(`Failed to update resource ${ resourceType }/${ resourceId }: ${ (e as Error).message }`, e);
339
+ }
340
+ }
341
+
342
+ /**
343
+ * Deletes a resource by type and ID using HTTP DELETE.
344
+ *
345
+ * This is a raw HTTP operation — it does not check permissions or update the store cache.
346
+ *
347
+ * @param resourceType - The type of the resource (examples in **{@link K8S}**). See also {@link ResourceType}.
348
+ * @param resourceId - The unique identifier. If namespaced, use `namespace/name` format.
158
349
  *
159
350
  * @example
160
351
  * ```ts
161
352
  * import { useResources, K8S } from '@shell/apis';
162
- * import type { Pod } from '@shell/types/resources';
163
353
  *
164
354
  * const resources = useResources();
165
355
  *
166
- * // Fetch all pods in specific namespaces
167
- * const pods = await resources.cluster.findAll<Pod>(K8S.POD, {
168
- * namespaced: ['default', 'kube-system']
169
- * });
356
+ * await resources.cluster.delete(K8S.CONFIG_MAP, 'default/my-config');
170
357
  * ```
171
358
  */
172
- async findAll<T = SteveListResponse>(
359
+ async delete(
173
360
  resourceType: ResourceType,
174
- options?: FindAllMethodOptions
175
- ): Promise<T[]> {
361
+ resourceId: string
362
+ ): Promise<void> {
176
363
  try {
177
- const resources = await this.store.dispatch(`${ this.storeType }/findAll`, {
178
- type: resourceType,
179
- opt: options || {}
180
- });
364
+ const url = this.resourceUrl(resourceType, resourceId);
181
365
 
182
- return resources as T[];
366
+ await this.store.dispatch(`${ this.storeType }/request`, {
367
+ opt: {
368
+ url,
369
+ method: 'delete',
370
+ }
371
+ });
183
372
  } catch (e: unknown) {
184
- this.surfaceError(`Failed to find all resources ${ resourceType }: ${ (e as Error).message }`, e);
373
+ this.surfaceError(`Failed to delete resource ${ resourceType }/${ resourceId }: ${ (e as Error).message }`, e);
185
374
  }
186
375
  }
187
376
  }
Binary file
@@ -8,7 +8,7 @@ $btn-sm-height: 30px;
8
8
  // -----------------------------------------------------------------------------
9
9
  .btn,
10
10
  button,
11
- [class^='btn-'] {
11
+ [class^='btn-']:not(.btn-group) {
12
12
  align-items: center;
13
13
  display: inline-flex;
14
14
  text-align: center;
@@ -72,6 +72,7 @@ generic:
72
72
  warning: Warning
73
73
  error: Error
74
74
  ok: OK
75
+ or: or
75
76
  other: |-
76
77
  {count, plural,
77
78
  one {other}
@@ -503,6 +504,7 @@ authConfig:
503
504
  allowedPrincipalIds:
504
505
  title: Authorized Users & Groups
505
506
  associatedWarning: 'The {provider} account that is used to enable the external provider will be granted permissions equal to the currently logged in Rancher user. See <a href="{docsBase}/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/authentication-config#external-authentication-configuration-and-principal-users" target="_blank" rel="noopener noreferrer nofollow">External Authentication Configuration and Principal Users</a> to understand why.'
507
+ bannerEnableAuthProvider: "The \"Disable Local Authentication\" setting is enabled. Enabling an Authentication Provider will prevent users from logging in with local credentials. In the event of a Provider failure no user will be able to log in. Ensure you have continued API or CLI access to Rancher to disable the feature and regain access."
506
508
  githubapp:
507
509
  clientId:
508
510
  label: Client ID
@@ -1007,6 +1009,7 @@ asyncButton:
1007
1009
  action: Snapshot Now
1008
1010
  waiting: Snapshot Initiated&hellip;
1009
1011
  success: Snapshot Creating
1012
+ day2OpsNotEnabled: Day 2 Operations are not enabled for this cluster
1010
1013
  timing:
1011
1014
  action: Generate Response Times
1012
1015
  waiting: Generating&hellip;
@@ -1138,9 +1141,15 @@ catalog:
1138
1141
  label: Container Registry
1139
1142
  tooltip: Container images are pulled from the Cluster Container Registry or, failing that, the System Container Registry Setting. To change this default behavior enter or update the registry here
1140
1143
  custom:
1141
- checkBoxLabel: Container Registry for Rancher System Container Images
1144
+ checkBoxLabel: Override the Default Container Registry
1142
1145
  inputLabel: Container Registry
1143
1146
  placeholder: Registry domain and ports, ex. registry.io:5000
1147
+ pullSecret:
1148
+ skipOption: Do not use image pull secrets
1149
+ defaultLabel: 'Use default pull secret ({name})'
1150
+ defaultLabelGeneric: Use default pull secrets
1151
+ existingValuesBanner: '{secrets} are configured as image pull secrets in the chart values. To modify them, edit the values YAML directly.'
1152
+ defaultSecretsBanner: '{secrets} are configured as default pull secrets. Select or create an image pull secret here to override the default.'
1144
1153
  header:
1145
1154
  charts: Charts
1146
1155
  info:
@@ -1358,6 +1367,8 @@ catalog:
1358
1367
  generatedNewImagePullSecret: "A new Image Pull Secret <b>{ imagePullSecretName }</b> will be generated"
1359
1368
  generatedImagePullSecretBannerFromPreviousAuth: "A new Image Pull Secret <b>{ imagePullSecretName }</b> will be generated from the Repository secret <b>{ repoAuthenticationName }</b>."
1360
1369
  usePreviouslyGeneratedImagePullSecretBanner: "Image Pull Secret <b>{ imagePullSecretName }</b> was already created previously from the Repository secret <b>{ repoAuthenticationName }</b> and will be used."
1370
+ oldMonitoringChartWarning: "From v2.15.0 this chart is deprecated, instead please use the new Rancher Monitoring Dashboard chart."
1371
+ newMonitoringChartWarning: "Before installing the new Rancher Monitoring Dashboard chart please make sure any applications using the old Rancher Monitoring Chart have been uninstalled and dependencies such as Prometheus have been installed."
1361
1372
  clusterTplVersion:
1362
1373
  label: Version
1363
1374
  subtext: Select a version of the template
@@ -2164,7 +2175,8 @@ cluster:
2164
2175
  label: Enable IPv6
2165
2176
  httpProtocolIpv6:
2166
2177
  label: Enable IPv6 endpoint for instance metadata service
2167
- ipv6ValidationWarning: When one pool uses an IPv6 or dual-stack subnet/vpc, all pools must use an IPv6 or dual-stack subnet/vpc.
2178
+ dualStackValidationWarning: When one pool enables dual-stack subnet/vpc, all pools must use the same networking configuration.
2179
+ ipv6ValidationWarning: When one pool enables IPv6 subnet/vpc, all pools must use the same networking configuration.
2168
2180
  pnap:
2169
2181
  serverLocation:
2170
2182
  label: Location
@@ -2442,7 +2454,7 @@ cluster:
2442
2454
  aws: Amazon
2443
2455
  azure: Azure
2444
2456
  azureaks: Azure AKS
2445
- aks: Azure AKS
2457
+ aks: AKS
2446
2458
  azurekubernetesservice: Azure AKS (Unsupported Kev1)
2447
2459
  baiducloudcontainerengine: Baidu CCE
2448
2460
  baidu: Baidu CCE
@@ -2451,13 +2463,13 @@ cluster:
2451
2463
  custom: Custom
2452
2464
  digitalocean: DigitalOcean
2453
2465
  docker: Docker
2454
- eks: Amazon EKS
2466
+ eks: EKS
2455
2467
  exoscale: Exoscale
2456
2468
  sks: Exoscale SKS
2457
2469
  gcp: Google
2458
2470
  google: Google GCE
2459
2471
  googlegke: Google GKE
2460
- gke: Google GKE
2472
+ gke: GKE
2461
2473
  googlekubernetesengine: Google GKE (Unsupported Kev1)
2462
2474
  harvester: Harvester
2463
2475
  huaweicce: Huawei CCE
@@ -2680,6 +2692,7 @@ cluster:
2680
2692
  other {A snapshot has been requested for {count} clusters}
2681
2693
  }
2682
2694
  groupLabel: Location
2695
+ predatesImportTooltip: The restore action is not currently supported for this snapshot as it predates the import into Rancher.
2683
2696
  failed: "Snapshot from {time} failed"
2684
2697
  rke1:
2685
2698
  local: local
@@ -2744,6 +2757,7 @@ cluster:
2744
2757
  upgrade: Upgrade Strategy
2745
2758
  registration: Registration
2746
2759
  nodePools: Node Pools
2760
+ operations: Operations
2747
2761
  rotateCertificates:
2748
2762
  label: Rotate Certificates
2749
2763
  modalTitle: Rotate Cluster Certificates
@@ -2984,10 +2998,10 @@ fleet:
2984
2998
  title: Continuous Delivery Settings
2985
2999
  info: Rancher will reboot Fleet agent and controller on settings change.
2986
3000
  apply: Apply changes
2987
- noPermissions: You have no permissions to modify Fleet Settings
3001
+ noPermissions: You have no permissions to modify Continuous Delivery Settings
2988
3002
  parseError: 'Cannot parse values from "{ path }" in "{ id }" ConfigMap'
2989
3003
  fields:
2990
- ariaLabel: Fleet {name} setting
3004
+ ariaLabel: Continuous Delivery {name} setting
2991
3005
  agentTLSMode:
2992
3006
  label: TLS Mode
2993
3007
  description: "Determines whether the agent should trust CA bundles from the operating system's trust store when connecting to a management cluster."
@@ -3064,13 +3078,13 @@ fleet:
3064
3078
  description: 'Agent deployment settings.'
3065
3079
  replicas:
3066
3080
  label: Replicas
3067
- description: 'Number of replicas of Fleet pods.'
3081
+ description: 'Number of replicas of pods.'
3068
3082
  annotations:
3069
3083
  label: Extra Annotations
3070
- description: 'Extra annotations passed to the Fleet pods.'
3084
+ description: 'Extra annotations passed to the pods.'
3071
3085
  developer:
3072
3086
  label: Developer
3073
- description: 'Enable debug info from Fleet.'
3087
+ description: 'Enable debug info.'
3074
3088
 
3075
3089
  tableHeaders:
3076
3090
  applicationType: Type
@@ -3081,7 +3095,7 @@ fleet:
3081
3095
  dashboard:
3082
3096
  pageTitle: Continuous Delivery Dashboard
3083
3097
  menuLabel: Dashboard
3084
- welcome: Welcome to Fleet Continuous Delivery
3098
+ welcome: Welcome to Continuous Delivery
3085
3099
  gitOpsScale: GitOps at scale.
3086
3100
  learnMore: Learn More.
3087
3101
  learnMoreLink: https://fleet.rancher.io
@@ -3204,7 +3218,7 @@ fleet:
3204
3218
  groupBy: Group By Type
3205
3219
  subTypes:
3206
3220
  fleet.cattle.io.gitrepo:
3207
- description: GitRepo describes a git repository that is watched by Fleet. The resource contains the necessary information to deploy the repo, or parts of it, to target clusters.
3221
+ description: GitRepo describes a git repository that is watched. The resource contains the necessary information to deploy the repo, or parts of it, to target clusters.
3208
3222
  fleet.cattle.io.helmop:
3209
3223
  description: HelmOp is a simplified way of creating bundles by directly pointing to a Helm repository or to an OCI registry, without needing to set up a git repository.
3210
3224
  suse-application-collection:
@@ -6025,6 +6039,13 @@ promptRestore:
6025
6039
  fromS3: Restore from S3
6026
6040
  label: Snapshot
6027
6041
  placeholder: Select a snapshot to restore
6042
+ error:
6043
+ unableToResolveTargetCluster: Unable to resolve target cluster for snapshot restore
6044
+ restoreMode:
6045
+ label: Restore Type
6046
+ onlyEtcd: Only etcd
6047
+ kubernetesVersionAndEtcd: Kubernetes version and etcd
6048
+ clusterConfigKubernetesVersionAndEtcd: Cluster config, Kubernetes version and etcd
6028
6049
  notification:
6029
6050
  title: Restore Snapshot
6030
6051
  message: Restoring snapshot { selectedSnapshot } has started...
@@ -6048,7 +6069,9 @@ promptRotateEncryptionKey:
6048
6069
  title: Rotate Encryption Keys
6049
6070
  description: The last backup {name} was performed on {date}
6050
6071
  warning: Before proceeding, ensure a successful ETCD backup of the cluster has been completed.
6051
- error: No backup found
6072
+ error:
6073
+ noBackup: No backup found
6074
+ unableToResolveTargetCluster: Unable to resolve target cluster for encryption key rotation
6052
6075
 
6053
6076
  rancherAlertingDrivers:
6054
6077
  msTeams: Enable Microsoft Teams
@@ -6333,6 +6356,8 @@ resourceYaml:
6333
6356
 
6334
6357
  secret:
6335
6358
  authentication: Authentication
6359
+ githubApp:
6360
+ label: GitHub App
6336
6361
  certificate:
6337
6362
  certificate: Certificate
6338
6363
  certificates: Certificates
@@ -6469,14 +6494,19 @@ selectOrCreateAuthSecret:
6469
6494
  passwordPersonalAccessToken: Password/Personal Access Token
6470
6495
  rke:
6471
6496
  info: "An RKE Auth Config secret contains the username and password concatenated and base64 encoded into the secret's 'auth' key"
6497
+ githubApp:
6498
+ appId: GitHub App ID
6499
+ installationId: GitHub App Installation ID
6500
+ privateKey: GitHub App Private Key
6472
6501
  namespaceGroup: "Namespace: {name}"
6473
6502
  chooseExisting: "Choose an existing secret:"
6474
6503
  createSsh: Create an SSH Key Secret
6475
6504
  createBasic: Create an HTTP Basic Auth Secret
6476
6505
  createS3: Create an S3-Compatible Auth Secret
6477
6506
  createRKE: Create an RKE Auth Config Secret
6507
+ createGithubApp: Create a GitHub App Auth Secret
6478
6508
  createImagePullSecretBasedOnAuth: Create an Image Pull Secret based on Authentication Secret
6479
- createImagePullSecret: Create a new Image Pull Secret with new Username/Password
6509
+ createImagePullSecret: Create an Image Pull Secret with a Username and Password
6480
6510
 
6481
6511
  serviceAccount:
6482
6512
  automount: Automount Service Account Token
@@ -7363,6 +7393,7 @@ validation:
7363
7393
  betweenValues: '"{key}" must be between {min} and {max}'
7364
7394
  noSchema: No schema found to validate
7365
7395
  noType: No type to validate
7396
+ createResourceFailed: 'Failed to create resource: insufficient permissions or resource type not found'
7366
7397
  number:
7367
7398
  requiredInt: '"{key}" must be integer'
7368
7399
  isPositive: '"{key}" must be positive'
@@ -8966,6 +8997,7 @@ advancedSettings:
8966
8997
  'ingress-ip-domain': 'Wildcard DNS domain to use for automatically generated Ingress hostnames. <ingress-name>.<namespace-name>.<ip address of ingress controller> will be added to the domain.'
8967
8998
  'server-url': 'Default {appName} install url. Must be HTTPS. All nodes in your cluster must be able to reach this.'
8968
8999
  'system-default-registry': 'Private registry to be used for all Rancher System Container Images. If no value is specified, the default registry for the container runtime is used. For Docker and containerd, the default is `docker.io`.'
9000
+ 'system-default-registry-pull-secrets': 'List of image pull secrets to authenticate into registry from which Rancher System Container Images are pulled. By default, these secrets will be copied into each Rancher chart namespace. Secrets must be in the `cattle-system` namespace. The first valid secret listed here will be used.'
8969
9001
  'ui-dashboard-index': 'HTML index location for the {appName} UI.'
8970
9002
  'ui-offline-preferred': 'Controls whether UI assets are served locally by the server container or from the remote URL defined in the ui-dashboard-index setting. The `Dynamic` option will use local assets in production builds of {appName}.'
8971
9003
  'ui-pl': 'Private-Label company name.'
@@ -8988,6 +9020,7 @@ advancedSettings:
8988
9020
  'k3s-based-upgrader-uninstall-concurrency': Defines the maximum number of clusters in which Rancher can concurrently uninstall the legacy `rancher-k3s-upgrader` or `rancher-rke2-upgrader` app from imported or node-driver K3s or RKE2 clusters.
8989
9021
  'system-agent-upgrader-install-concurrency': Defines the maximum number of clusters in which Rancher can concurrently install the resources required for upgrading system-agent.
8990
9022
  'imported-cluster-version-management': Enables version management for imported RKE2/K3s clusters, and the local cluster if it is an RKE2/K3s cluster. The per-cluster version management setting overrides this global setting at the cluster level. For existing clusters where the cluster-level version management is set to 'system-default', changing this flag will trigger a redeployment of the cluster agent during the next reconciliation (by default every 5 minutes, or as soon as the cluster is edited, whichever comes first).
9023
+ 'imported-cluster-day2-ops-enabled': Controls whether newly imported RKE2/K3s clusters will have day 2 operations (etcd snapshots, restores, encryption key rotations) enabled by default. This does not affect previously imported clusters.
8991
9024
  warnings:
8992
9025
  'agent-tls-mode': 'Changing this setting will cause all agents to be redeployed.'
8993
9026
  editHelp:
@@ -9015,6 +9048,8 @@ advancedSettings:
9015
9048
  header: Cluster Provisioning
9016
9049
 
9017
9050
  featureFlags:
9051
+ description:
9052
+ 'hide-local-auth-provider': Activating this feature and enabling an Authentication Provider will prevent users from logging in with local credentials. In the event of a Provider failure no user will be able to log in. Ensure you have continued API or CLI access to Rancher to disable the feature and regain access
9018
9053
  label: Feature Flags
9019
9054
  title: "Are you sure?"
9020
9055
  warning: |-