@rancher/shell 0.5.1 → 0.5.3
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.
- package/assets/translations/en-us.yaml +8 -4
- package/components/ClusterIconMenu.vue +24 -9
- package/components/CodeMirror.vue +79 -18
- package/components/FixedBanner.vue +1 -0
- package/components/ResourceDetail/index.vue +1 -4
- package/components/ResourceYaml.vue +29 -5
- package/components/SideNav.vue +42 -64
- package/components/SortableTable/index.vue +1 -1
- package/components/YamlEditor.vue +1 -0
- package/components/__tests__/CodeMirror.spec.ts +99 -0
- package/components/form/BannerSettings.vue +3 -0
- package/components/form/FileSelector.vue +1 -0
- package/components/form/KeyValue.vue +1 -0
- package/components/formatter/WorkloadDetailEndpoints.vue +12 -22
- package/components/formatter/__tests__/WorkloadDetailEndpoints.test.ts +81 -0
- package/components/nav/Header.vue +1 -0
- package/components/nav/Jump.vue +19 -9
- package/components/nav/TopLevelMenu.vue +37 -15
- package/components/nav/Type.vue +15 -4
- package/components/nav/__tests__/TopLevelMenu.test.ts +1 -1
- package/components/nav/__tests__/Type.test.ts +30 -0
- package/core/types-provisioning.ts +7 -0
- package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +77 -0
- package/detail/fleet.cattle.io.bundle.vue +1 -1
- package/detail/provisioning.cattle.io.cluster.vue +19 -4
- package/edit/management.cattle.io.setting.vue +1 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +1 -2
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/index.vue +23 -10
- package/edit/provisioning.cattle.io.cluster/rke2.vue +22 -50
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +9 -11
- package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +3 -1
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +3 -0
- package/edit/token.vue +1 -0
- package/list/catalog.cattle.io.app.vue +1 -0
- package/list/management.cattle.io.setting.vue +1 -0
- package/machine-config/amazonec2.vue +1 -0
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +151 -0
- package/models/__tests__/secret.test.ts +37 -0
- package/models/__tests__/storage.k8s.io.storageclass.test.ts +22 -0
- package/models/management.cattle.io.kontainerdriver.js +2 -1
- package/models/provisioning.cattle.io.cluster.js +36 -1
- package/models/secret.js +9 -0
- package/models/storage.k8s.io.storageclass.js +1 -1
- package/package.json +1 -1
- package/pages/c/_cluster/settings/DefaultLinksEditor.vue +1 -0
- package/pages/c/_cluster/settings/brand.vue +3 -0
- package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +4 -4
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +5 -2
- package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +96 -0
- package/pages/c/_cluster/uiplugins/__tests__/SetupUIPlugins.test.ts +128 -0
- package/plugins/dashboard-store/__tests__/actions.test.ts +196 -111
- package/plugins/dashboard-store/actions.js +4 -6
- package/plugins/dashboard-store/getters.js +60 -2
- package/plugins/dashboard-store/resource-class.js +6 -2
- package/plugins/steve/__tests__/getters.spec.ts +10 -0
- package/plugins/steve/__tests__/resource-utils.test.ts +159 -0
- package/plugins/steve/actions.js +3 -37
- package/plugins/steve/getters.js +6 -0
- package/plugins/steve/resource-utils.ts +38 -0
- package/scripts/extension/parse-tag-name +3 -3
- package/store/__tests__/type-map.test.ts +1122 -0
- package/store/index.js +3 -2
- package/store/plugins.js +7 -6
- package/store/type-map.js +145 -75
- package/types/shell/index.d.ts +2 -0
- package/utils/__tests__/create-yaml.test.ts +10 -0
- package/utils/create-yaml.js +5 -1
- package/utils/object.js +10 -0
package/plugins/steve/actions.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import https from 'https';
|
|
2
2
|
import { addParam, parse as parseUrl, stringify as unParseUrl } from '@shell/utils/url';
|
|
3
3
|
import { handleSpoofedRequest, loadSchemas } from '@shell/plugins/dashboard-store/actions';
|
|
4
|
-
import { set } from '@shell/utils/object';
|
|
4
|
+
import { dropKeys, set } from '@shell/utils/object';
|
|
5
5
|
import { deferred } from '@shell/utils/promise';
|
|
6
6
|
import { streamJson, streamingSupported } from '@shell/utils/stream';
|
|
7
7
|
import isObject from 'lodash/isObject';
|
|
8
8
|
import { classify } from '@shell/plugins/dashboard-store/classify';
|
|
9
9
|
import { NAMESPACE } from '@shell/config/types';
|
|
10
|
-
import jsyaml from 'js-yaml';
|
|
11
10
|
import { handleKubeApiHeaderWarnings } from '@shell/plugins/steve/header-warnings';
|
|
11
|
+
import { steveCleanForDownload } from '@shell/plugins/steve/resource-utils';
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
14
|
|
|
@@ -330,31 +330,7 @@ export default {
|
|
|
330
330
|
|
|
331
331
|
// remove fields added by steve before showing/downloading yamls
|
|
332
332
|
cleanForDownload(ctx, yaml) {
|
|
333
|
-
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
const rootKeys = [
|
|
337
|
-
'id',
|
|
338
|
-
'links',
|
|
339
|
-
'type',
|
|
340
|
-
'actions'
|
|
341
|
-
];
|
|
342
|
-
const metadataKeys = [
|
|
343
|
-
'fields',
|
|
344
|
-
'relationships',
|
|
345
|
-
'state',
|
|
346
|
-
];
|
|
347
|
-
const conditionKeys = [
|
|
348
|
-
'error',
|
|
349
|
-
'transitioning',
|
|
350
|
-
];
|
|
351
|
-
const obj = jsyaml.load(yaml);
|
|
352
|
-
|
|
353
|
-
dropKeys(obj, rootKeys);
|
|
354
|
-
dropKeys(obj?.metadata, metadataKeys);
|
|
355
|
-
(obj?.status?.conditions || []).forEach((condition) => dropKeys(condition, conditionKeys));
|
|
356
|
-
|
|
357
|
-
return jsyaml.dump(obj);
|
|
333
|
+
return steveCleanForDownload(yaml);
|
|
358
334
|
}
|
|
359
335
|
};
|
|
360
336
|
|
|
@@ -398,16 +374,6 @@ function dropUnderscores(obj) {
|
|
|
398
374
|
}
|
|
399
375
|
}
|
|
400
376
|
|
|
401
|
-
function dropKeys(obj, keys) {
|
|
402
|
-
if ( !obj ) {
|
|
403
|
-
return;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
for ( const k of keys ) {
|
|
407
|
-
delete obj[k];
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
|
|
411
377
|
function dropCattleKeys(obj) {
|
|
412
378
|
if ( !obj ) {
|
|
413
379
|
return;
|
package/plugins/steve/getters.js
CHANGED
|
@@ -33,6 +33,12 @@ export default {
|
|
|
33
33
|
const parsedUrl = parse(url);
|
|
34
34
|
const isSteve = steveRegEx.test(parsedUrl.path);
|
|
35
35
|
|
|
36
|
+
// labelSelector
|
|
37
|
+
if ( opt.labelSelector ) {
|
|
38
|
+
url += `${ url.includes('?') ? '&' : '?' }labelSelector=${ opt.labelSelector }`;
|
|
39
|
+
}
|
|
40
|
+
// End: labelSelector
|
|
41
|
+
|
|
36
42
|
// Filter
|
|
37
43
|
if ( opt.filter ) {
|
|
38
44
|
url += `${ (url.includes('?') ? '&' : '?') }`;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { dropKeys } from '@shell/utils/object';
|
|
2
|
+
import jsyaml from 'js-yaml';
|
|
3
|
+
|
|
4
|
+
export function steveCleanForDownload(yaml: string, keys?: {
|
|
5
|
+
rootKeys?: string[],
|
|
6
|
+
metadataKeys?: string[],
|
|
7
|
+
conditionKeys?: string[]
|
|
8
|
+
}): string | undefined {
|
|
9
|
+
if (!yaml) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
rootKeys = [
|
|
15
|
+
'id',
|
|
16
|
+
'links',
|
|
17
|
+
'type',
|
|
18
|
+
'actions'
|
|
19
|
+
],
|
|
20
|
+
metadataKeys = [
|
|
21
|
+
'fields',
|
|
22
|
+
'relationships',
|
|
23
|
+
'state',
|
|
24
|
+
],
|
|
25
|
+
conditionKeys = [
|
|
26
|
+
'error',
|
|
27
|
+
'transitioning',
|
|
28
|
+
]
|
|
29
|
+
} = keys || {};
|
|
30
|
+
|
|
31
|
+
const obj: any = jsyaml.load(yaml);
|
|
32
|
+
|
|
33
|
+
dropKeys(obj, rootKeys);
|
|
34
|
+
dropKeys(obj?.metadata, metadataKeys);
|
|
35
|
+
(obj?.status?.conditions || []).forEach((condition: any) => dropKeys(condition, conditionKeys));
|
|
36
|
+
|
|
37
|
+
return jsyaml.dump(obj);
|
|
38
|
+
}
|
|
@@ -4,8 +4,8 @@ GITHUB_RELEASE_TAG=$1
|
|
|
4
4
|
GITHUB_RUN_ID=$2
|
|
5
5
|
GITHUB_WORKFLOW_TYPE=$3
|
|
6
6
|
|
|
7
|
-
#
|
|
8
|
-
if [[ "${GITHUB_WORKFLOW_TYPE}" == "
|
|
7
|
+
# Ensure "catalog" workflow release tag name does not match a pkg/<pkg-name>
|
|
8
|
+
if [[ "${GITHUB_WORKFLOW_TYPE}" == "catalog" ]]; then
|
|
9
9
|
for d in pkg/*/ ; do
|
|
10
10
|
pkg=$(basename $d)
|
|
11
11
|
|
|
@@ -19,7 +19,7 @@ if [[ "${GITHUB_WORKFLOW_TYPE}" == "charts" ]]; then
|
|
|
19
19
|
fi
|
|
20
20
|
done
|
|
21
21
|
else
|
|
22
|
-
#
|
|
22
|
+
# Ensure "charts" workflow release tag name does not match the root <pkg-name>
|
|
23
23
|
BASE_EXT=$(jq -r .name package.json)
|
|
24
24
|
EXT_VERSION=$(jq -r .version package.json)
|
|
25
25
|
|