@rancher/shell 0.3.3 → 0.3.5
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/styles/app.scss +1 -1
- package/assets/styles/fonts/_fontstack.scss +11 -11
- package/assets/styles/vendor/vue-js-modal.scss +3 -3
- package/assets/translations/en-us.yaml +92 -22
- package/assets/translations/zh-hans.yaml +84 -15
- package/babel.config.js +13 -0
- package/chart/gatekeeper.vue +77 -0
- package/chart/istio.vue +108 -111
- package/chart/logging/index.vue +13 -4
- package/chart/monitoring/index.vue +15 -5
- package/chart/monitoring/steps/uninstall-v1.vue +2 -2
- package/chart/rancher-backup/index.vue +10 -3
- package/cloud-credential/aws.vue +1 -1
- package/cloud-credential/digitalocean.vue +1 -1
- package/cloud-credential/gcp.vue +1 -1
- package/cloud-credential/generic.vue +2 -2
- package/cloud-credential/linode.vue +1 -1
- package/cloud-credential/pnap.vue +1 -1
- package/components/ActionMenu.vue +3 -4
- package/components/AssignTo.vue +1 -1
- package/components/AsyncButton.vue +1 -1
- package/components/BannerGraphic.vue +1 -1
- package/components/ButtonDropdown.vue +2 -3
- package/components/ChartPsp.vue +76 -0
- package/components/CruResource.vue +6 -2
- package/components/DashboardMetrics.vue +12 -10
- package/components/DetailText.vue +1 -1
- package/components/DisableAuthProviderModal.vue +1 -1
- package/components/EmberPage.vue +1 -1
- package/components/EtcdInfoBanner.vue +5 -4
- package/components/ExplorerMembers.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +15 -2
- package/components/FileDiff.vue +6 -7
- package/components/GrafanaDashboard.vue +18 -21
- package/components/LazyImage.vue +10 -12
- package/components/LogItem.vue +1 -1
- package/components/Markdown.vue +1 -1
- package/components/PromptRemove.vue +2 -2
- package/components/PromptRestore.vue +1 -1
- package/components/ResourceDetail/Masthead.vue +16 -0
- package/components/ResourceDetail/index.vue +21 -4
- package/components/ResourceList/index.vue +1 -1
- package/components/ResourceTable.vue +4 -1
- package/components/SingleClusterInfo.vue +2 -2
- package/components/SortableTable/THead.vue +1 -1
- package/components/SortableTable/index.vue +5 -2
- package/components/__tests__/AsyncButton.test.ts +3 -1
- package/components/__tests__/ChartPsp.test.ts +75 -0
- package/components/__tests__/CruResource.test.ts +3 -1
- package/components/auth/Principal.vue +1 -1
- package/components/fleet/FleetBundles.vue +3 -1
- package/components/fleet/FleetClusters.vue +1 -2
- package/components/fleet/FleetIntro.vue +9 -1
- package/components/fleet/FleetNoWorkspaces.vue +62 -0
- package/components/fleet/FleetSummary.vue +7 -1
- package/components/form/LabeledSelect.vue +14 -11
- package/components/form/MatchExpressions.vue +17 -2
- package/components/form/NameNsDescription.vue +31 -45
- package/components/form/ResourceSelector.vue +1 -1
- package/components/form/SecretSelector.vue +5 -1
- package/components/form/ServiceNameSelect.vue +1 -1
- package/components/form/SimpleSecretSelector.vue +9 -9
- package/components/form/__tests__/LabeledSelect.test.ts +138 -0
- package/components/form/__tests__/NameNsDescription.ts +32 -0
- package/components/formatter/InternalExternalIP.vue +6 -0
- package/components/formatter/InvolvedObjectLink.vue +54 -0
- package/components/formatter/Link.vue +20 -4
- package/components/formatter/LinkName.vue +6 -1
- package/components/formatter/ServiceTargets.vue +1 -1
- package/components/nav/Group.vue +2 -2
- package/components/nav/NamespaceFilter.vue +15 -11
- package/components/nav/TopLevelMenu.vue +2 -4
- package/components/nav/Type.vue +1 -1
- package/components/nav/WorkspaceSwitcher.vue +46 -5
- package/config/labels-annotations.js +17 -0
- package/config/product/auth.js +3 -2
- package/config/product/explorer.js +11 -4
- package/config/product/fleet.js +2 -0
- package/config/router.js +414 -0
- package/config/table-headers.js +10 -2
- package/config/types.js +11 -8
- package/config/uiplugins.js +30 -0
- package/content/docs/en-us/whats-new.md +10 -0
- package/content/docs/zh-hans/whats-new.md +11 -1
- package/core/plugin-helpers.js +64 -61
- package/core/plugin-routes.ts +23 -0
- package/creators/app/app.package.json +2 -1
- package/creators/app/files/.eslintrc.js +1 -1
- package/creators/app/files/babel.config.js +1 -18
- package/creators/app/files/vue.config.js +7 -0
- package/creators/app/init +5 -5
- package/creators/pkg/files/.github/workflows/build-extension.yml +111 -0
- package/creators/pkg/init +35 -4
- package/creators/update/init +1 -1
- package/detail/constraints.gatekeeper.sh.constraint.vue +20 -10
- package/detail/fleet.cattle.io.gitrepo.vue +19 -11
- package/detail/harvesterhci.io.management.cluster.vue +3 -3
- package/detail/provisioning.cattle.io.cluster.vue +54 -12
- package/detail/workload/index.vue +3 -3
- package/dialog/AddClusterMemberDialog.vue +1 -1
- package/dialog/AddProjectMemberDialog.vue +2 -2
- package/dialog/AddonConfigConfirmationDialog.vue +27 -15
- package/dialog/DiagnosticTimingsDialog.vue +1 -1
- package/dialog/ForceMachineRemoveDialog.vue +1 -1
- package/dialog/GenericPrompt.vue +18 -6
- package/dialog/RotateEncryptionKeyDialog.vue +1 -1
- package/dialog/SaveAsRKETemplateDialog.vue +1 -1
- package/dialog/ScaleMachineDownDialog.vue +1 -1
- package/edit/auth/github.vue +8 -8
- package/edit/auth/googleoauth.vue +5 -5
- package/edit/auth/ldap/index.vue +1 -1
- package/edit/auth/oidc.vue +1 -1
- package/edit/auth/saml.vue +1 -1
- package/edit/cis.cattle.io.clusterscan.vue +1 -1
- package/edit/fleet.cattle.io.clustergroup.vue +6 -4
- package/edit/fleet.cattle.io.gitrepo.vue +16 -3
- package/edit/helm.cattle.io.projecthelmchart.vue +5 -1
- package/edit/management.cattle.io.fleetworkspace.vue +141 -6
- package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +4 -1
- package/edit/management.cattle.io.setting.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +2 -2
- package/edit/monitoring.coreos.com.receiver/tls.vue +18 -18
- package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +4 -4
- package/edit/monitoring.coreos.com.receiver/types/webhook.vue +1 -1
- package/edit/namespace.vue +2 -2
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +126 -45
- package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +10 -0
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +1 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +202 -2
- package/edit/provisioning.cattle.io.cluster/rke2.vue +248 -84
- package/edit/resources.cattle.io.backup.vue +1 -1
- package/edit/service.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +2 -2
- package/edit/workload/__tests__/Job.test.ts +3 -1
- package/edit/workload/index.vue +8 -3
- package/edit/workload/mixins/workload.js +16 -0
- package/layouts/default.vue +7 -3
- package/list/fleet.cattle.io.bundle.vue +6 -3
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +3 -1
- package/list/fleet.cattle.io.gitrepo.vue +44 -5
- package/list/management.cattle.io.fleetworkspace.vue +45 -0
- package/list/node.vue +69 -16
- package/list/provisioning.cattle.io.cluster.vue +30 -1
- package/machine-config/azure.vue +97 -38
- package/middleware/authenticated.js +34 -0
- package/mixins/chart.js +73 -2
- package/mixins/resource-fetch.js +2 -2
- package/models/apps.statefulset.js +28 -0
- package/models/cluster/node.js +23 -2
- package/models/cluster.x-k8s.io.machine.js +4 -2
- package/models/clusterroletemplatebinding.js +7 -0
- package/models/constraints.gatekeeper.sh.constraint.js +9 -0
- package/models/fleet.cattle.io.cluster.js +19 -10
- package/models/fleet.cattle.io.gitrepo.js +7 -2
- package/models/management.cattle.io.cluster.js +1 -1
- package/models/management.cattle.io.fleetworkspace.js +12 -0
- package/models/management.cattle.io.gitreporestriction.js +5 -0
- package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.js +3 -0
- package/models/namespace.js +5 -5
- package/models/provisioning.cattle.io.cluster.js +7 -5
- package/nuxt/App.js +210 -0
- package/nuxt/axios.js +186 -0
- package/nuxt/client.js +817 -0
- package/nuxt/components/nuxt-build-indicator.vue +143 -0
- package/nuxt/components/nuxt-child.js +122 -0
- package/nuxt/components/nuxt-error.vue +98 -0
- package/nuxt/components/nuxt-link.client.js +98 -0
- package/nuxt/components/nuxt-link.server.js +16 -0
- package/nuxt/components/nuxt-loading.vue +154 -0
- package/nuxt/components/nuxt.js +101 -0
- package/nuxt/cookie-universal-nuxt.js +9 -0
- package/nuxt/empty.js +1 -0
- package/nuxt/index.js +365 -0
- package/nuxt/jsonp.js +82 -0
- package/nuxt/loading.html +39 -0
- package/nuxt/middleware.js +12 -0
- package/nuxt/mixins/fetch.client.js +90 -0
- package/nuxt/mixins/fetch.server.js +69 -0
- package/nuxt/portal-vue.js +4 -0
- package/nuxt/server.js +312 -0
- package/nuxt/store.js +178 -0
- package/nuxt/utils.js +630 -0
- package/nuxt/views/app.template.html +9 -0
- package/nuxt/views/error.html +23 -0
- package/package.json +5 -9
- package/pages/auth/setup.vue +2 -2
- package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +33 -0
- package/pages/c/_cluster/apps/charts/chart.vue +4 -4
- package/pages/c/_cluster/apps/charts/install.helpers.js +26 -0
- package/pages/c/_cluster/apps/charts/install.vue +40 -66
- package/pages/c/_cluster/explorer/EventsTable.vue +5 -19
- package/pages/c/_cluster/explorer/index.vue +29 -25
- package/pages/c/_cluster/explorer/tools/index.vue +8 -8
- package/pages/c/_cluster/fleet/index.vue +95 -34
- package/pages/c/_cluster/gatekeeper/index.vue +1 -1
- package/pages/c/_cluster/istio/index.vue +5 -5
- package/pages/c/_cluster/manager/cloudCredential/index.vue +1 -1
- package/pages/c/_cluster/monitoring/index.vue +7 -0
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +8 -8
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +20 -7
- package/pages/c/_cluster/uiplugins/index.vue +49 -17
- package/pages/home.vue +9 -4
- package/pages/index.vue +10 -1
- package/plugins/clean-html-directive.js +31 -0
- package/plugins/dashboard-store/actions.js +32 -9
- package/plugins/dashboard-store/mutations.js +5 -2
- package/plugins/dashboard-store/resource-class.js +8 -1
- package/plugins/steve/mutations.js +3 -2
- package/plugins/steve/steve-description-class.js +5 -1
- package/plugins/steve/subscribe.js +63 -54
- package/plugins/steve-create-worker.js +14 -0
- package/promptRemove/management.cattle.io.globalrole.vue +2 -2
- package/promptRemove/management.cattle.io.project.vue +2 -2
- package/promptRemove/management.cattle.io.roletemplate.vue +2 -2
- package/promptRemove/pod.vue +1 -1
- package/public/index.html +65 -0
- package/rancher-components/components/Banner/Banner.test.ts +9 -1
- package/rancher-components/components/Banner/Banner.vue +1 -1
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +2 -0
- package/rancher-components/components/Form/Radio/RadioButton.vue +1 -1
- package/scripts/build-pkg.sh +1 -0
- package/scripts/clean +6 -0
- package/scripts/extension/bundle +58 -0
- package/scripts/extension/helmpatch +89 -0
- package/scripts/extension/publish +314 -0
- package/scripts/test-plugins-build.sh +4 -0
- package/store/__tests__/index.test.ts +110 -0
- package/store/index.js +145 -58
- package/store/type-map.js +26 -19
- package/tsconfig.default.json +36 -0
- package/tsconfig.json +24 -0
- package/types/shell/index.d.ts +420 -343
- package/utils/__tests__/string.test.ts +12 -0
- package/utils/auth.js +65 -0
- package/utils/monitoring.js +2 -1
- package/utils/position.js +5 -8
- package/utils/router.scrollBehavior.js +80 -0
- package/utils/select.js +1 -3
- package/utils/socket.js +1 -0
- package/utils/string.js +13 -0
- package/utils/time.js +9 -0
- package/vue.config.js +679 -0
- package/yarn-error.log +196 -0
- package/chart/rancher-alerting-drivers.vue +0 -53
- package/chart/rancher-gatekeeper.vue +0 -37
- package/creators/app/files/nuxt.config.js +0 -6
- package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.ts +0 -4
- package/nuxt.config.js +0 -798
package/core/plugin-helpers.js
CHANGED
|
@@ -94,78 +94,81 @@ function checkExtensionRouteBinding($route, locationConfig) {
|
|
|
94
94
|
export function getApplicableExtensionEnhancements(pluginCtx, actionType, uiArea, currRoute, translationCtx = pluginCtx) {
|
|
95
95
|
const extensionEnhancements = [];
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (
|
|
103
|
-
//
|
|
104
|
-
if (
|
|
105
|
-
actions[i].label = translationCtx.t(action.labelKey);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// ADD ACTION PLUGIN UI ENHANCEMENT
|
|
109
|
-
} else if (actionType === ExtensionPoint.ACTION) {
|
|
110
|
-
// TABLE ACTION
|
|
111
|
-
if (uiArea === ActionLocation.TABLE) {
|
|
97
|
+
// gate it so that we prevent errors on older versions of dashboard
|
|
98
|
+
if (pluginCtx.$plugin?.getUIConfig) {
|
|
99
|
+
const actions = pluginCtx.$plugin.getUIConfig(actionType, uiArea);
|
|
100
|
+
|
|
101
|
+
actions.forEach((action, i) => {
|
|
102
|
+
if (checkExtensionRouteBinding(currRoute, action.locationConfig)) {
|
|
103
|
+
// ADD CARD PLUGIN UI ENHANCEMENT
|
|
104
|
+
if (actionType === ExtensionPoint.CARD) {
|
|
112
105
|
// intercept to apply translation
|
|
113
|
-
if (action.labelKey) {
|
|
106
|
+
if (uiArea === CardLocation.CLUSTER_DASHBOARD_CARD && action.labelKey) {
|
|
114
107
|
actions[i].label = translationCtx.t(action.labelKey);
|
|
115
108
|
}
|
|
116
109
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
110
|
+
// ADD ACTION PLUGIN UI ENHANCEMENT
|
|
111
|
+
} else if (actionType === ExtensionPoint.ACTION) {
|
|
112
|
+
// TABLE ACTION
|
|
113
|
+
if (uiArea === ActionLocation.TABLE) {
|
|
114
|
+
// intercept to apply translation
|
|
115
|
+
if (action.labelKey) {
|
|
116
|
+
actions[i].label = translationCtx.t(action.labelKey);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// sets the enabled flag to true if omitted on the config
|
|
120
|
+
if (!Object.keys(action).includes('enabled')) {
|
|
121
|
+
actions[i].enabled = true;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// bulkable flag
|
|
125
|
+
actions[i].bulkable = actions[i].multiple || actions[i].bulkable;
|
|
126
|
+
|
|
127
|
+
// populate action identifier to prevent errors
|
|
128
|
+
if (!actions[i].action) {
|
|
129
|
+
actions[i].action = `custom-table-action-${ randomStr(10).toLowerCase() }`;
|
|
130
|
+
}
|
|
128
131
|
}
|
|
129
|
-
}
|
|
130
132
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
133
|
+
// extract simplified shortcut definition on plugin - HEADER ACTION
|
|
134
|
+
if (uiArea === ActionLocation.HEADER && action.shortcut) {
|
|
135
|
+
// if it's a string, then assume CTRL for windows and META for mac
|
|
136
|
+
if (typeof action.shortcut === 'string') {
|
|
137
|
+
actions[i].shortcutLabel = () => {
|
|
138
|
+
return isMac ? `(\u2318-${ action.shortcut.toUpperCase() })` : `(Ctrl-${ action.shortcut.toUpperCase() })`;
|
|
139
|
+
};
|
|
140
|
+
actions[i].shortcutKey = { windows: ['ctrl', action.shortcut], mac: ['meta', action.shortcut] };
|
|
141
|
+
// correct check for an Object type in JS... handle the object passed
|
|
142
|
+
} else if (typeof action.shortcut === 'object' && !Array.isArray(action.shortcut) && action.shortcut !== null) {
|
|
143
|
+
actions[i].shortcutKey = action.shortcut;
|
|
144
|
+
const keyboardCombo = isMac ? actions[i].shortcut.mac : actions[i].shortcut.windows ? actions[i].shortcut.windows : [];
|
|
145
|
+
let scLabel = '';
|
|
146
|
+
|
|
147
|
+
keyboardCombo.forEach((key, i) => {
|
|
148
|
+
if (i < keyboardCombo.length - 1) {
|
|
149
|
+
if (key === 'meta') {
|
|
150
|
+
key = '\u2318';
|
|
151
|
+
} else {
|
|
152
|
+
key = ucFirst(key);
|
|
153
|
+
}
|
|
154
|
+
scLabel += `${ key }`;
|
|
155
|
+
scLabel += '-';
|
|
149
156
|
} else {
|
|
150
|
-
|
|
157
|
+
scLabel += `${ key.toUpperCase() }`;
|
|
151
158
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
actions[i].shortcutLabel = () => {
|
|
160
|
-
return `(${ scLabel })`;
|
|
161
|
-
};
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
actions[i].shortcutLabel = () => {
|
|
162
|
+
return `(${ scLabel })`;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
162
165
|
}
|
|
163
166
|
}
|
|
164
|
-
}
|
|
165
167
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
extensionEnhancements.push(actions[i]);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
169
172
|
|
|
170
173
|
return extensionEnhancements;
|
|
171
174
|
}
|
package/core/plugin-routes.ts
CHANGED
|
@@ -89,6 +89,29 @@ export class PluginRoutes {
|
|
|
89
89
|
// Despite what the docs say, routes are not replaced, so we use a workaround
|
|
90
90
|
// Remove all routes that are being replaced
|
|
91
91
|
routes.forEach((r: RouteInfo) => {
|
|
92
|
+
// Patch colliding legacy routes that start /:product
|
|
93
|
+
if (r.route.path?.startsWith('/:product')) {
|
|
94
|
+
// Legacy pattern used by extensions - routes may collide, so modify them not to
|
|
95
|
+
let productName;
|
|
96
|
+
|
|
97
|
+
// If the route has a name (which is always the case for the extensions we have written), use it to get the product name
|
|
98
|
+
if (r.route.name) {
|
|
99
|
+
const nameParts = r.route.name.split('-');
|
|
100
|
+
|
|
101
|
+
// First part of the route name is the product name
|
|
102
|
+
productName = nameParts[0];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Use the plugin name as the product, if the route does not have a name
|
|
106
|
+
productName = productName || plugin.name;
|
|
107
|
+
|
|
108
|
+
// Replace the path - removing :product and using the actual product name instead - this avoids route collisions
|
|
109
|
+
r.route.path = `/${ productName }${ r.route.path.substr(9) }`;
|
|
110
|
+
r.route.meta = r.route.meta || {};
|
|
111
|
+
|
|
112
|
+
r.route.meta.product = r.route.meta.product || productName;
|
|
113
|
+
}
|
|
114
|
+
|
|
92
115
|
// See if the route exists
|
|
93
116
|
let existing: any;
|
|
94
117
|
|
package/creators/app/init
CHANGED
|
@@ -4,14 +4,14 @@ const path = require('path');
|
|
|
4
4
|
const fs = require('fs-extra');
|
|
5
5
|
|
|
6
6
|
const targets = {
|
|
7
|
-
dev: './node_modules/.bin/
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
dev: 'NODE_ENV=dev ./node_modules/.bin/vue-cli-service serve',
|
|
8
|
+
build: './node_modules/.bin/vue-cli-service build',
|
|
9
|
+
clean: './node_modules/@rancher/shell/scripts/clean'
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const files = [
|
|
13
13
|
'tsconfig.json',
|
|
14
|
-
'
|
|
14
|
+
'vue.config.js',
|
|
15
15
|
'.eslintignore',
|
|
16
16
|
'.eslintrc.js',
|
|
17
17
|
'babel.config.js',
|
|
@@ -24,7 +24,7 @@ console.log('Creating Skeleton Application');
|
|
|
24
24
|
const args = process.argv;
|
|
25
25
|
let appFolder = path.resolve('.');
|
|
26
26
|
|
|
27
|
-
if (args.length
|
|
27
|
+
if (args.length === 3) {
|
|
28
28
|
const name = args[2];
|
|
29
29
|
const folder = path.resolve('.');
|
|
30
30
|
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
name: Build and Release Extension
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
env:
|
|
12
|
+
ACTIONS_RUNNER_DEBUG: false
|
|
13
|
+
CI_COMMIT_MESSAGE: CI Build Artifacts
|
|
14
|
+
|
|
15
|
+
defaults:
|
|
16
|
+
run:
|
|
17
|
+
shell: bash
|
|
18
|
+
working-directory: ./
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
build:
|
|
22
|
+
name: Build extension artifact
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
permissions: write-all
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout
|
|
27
|
+
uses: actions/checkout@v3
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 0
|
|
30
|
+
|
|
31
|
+
- name: Configure Git
|
|
32
|
+
run: |
|
|
33
|
+
git config user.name "$GITHUB_ACTOR"
|
|
34
|
+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
35
|
+
|
|
36
|
+
- name: Setup Helm
|
|
37
|
+
uses: azure/setup-helm@v3
|
|
38
|
+
with:
|
|
39
|
+
version: v3.8.0
|
|
40
|
+
|
|
41
|
+
- name: Setup yq
|
|
42
|
+
uses: chrisdickinson/setup-yq@v1.0.1
|
|
43
|
+
with:
|
|
44
|
+
yq-version: v4.28.2
|
|
45
|
+
|
|
46
|
+
- name: Setup Nodejs and npm
|
|
47
|
+
uses: actions/setup-node@v3
|
|
48
|
+
with:
|
|
49
|
+
node-version: '16'
|
|
50
|
+
|
|
51
|
+
- name: Setup yarn
|
|
52
|
+
run: npm install -g yarn
|
|
53
|
+
|
|
54
|
+
- name: Setup Nodejs with yarn caching
|
|
55
|
+
uses: actions/setup-node@v3
|
|
56
|
+
with:
|
|
57
|
+
node-version: '16'
|
|
58
|
+
cache: yarn
|
|
59
|
+
|
|
60
|
+
- name: Install dependencies
|
|
61
|
+
run: yarn
|
|
62
|
+
|
|
63
|
+
- name: Run build script
|
|
64
|
+
shell: bash
|
|
65
|
+
id: build_script
|
|
66
|
+
run: |
|
|
67
|
+
yarn publish-pkgs -s "${{ github.repository }}" -b main
|
|
68
|
+
|
|
69
|
+
- name: Upload charts artifact
|
|
70
|
+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
|
71
|
+
uses: actions/upload-artifact@v3
|
|
72
|
+
with:
|
|
73
|
+
name: charts
|
|
74
|
+
path: tmp
|
|
75
|
+
|
|
76
|
+
release:
|
|
77
|
+
name: Release Build
|
|
78
|
+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
|
79
|
+
needs: build
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
permissions: write-all
|
|
82
|
+
steps:
|
|
83
|
+
- name: Checkout
|
|
84
|
+
uses: actions/checkout@v3
|
|
85
|
+
with:
|
|
86
|
+
fetch-depth: 0
|
|
87
|
+
ref: main
|
|
88
|
+
|
|
89
|
+
- name: Configure Git
|
|
90
|
+
run: |
|
|
91
|
+
git config user.name "$GITHUB_ACTOR"
|
|
92
|
+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
93
|
+
|
|
94
|
+
- name: Download build artifact
|
|
95
|
+
uses: actions/download-artifact@v3
|
|
96
|
+
with:
|
|
97
|
+
name: charts
|
|
98
|
+
|
|
99
|
+
- name: Commit build
|
|
100
|
+
run: |
|
|
101
|
+
git add ./{assets,charts,extensions,index.yaml}
|
|
102
|
+
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}"
|
|
103
|
+
git push
|
|
104
|
+
|
|
105
|
+
- name: Run chart-releaser
|
|
106
|
+
uses: helm/chart-releaser-action@v1.4.1
|
|
107
|
+
with:
|
|
108
|
+
charts_dir: ./charts
|
|
109
|
+
env:
|
|
110
|
+
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
|
111
|
+
CR_SKIP_EXISTING: true
|
package/creators/pkg/init
CHANGED
|
@@ -16,12 +16,13 @@ const files = [
|
|
|
16
16
|
];
|
|
17
17
|
|
|
18
18
|
const topLevelScripts = {
|
|
19
|
-
'build-pkg':
|
|
20
|
-
'serve-pkgs':
|
|
19
|
+
'build-pkg': './node_modules/@rancher/shell/scripts/build-pkg.sh',
|
|
20
|
+
'serve-pkgs': './node_modules/@rancher/shell/scripts/serve-pkgs',
|
|
21
|
+
'publish-pkgs': './node_modules/@rancher/shell/scripts/extension/publish',
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
const typeFolders = [
|
|
24
|
-
'
|
|
25
|
+
'l10n',
|
|
25
26
|
'models',
|
|
26
27
|
'edit',
|
|
27
28
|
'list',
|
|
@@ -42,9 +43,21 @@ const folder = path.resolve('.');
|
|
|
42
43
|
const pkgFolder = path.join(folder, 'pkg', name);
|
|
43
44
|
|
|
44
45
|
let addTypeFolders = false;
|
|
46
|
+
let addWorkflowFolder = false;
|
|
45
47
|
|
|
46
48
|
if (args.length > 3) {
|
|
47
|
-
|
|
49
|
+
for (let i = 3; i < args.length; i++) {
|
|
50
|
+
switch (args[i]) {
|
|
51
|
+
case '-t':
|
|
52
|
+
addTypeFolders = true;
|
|
53
|
+
break;
|
|
54
|
+
case '-w':
|
|
55
|
+
addWorkflowFolder = true;
|
|
56
|
+
break;
|
|
57
|
+
default:
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
48
61
|
}
|
|
49
62
|
|
|
50
63
|
const isNodeModulesShell = !fs.existsSync(path.join(folder, 'shell'));
|
|
@@ -93,6 +106,24 @@ if (addTypeFolders) {
|
|
|
93
106
|
});
|
|
94
107
|
}
|
|
95
108
|
|
|
109
|
+
// Add workflow folder if needed
|
|
110
|
+
if (addWorkflowFolder) {
|
|
111
|
+
const workflowDir = path.join(folder, '.github/workflows');
|
|
112
|
+
|
|
113
|
+
if (!fs.existsSync(workflowDir)) {
|
|
114
|
+
fs.mkdirSync(workflowDir, { recursive: true });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const workflowFile = path.join(workflowDir, 'build-extension.yml');
|
|
118
|
+
|
|
119
|
+
if (!fs.existsSync(workflowFile)) {
|
|
120
|
+
const src = path.join(__dirname, 'files/.github/workflows', 'build-extension.yml');
|
|
121
|
+
|
|
122
|
+
console.log(` Adding file 'build-extension.yml' to root workflows`);
|
|
123
|
+
fs.copySync(src, workflowFile);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
96
127
|
// Copy base files
|
|
97
128
|
files.forEach((file) => {
|
|
98
129
|
const src = path.join(__dirname, 'files', file);
|
package/creators/update/init
CHANGED
|
@@ -38,7 +38,7 @@ Object.keys(latestPackage._pkgs).forEach((key) => {
|
|
|
38
38
|
appPackage.dependencies[key] = latestPackage._pkgs[key];
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
// Add in the
|
|
41
|
+
// Add in the webpack resolution
|
|
42
42
|
appPackage.resolutions = appPackage.resolutions || {};
|
|
43
43
|
appPackage.resolutions['**/webpack'] = '4';
|
|
44
44
|
|
|
@@ -1,38 +1,48 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import CreateEditView from '@shell/mixins/create-edit-view';
|
|
3
3
|
import SortableTable from '@shell/components/SortableTable';
|
|
4
|
+
import Banner from '@components/Banner/Banner.vue';
|
|
4
5
|
import { CONSTRAINT_VIOLATION_RESOURCE_LINK, CONSTRAINT_VIOLATION_MESSAGE, CONSTRAINT_VIOLATION_TYPE } from '@shell/config/table-headers';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
|
-
components: { SortableTable },
|
|
8
|
+
components: { Banner, SortableTable },
|
|
8
9
|
mixins: [CreateEditView],
|
|
9
|
-
data(
|
|
10
|
+
data() {
|
|
10
11
|
return {
|
|
11
12
|
headers: [
|
|
12
13
|
CONSTRAINT_VIOLATION_TYPE,
|
|
13
14
|
CONSTRAINT_VIOLATION_RESOURCE_LINK,
|
|
14
15
|
CONSTRAINT_VIOLATION_MESSAGE
|
|
15
16
|
],
|
|
16
|
-
violations: this.value.violations
|
|
17
|
-
.map((violation, i) => ({ ...violation, id: i }))
|
|
17
|
+
violations: this.value.violations.map((violation, i) => ({ ...violation, id: i }))
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
</script>
|
|
22
22
|
<template>
|
|
23
23
|
<div>
|
|
24
|
-
<div
|
|
25
|
-
v-if="value.spec.enforcementAction"
|
|
26
|
-
class="row mt-
|
|
24
|
+
<div
|
|
25
|
+
v-if="value.spec.enforcementAction"
|
|
26
|
+
class="row mt-20"
|
|
27
27
|
>
|
|
28
28
|
<div class="col span-12">
|
|
29
|
-
<h3>
|
|
29
|
+
<h3>
|
|
30
|
+
{{ t('gatekeeperConstraint.enforcement.action') }}
|
|
31
|
+
</h3>
|
|
30
32
|
{{ value.spec.enforcementAction }}
|
|
31
33
|
</div>
|
|
32
34
|
</div>
|
|
33
|
-
<div class="row mt-
|
|
35
|
+
<div class="row mt-20">
|
|
34
36
|
<div class="col span-12">
|
|
35
|
-
<h3
|
|
37
|
+
<h3 class="mb-20">
|
|
38
|
+
{{ t('gatekeeperConstraint.violations.title', { total: value.totalViolations }) }}
|
|
39
|
+
</h3>
|
|
40
|
+
<Banner
|
|
41
|
+
v-if="value.totalViolations !== value.violations.length"
|
|
42
|
+
color="info"
|
|
43
|
+
>
|
|
44
|
+
{{ t('gatekeeperConstraint.violations.notAll', { shown: value.violations.length }) }}
|
|
45
|
+
</Banner>
|
|
36
46
|
<SortableTable
|
|
37
47
|
:headers="headers"
|
|
38
48
|
:rows="violations"
|
|
@@ -8,7 +8,7 @@ import { FLEET } from '@shell/config/types';
|
|
|
8
8
|
import { isHarvesterCluster } from '@shell/utils/cluster';
|
|
9
9
|
import FleetBundles from '@shell/components/fleet/FleetBundles.vue';
|
|
10
10
|
import { resourceCounts } from '@shell/components/ResourceSummary.vue';
|
|
11
|
-
import {
|
|
11
|
+
import { checkSchemasForFindAllHash } from '@shell/utils/auth';
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
14
|
name: 'DetailGitRepo',
|
|
@@ -74,16 +74,23 @@ export default {
|
|
|
74
74
|
},
|
|
75
75
|
},
|
|
76
76
|
async fetch() {
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
const allDispatches = await checkSchemasForFindAllHash({
|
|
78
|
+
allBundles: {
|
|
79
|
+
inStoreType: 'management',
|
|
80
|
+
type: FLEET.BUNDLE
|
|
81
|
+
},
|
|
82
|
+
allFleet: {
|
|
83
|
+
inStoreType: 'management',
|
|
84
|
+
type: FLEET.CLUSTER
|
|
85
|
+
},
|
|
86
|
+
clusterGroups: {
|
|
87
|
+
inStoreType: 'management',
|
|
88
|
+
type: FLEET.CLUSTER_GROUP
|
|
89
|
+
}
|
|
90
|
+
}, this.$store);
|
|
91
|
+
|
|
92
|
+
this.allBundles = allDispatches.allBundles || [];
|
|
93
|
+
this.allFleet = allDispatches.allFleet || [];
|
|
87
94
|
},
|
|
88
95
|
|
|
89
96
|
};
|
|
@@ -111,6 +118,7 @@ export default {
|
|
|
111
118
|
:need-related="false"
|
|
112
119
|
>
|
|
113
120
|
<Tab
|
|
121
|
+
v-if="!!allBundles.length"
|
|
114
122
|
label="Bundles"
|
|
115
123
|
name="bundles"
|
|
116
124
|
:weight="30"
|
|
@@ -81,17 +81,17 @@ export default {
|
|
|
81
81
|
class="p-10"
|
|
82
82
|
>
|
|
83
83
|
<h4
|
|
84
|
-
v-html="t('cluster.harvester.registration.step1', null, true)"
|
|
84
|
+
v-clean-html="t('cluster.harvester.registration.step1', null, true)"
|
|
85
85
|
/>
|
|
86
86
|
|
|
87
87
|
<h4
|
|
88
|
+
v-clean-html="t('cluster.harvester.registration.step2', null, true)"
|
|
88
89
|
class="mt-10"
|
|
89
|
-
v-html="t('cluster.harvester.registration.step2', null, true)"
|
|
90
90
|
/>
|
|
91
91
|
|
|
92
92
|
<h4
|
|
93
|
+
v-clean-html="t('cluster.harvester.registration.step3', null, true)"
|
|
93
94
|
class="mt-10"
|
|
94
|
-
v-html="t('cluster.harvester.registration.step3', null, true)"
|
|
95
95
|
/>
|
|
96
96
|
<CopyCode class="m-10 p-10">
|
|
97
97
|
{{ registrationURL }}
|