@rancher/shell 0.5.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.DS_Store +0 -0
- package/assets/images/providers/aks-black.svg +28 -0
- package/assets/images/providers/aks.svg +31 -0
- package/assets/styles/global/_labeled-input.scss +1 -0
- package/assets/styles/global/_layout.scss +0 -99
- package/assets/translations/en-us.yaml +76 -74
- package/assets/translations/zh-hans.yaml +25 -23
- package/babel.config.js +1 -7
- package/chart/gatekeeper.vue +11 -2
- package/chart/istio.vue +10 -1
- package/chart/logging/index.vue +11 -2
- package/chart/monitoring/alerting/index.vue +21 -7
- package/chart/monitoring/grafana/index.vue +2 -57
- package/chart/monitoring/index.vue +26 -52
- package/chart/monitoring/prometheus/index.vue +43 -37
- package/chart/rancher-backup/index.vue +10 -3
- package/cloud-credential/azure.vue +17 -4
- package/components/AsyncButton.vue +0 -9
- package/components/Carousel.vue +0 -1
- package/components/ChartPsp.vue +76 -0
- package/components/ClusterIconMenu.vue +9 -24
- package/components/CodeMirror.vue +16 -75
- package/components/CopyCode.vue +2 -6
- package/components/CopyToClipboard.vue +1 -2
- package/components/CopyToClipboardText.vue +9 -14
- package/components/CruResource.vue +0 -1
- package/components/EtcdInfoBanner.vue +5 -5
- package/components/ExplorerProjectsNamespaces.vue +1 -25
- package/components/FixedBanner.vue +0 -1
- package/components/IconOrSvg.vue +1 -1
- package/components/Markdown.vue +12 -16
- package/components/Questions/index.vue +1 -1
- package/components/ResourceDetail/Masthead.vue +9 -25
- package/components/ResourceDetail/index.vue +4 -1
- package/components/ResourceList/Masthead.vue +18 -1
- package/components/ResourceTable.vue +2 -14
- package/components/ResourceYaml.vue +5 -34
- package/components/SideNav.vue +65 -43
- package/components/SortableTable/THead.vue +9 -7
- package/components/SortableTable/index.vue +2 -1
- package/components/StatusTable.vue +1 -5
- package/components/TabTitle.vue +84 -0
- package/components/Tabbed/index.vue +0 -12
- package/components/YamlEditor.vue +0 -1
- package/components/__tests__/ChartPsp.test.ts +75 -0
- package/components/__tests__/CopyCode.test.ts +4 -5
- package/components/fleet/FleetBundles.vue +11 -5
- package/components/fleet/FleetRepos.vue +27 -62
- package/components/fleet/FleetResources.vue +1 -6
- package/components/fleet/FleetStatus.vue +3 -3
- package/components/fleet/FleetSummary.vue +30 -35
- package/components/form/ArrayList.vue +8 -1
- package/components/form/ArrayListSelect.vue +9 -9
- package/components/form/BannerSettings.vue +0 -3
- package/components/form/FileSelector.vue +0 -1
- package/components/form/KeyValue.vue +0 -2
- package/components/form/LabeledSelect.vue +0 -4
- package/components/form/Password.vue +1 -3
- package/components/form/Select.vue +1 -1
- package/components/form/SelectOrCreateAuthSecret.vue +4 -4
- package/components/form/__tests__/KeyValue.test.ts +1 -1
- package/components/formatter/Checked.vue +3 -11
- package/components/formatter/ClusterProvider.vue +18 -1
- package/components/formatter/FleetSummaryGraph.vue +11 -23
- package/components/formatter/LiveDate.vue +16 -0
- package/components/formatter/LiveDuration.vue +1 -1
- package/components/formatter/PercentageBar.vue +1 -1
- package/components/formatter/WorkloadDetailEndpoints.vue +22 -12
- package/components/formatter/__tests__/ClusterProvider.test.ts +28 -0
- package/components/nav/Group.vue +2 -2
- package/components/nav/Header.vue +2 -2
- package/components/nav/Jump.vue +9 -19
- package/components/nav/TopLevelMenu.vue +18 -66
- package/components/nav/Type.vue +7 -16
- package/components/nav/WindowManager/ContainerLogs.vue +19 -120
- package/components/nav/WindowManager/ContainerShell.vue +1 -6
- package/components/nav/WindowManager/index.vue +10 -11
- package/components/nav/__tests__/TopLevelMenu.test.ts +1 -34
- package/components/nav/__tests__/Type.test.ts +1 -31
- package/components/nuxt/nuxt-child.js +78 -14
- package/components/nuxt/nuxt.js +1 -1
- package/components/user.retention/user-retention-header.vue +34 -0
- package/composables/useI18n.ts +26 -0
- package/composables/useStore.ts +16 -0
- package/config/harvester-manager-types.js +0 -2
- package/config/home-links.js +32 -2
- package/config/private-label.js +0 -22
- package/config/product/explorer.js +4 -4
- package/config/product/fleet.js +1 -6
- package/config/product/legacy.js +1 -84
- package/config/product/manager.js +15 -8
- package/config/query-params.js +0 -1
- package/config/router.js +368 -385
- package/config/settings.ts +9 -2
- package/config/store.js +1 -1
- package/config/system-namespaces.js +0 -3
- package/config/table-headers.js +27 -47
- package/config/types.js +5 -0
- package/config/uiplugins.js +1 -1
- package/core/plugin-helpers.js +5 -3
- package/core/plugin-routes.ts +114 -56
- package/core/plugin.ts +10 -16
- package/core/plugins-loader.js +9 -7
- package/core/plugins.js +3 -0
- package/core/types-provisioning.ts +0 -7
- package/creators/app/init +0 -19
- package/detail/fleet.cattle.io.bundle.vue +1 -1
- package/detail/fleet.cattle.io.cluster.vue +1 -11
- package/detail/node.vue +0 -42
- package/detail/pod.vue +1 -68
- package/detail/provisioning.cattle.io.cluster.vue +8 -25
- package/detail/workload/index.vue +1 -15
- package/dialog/ScaleMachineDownDialog.vue +17 -34
- package/edit/auth/googleoauth.vue +5 -1
- package/edit/catalog.cattle.io.clusterrepo.vue +7 -20
- package/edit/cloudcredential.vue +0 -2
- package/edit/fleet.cattle.io.gitrepo.vue +4 -3
- package/edit/management.cattle.io.project.vue +52 -1
- package/edit/management.cattle.io.setting.vue +2 -32
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +2 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +1 -1
- package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +3 -12
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +1 -2
- package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.spec.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/{tabs/Basics.vue → Basics.vue} +125 -106
- package/edit/provisioning.cattle.io.cluster/{tabs/MachinePool.vue → MachinePool.vue} +7 -1
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +7 -15
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +237 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/{CustomCommand.test.ts → CustomCommand.tests.ts} +0 -6
- package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +1 -7
- package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/index.vue +40 -109
- package/edit/provisioning.cattle.io.cluster/rke2.vue +689 -152
- package/edit/service.vue +0 -12
- package/edit/token.vue +0 -1
- package/edit/workload/Upgrading.vue +2 -3
- package/edit/workload/index.vue +1 -2
- package/edit/workload/mixins/workload.js +1 -1
- package/initialize/App.js +71 -25
- package/initialize/client.js +162 -21
- package/initialize/index.js +124 -47
- package/initialize/layouts.ts +26 -0
- package/{components/templates → layouts}/blank.vue +1 -1
- package/{components/templates → layouts}/default.vue +98 -8
- package/{components/templates → layouts}/error.vue +19 -10
- package/{components/templates → layouts}/home.vue +1 -4
- package/{components/templates → layouts}/plain.vue +1 -4
- package/{components/templates → layouts}/standalone.vue +1 -1
- package/{components/templates → layouts}/unauthenticated.vue +1 -1
- package/list/catalog.cattle.io.app.vue +0 -1
- package/list/management.cattle.io.feature.vue +7 -1
- package/list/management.cattle.io.setting.vue +0 -1
- package/list/management.cattle.io.user.vue +25 -1
- package/list/node.vue +0 -1
- package/machine-config/__tests__/vmwarevsphere.test.ts +161 -56
- package/machine-config/azure.vue +37 -21
- package/machine-config/vmwarevsphere.vue +47 -42
- package/middleware/authenticated.js +19 -14
- package/mixins/auth-config.js +7 -2
- package/mixins/brand.js +41 -29
- package/mixins/fetch.server.js +73 -0
- package/mixins/labeled-form-element.ts +1 -6
- package/models/__tests__/management.cattle.io.node.ts +0 -85
- package/models/__tests__/namespace.test.ts +9 -49
- package/models/cluster/node.js +4 -4
- package/models/cluster.x-k8s.io.machine.js +1 -1
- package/models/cluster.x-k8s.io.machinedeployment.js +0 -14
- package/models/fleet.cattle.io.cluster.js +0 -4
- package/models/fleet.cattle.io.gitrepo.js +13 -56
- package/models/management.cattle.io.cluster.js +3 -11
- package/models/management.cattle.io.kontainerdriver.js +0 -1
- package/models/management.cattle.io.node.js +14 -18
- package/models/management.cattle.io.nodepool.js +0 -17
- package/models/management.cattle.io.project.js +36 -0
- package/models/management.cattle.io.setting.js +7 -11
- package/models/management.cattle.io.user.js +65 -0
- package/models/namespace.js +1 -1
- package/models/pod.js +0 -20
- package/models/provisioning.cattle.io.cluster.js +9 -91
- package/models/secret.js +18 -126
- package/models/storage.k8s.io.storageclass.js +1 -1
- package/models/workload.js +0 -16
- package/models/workload.service.js +0 -18
- package/package.json +10 -12
- package/pages/about.vue +1 -0
- package/pages/account/create-key.vue +1 -0
- package/pages/account/index.vue +1 -0
- package/pages/auth/login.vue +1 -0
- package/pages/auth/logout.vue +2 -0
- package/pages/auth/setup.vue +4 -37
- package/pages/auth/verify.vue +8 -14
- package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +17 -2
- package/pages/c/_cluster/apps/charts/index.vue +58 -64
- package/pages/c/_cluster/apps/charts/install.helpers.js +13 -2
- package/pages/c/_cluster/apps/charts/install.vue +5 -5
- package/pages/c/_cluster/apps/index.vue +2 -0
- package/pages/c/_cluster/auth/index.vue +2 -0
- package/pages/c/_cluster/auth/user.retention/index.vue +384 -0
- package/pages/c/_cluster/ecm/index.vue +2 -0
- package/pages/c/_cluster/explorer/index.vue +53 -56
- package/pages/c/_cluster/explorer/tools/index.vue +3 -171
- package/pages/c/_cluster/fleet/index.vue +1 -1
- package/pages/c/_cluster/index.vue +2 -0
- package/pages/c/_cluster/manager/pages/_page.vue +5 -4
- package/pages/c/_cluster/monitoring/index.vue +1 -17
- package/pages/c/_cluster/settings/DefaultLinksEditor.vue +1 -1
- package/pages/c/_cluster/settings/banners.vue +2 -0
- package/pages/c/_cluster/settings/brand.vue +2 -3
- package/pages/c/_cluster/settings/index.vue +2 -0
- package/pages/c/_cluster/settings/links.vue +3 -2
- package/pages/c/_cluster/settings/performance.vue +1 -0
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +1 -2
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +46 -10
- package/pages/c/_cluster/uiplugins/index.vue +2 -0
- package/pages/c/index.vue +9 -0
- package/pages/diagnostic.vue +2 -1
- package/pages/fail-whale.vue +1 -0
- package/pages/prefs.vue +1 -0
- package/pages/rio/mesh.vue +508 -0
- package/pages/support/index.vue +8 -2
- package/pkg/auto-import.js +1 -1
- package/plugins/axios.js +36 -0
- package/plugins/back-button.js +5 -3
- package/plugins/clean-html-directive.js +19 -1
- package/plugins/clean-tooltip-directive.js +1 -1
- package/plugins/codemirror-loader.js +1 -1
- package/plugins/codemirror.js +0 -41
- package/plugins/dashboard-store/__tests__/{mutations.test.ts → mutations.spec.ts} +1 -1
- package/plugins/dashboard-store/actions.js +17 -16
- package/plugins/dashboard-store/classify.js +18 -1
- package/plugins/dashboard-store/getters.js +7 -70
- package/plugins/dashboard-store/index.js +12 -0
- package/plugins/dashboard-store/mutations.js +4 -0
- package/plugins/dashboard-store/resource-class.js +20 -65
- package/plugins/i18n.js +1 -1
- package/plugins/steve/__tests__/getters.spec.ts +48 -26
- package/plugins/steve/__tests__/subscribe.spec.ts +106 -0
- package/plugins/steve/actions.js +37 -3
- package/plugins/steve/getters.js +24 -7
- package/plugins/steve/mutations.js +5 -2
- package/plugins/steve/norman-class.js +0 -19
- package/plugins/steve/steve-class.js +0 -22
- package/plugins/steve/subscribe.js +34 -13
- package/plugins/transitions.js +4 -0
- package/plugins/vue-clipboard2.js +4 -0
- package/rancher-components/Accordion/Accordion.vue +3 -2
- package/rancher-components/BadgeState/BadgeState.vue +3 -3
- package/rancher-components/Banner/Banner.test.ts +1 -5
- package/rancher-components/Banner/Banner.vue +2 -2
- package/rancher-components/Card/Card.vue +4 -4
- package/rancher-components/Form/Checkbox/Checkbox.vue +4 -3
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +1 -1
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +55 -24
- package/rancher-components/Form/Radio/RadioButton.test.ts +1 -3
- package/rancher-components/Form/Radio/RadioButton.vue +13 -7
- package/rancher-components/Form/Radio/RadioGroup.vue +4 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -5
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +7 -4
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +9 -4
- package/rancher-components/StringList/StringList.vue +8 -8
- package/rancher-components/components/Accordion/Accordion.vue +3 -2
- package/rancher-components/components/BadgeState/BadgeState.test.ts +12 -0
- package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +2 -19
- package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +14 -11
- package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +1 -1
- package/rancher-components/components/StringList/StringList.test.ts +0 -270
- package/rancher-components/components/StringList/StringList.vue +18 -57
- package/scripts/extension/bundle +7 -19
- package/scripts/extension/helm/scripts/package +3 -11
- package/scripts/extension/parse-tag-name +4 -4
- package/scripts/extension/publish +9 -20
- package/scripts/publish-shell.sh +1 -11
- package/scripts/test-plugins-build.sh +9 -85
- package/store/catalog.js +1 -1
- package/store/features.js +0 -1
- package/store/i18n.js +0 -11
- package/store/index.js +13 -11
- package/store/prefs.js +38 -33
- package/store/type-map.js +82 -157
- package/tsconfig.default.json +46 -0
- package/tsconfig.json +9 -35
- package/types/shell/index.d.ts +404 -465
- package/utils/axios.js +19 -0
- package/utils/create-yaml.js +1 -5
- package/utils/custom-validators.js +2 -0
- package/utils/error.js +1 -16
- package/utils/monitoring.js +2 -37
- package/utils/nuxt.js +39 -18
- package/utils/object.js +0 -24
- package/utils/router.scrollBehavior.js +14 -12
- package/utils/socket.js +1 -0
- package/utils/time.js +1 -1
- package/utils/title.ts +3 -0
- package/utils/url.ts +1 -1
- package/utils/validators/formRules/__tests__/index.test.ts +4 -49
- package/utils/validators/formRules/index.ts +9 -12
- package/utils/validators/setting.js +10 -6
- package/vue.config.js +3 -24
- package/chart/monitoring/steps/uninstall-v1.vue +0 -135
- package/components/Certificates.vue +0 -164
- package/components/__tests__/CodeMirror.spec.ts +0 -99
- package/components/fleet/__tests__/FleetSummary.test.ts +0 -316
- package/components/formatter/FleetClusterSummaryGraph.vue +0 -27
- package/components/formatter/__tests__/Checked.test.ts +0 -19
- package/components/formatter/__tests__/WorkloadDetailEndpoints.test.ts +0 -81
- package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +0 -186
- package/composables/useCompactInput.ts +0 -20
- package/composables/useLabeledFormElement.ts +0 -138
- package/creators/app/files/.gitlab-ci.yml +0 -14
- package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +0 -77
- package/edit/__tests__/service.test.ts +0 -89
- package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +0 -112
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +0 -473
- package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +0 -73
- package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +0 -386
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +0 -137
- package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +0 -157
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +0 -135
- package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +0 -189
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +0 -147
- package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +0 -76
- package/mixins/v1-workload-metrics.js +0 -43
- package/models/__tests__/management.cattle.io.cluster.test.ts +0 -23
- package/models/__tests__/management.cattle.io.nodepool.ts +0 -83
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +0 -241
- package/models/__tests__/secret.test.ts +0 -37
- package/models/__tests__/storage.k8s.io.storageclass.test.ts +0 -22
- package/models/__tests__/workload.test.ts +0 -91
- package/plugins/clean-html.js +0 -53
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +0 -49
- package/plugins/dashboard-store/__tests__/utils/store-mocks.ts +0 -7
- package/plugins/index.js +0 -11
- package/plugins/steve/__tests__/resource-utils.test.ts +0 -159
- package/plugins/steve/__tests__/steve-class.spec.ts +0 -59
- package/plugins/steve/__tests__/utils/steve-mocks.ts +0 -31
- package/plugins/steve/resource-utils.ts +0 -38
- package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +0 -50
- package/server/har-file.js +0 -183
- package/store/__tests__/type-map.test.ts +0 -1122
- package/tsconfig.paths.json +0 -18
- package/utils/azure.js +0 -24
- package/utils/clipboard.js +0 -5
- /package/components/form/__tests__/{NameNsDescription.test.ts → NameNsDescription.ts} +0 -0
- /package/edit/networking.k8s.io.networkpolicy/__tests__/utils/{selectors.test.ts → selectors.ts} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/networking/ACE.vue → ACE.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/AgentConfiguration.vue → AgentConfiguration.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/upgrade/DrainOptions.vue → DrainOptions.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/MemberRoles.vue → MemberRoles.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryConfigs.vue → RegistryConfigs.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryMirrors.vue → RegistryMirrors.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/etcd/S3Config.vue → S3Config.vue} +0 -0
- /package/plugins/dashboard-store/__tests__/{actions.test.ts → actions.spec.ts} +0 -0
- /package/plugins/dashboard-store/__tests__/{getters.test.ts → getters.spec.ts} +0 -0
- /package/rancher-components/BadgeState/{BadgeState.spec.ts → BadgeState.test.ts} +0 -0
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<script>
|
|
3
|
-
import { haveV1Monitoring, haveV1MonitoringWorkloads } from '@shell/utils/monitoring';
|
|
4
|
-
import AsyncButton from '@shell/components/AsyncButton';
|
|
5
|
-
import IconMessage from '@shell/components/IconMessage';
|
|
6
|
-
|
|
7
|
-
function delay(t, v) {
|
|
8
|
-
return new Promise((resolve) => {
|
|
9
|
-
setTimeout(resolve.bind(null, v), t);
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
|
|
15
|
-
label: 'monitoring.installSteps.uninstallV1.stepTitle',
|
|
16
|
-
subtext: 'monitoring.installSteps.uninstallV1.stepSubtext',
|
|
17
|
-
weight: 100,
|
|
18
|
-
|
|
19
|
-
components: {
|
|
20
|
-
AsyncButton,
|
|
21
|
-
IconMessage
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
data() {
|
|
25
|
-
return {
|
|
26
|
-
haveV1Monitoring: false,
|
|
27
|
-
error: null,
|
|
28
|
-
};
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
mounted() {
|
|
32
|
-
this.haveV1Monitoring = haveV1Monitoring(this.$store.getters);
|
|
33
|
-
this.$emit('update', {
|
|
34
|
-
loading: false,
|
|
35
|
-
ready: false,
|
|
36
|
-
hidden: !this.haveV1Monitoring,
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
methods: {
|
|
41
|
-
uninstall(buttonCb) {
|
|
42
|
-
this.$store.dispatch('cluster/promptModal', {
|
|
43
|
-
component: 'GenericPrompt',
|
|
44
|
-
componentProps: {
|
|
45
|
-
applyMode: 'uninstall',
|
|
46
|
-
applyAction: async(buttonDone) => {
|
|
47
|
-
await this.$store.getters['currentCluster'].doAction('disableMonitoring');
|
|
48
|
-
|
|
49
|
-
for (let index = 0; index < 30; index++) {
|
|
50
|
-
// Wait 30 seconds for the containers to go
|
|
51
|
-
const hasV1Monitoring = haveV1Monitoring(this.$store.getters);
|
|
52
|
-
const hasV1MonitoringWorkloads = await haveV1MonitoringWorkloads(this.$store);
|
|
53
|
-
|
|
54
|
-
if ((!hasV1Monitoring && !hasV1MonitoringWorkloads)) {
|
|
55
|
-
this.$emit('update', { ready: true, hidden: true });
|
|
56
|
-
this.haveV1Monitoring = false;
|
|
57
|
-
|
|
58
|
-
buttonDone(true);
|
|
59
|
-
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
await delay(1000);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
throw new Error(`Failed to uninstall: timed out`);
|
|
66
|
-
},
|
|
67
|
-
title: this.t('promptRemove.title', {}, true),
|
|
68
|
-
body: this.t('monitoring.installSteps.uninstallV1.promptDescription', {}, true),
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
buttonCb(true);
|
|
72
|
-
},
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
</script>
|
|
77
|
-
<template>
|
|
78
|
-
<div class="v1-monitoring">
|
|
79
|
-
<template v-if="haveV1Monitoring">
|
|
80
|
-
<IconMessage
|
|
81
|
-
class="mt-40 mb-20"
|
|
82
|
-
icon="icon-warning"
|
|
83
|
-
:vertical="true"
|
|
84
|
-
icon-state="warning"
|
|
85
|
-
>
|
|
86
|
-
<template #message>
|
|
87
|
-
<p>
|
|
88
|
-
{{ t('monitoring.installSteps.uninstallV1.warning1') }}
|
|
89
|
-
</p>
|
|
90
|
-
<p
|
|
91
|
-
v-clean-html="t('monitoring.installSteps.uninstallV1.warning2', {}, true)"
|
|
92
|
-
class="mt-10"
|
|
93
|
-
/>
|
|
94
|
-
</template>
|
|
95
|
-
</IconMessage>
|
|
96
|
-
<AsyncButton
|
|
97
|
-
mode="uninstall"
|
|
98
|
-
:delay="0"
|
|
99
|
-
@click="uninstall"
|
|
100
|
-
/>
|
|
101
|
-
</template>
|
|
102
|
-
<IconMessage
|
|
103
|
-
v-else
|
|
104
|
-
class="mt-40"
|
|
105
|
-
icon="icon-checkmark"
|
|
106
|
-
:vertical="true"
|
|
107
|
-
icon-state="success"
|
|
108
|
-
>
|
|
109
|
-
<template #message>
|
|
110
|
-
<p class="">
|
|
111
|
-
{{ t('monitoring.installSteps.uninstallV1.success1') }}
|
|
112
|
-
</p>
|
|
113
|
-
<p
|
|
114
|
-
v-clean-html="t('monitoring.installSteps.uninstallV1.success2')"
|
|
115
|
-
class="mt-10"
|
|
116
|
-
/>
|
|
117
|
-
</template>
|
|
118
|
-
</IconMessage>
|
|
119
|
-
</div>
|
|
120
|
-
</template>
|
|
121
|
-
|
|
122
|
-
<style lang='scss' scoped>
|
|
123
|
-
.v1-monitoring {
|
|
124
|
-
display: flex;
|
|
125
|
-
flex-direction: column;
|
|
126
|
-
align-items: center;
|
|
127
|
-
width: 100%;
|
|
128
|
-
p {
|
|
129
|
-
max-width: 900px;
|
|
130
|
-
}
|
|
131
|
-
.btn {
|
|
132
|
-
min-width: 200px;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
</style>
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Vue from 'vue';
|
|
3
|
-
import { mapGetters } from 'vuex';
|
|
4
|
-
import ResourceTable from '@shell/components/ResourceTable';
|
|
5
|
-
import { SECRET } from '@shell/config/types';
|
|
6
|
-
import { NAME as NAME_COL, NAMESPACE as NAMESPACE_COL, AGE, STATE } from '@shell/config/table-headers';
|
|
7
|
-
import Secret, { TYPES } from '@shell/models/secret';
|
|
8
|
-
import { Banner } from '@components/Banner';
|
|
9
|
-
import { STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
|
|
10
|
-
import { BadgeState } from '@components/BadgeState';
|
|
11
|
-
|
|
12
|
-
interface Data {
|
|
13
|
-
schema: Object,
|
|
14
|
-
headers: Object[],
|
|
15
|
-
certs: Secret[],
|
|
16
|
-
pagingParams: {
|
|
17
|
-
pluralLabel: string,
|
|
18
|
-
singularLabel: string
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default Vue.extend<Data, any, any, any>({
|
|
23
|
-
components: {
|
|
24
|
-
ResourceTable, Banner, BadgeState
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
async fetch() {
|
|
28
|
-
// We're fetching secrets with a filter, this will clash with secrets in other contexts
|
|
29
|
-
this.$store.dispatch('cluster/forgetType', SECRET);
|
|
30
|
-
|
|
31
|
-
this.certs = await this.$store.dispatch('cluster/findAll', {
|
|
32
|
-
type: SECRET,
|
|
33
|
-
opt: {
|
|
34
|
-
watch: false,
|
|
35
|
-
// Note - urlOptions handles filter in a weird way
|
|
36
|
-
filter: { 'metadata.fields.1': TYPES.TLS }
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
data(): Data {
|
|
42
|
-
return {
|
|
43
|
-
schema: this.$store.getters['cluster/schemaFor'](SECRET),
|
|
44
|
-
headers: [
|
|
45
|
-
{
|
|
46
|
-
...STATE,
|
|
47
|
-
formatter: null,
|
|
48
|
-
name: 'certState',
|
|
49
|
-
sort: ['certState', 'nameSort'],
|
|
50
|
-
value: 'certState',
|
|
51
|
-
},
|
|
52
|
-
NAME_COL,
|
|
53
|
-
NAMESPACE_COL,
|
|
54
|
-
{
|
|
55
|
-
name: 'cn',
|
|
56
|
-
labelKey: 'secret.certificate.cn',
|
|
57
|
-
value: (row: Secret) => {
|
|
58
|
-
if (!row.cn) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return row.cn + (row.unrepeatedSans.length ? ` ${ this.t('secret.certificate.plusMore', { n: row.unrepeatedSans.length }) }` : '');
|
|
63
|
-
},
|
|
64
|
-
sort: ['cn'],
|
|
65
|
-
search: ['cn'],
|
|
66
|
-
}, {
|
|
67
|
-
name: 'cert-expires2',
|
|
68
|
-
labelKey: 'secret.certificate.expiresDuration',
|
|
69
|
-
value: (row: Secret) => row.timeTilExpirationDate,
|
|
70
|
-
formatter: 'LiveDate',
|
|
71
|
-
sort: ['timeTilExpiration'],
|
|
72
|
-
search: ['timeTilExpiration'],
|
|
73
|
-
defaultSort: true,
|
|
74
|
-
width: 100
|
|
75
|
-
}, {
|
|
76
|
-
name: 'cert-expires',
|
|
77
|
-
labelKey: 'secret.certificate.expiresOn',
|
|
78
|
-
value: 'cachedCertInfo.notAfter',
|
|
79
|
-
formatter: 'Date',
|
|
80
|
-
sort: ['cachedCertInfo.notAfter'],
|
|
81
|
-
search: ['cachedCertInfo.notAfter'],
|
|
82
|
-
}, {
|
|
83
|
-
name: 'cert-lifetime',
|
|
84
|
-
labelKey: 'secret.certificate.lifetime',
|
|
85
|
-
value: (row: Secret) => row.certLifetime,
|
|
86
|
-
sort: ['certLifetime'],
|
|
87
|
-
search: ['certLifetime'],
|
|
88
|
-
},
|
|
89
|
-
AGE
|
|
90
|
-
],
|
|
91
|
-
certs: [],
|
|
92
|
-
pagingParams: {
|
|
93
|
-
pluralLabel: this.t('secret.certificate.certificates'),
|
|
94
|
-
singularLabel: this.t('secret.certificate.certificate')
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
computed: {
|
|
100
|
-
...mapGetters(['isAllNamespaces']),
|
|
101
|
-
|
|
102
|
-
expiredData() {
|
|
103
|
-
let expiring = 0;
|
|
104
|
-
let expired = 0;
|
|
105
|
-
|
|
106
|
-
for (let i = 0; i < this.certs.length; i++) {
|
|
107
|
-
const cert = this.certs[i];
|
|
108
|
-
|
|
109
|
-
if (cert.certState === STATES_ENUM.EXPIRING) {
|
|
110
|
-
expiring++;
|
|
111
|
-
}
|
|
112
|
-
if (cert.certState === STATES_ENUM.EXPIRED) {
|
|
113
|
-
expired++;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const filterWarning = !this.isAllNamespaces ? this.t('secret.certificate.warnings.filtered') : '';
|
|
118
|
-
|
|
119
|
-
return {
|
|
120
|
-
expiring: expiring ? this.t('secret.certificate.warnings.expiring', { count: expiring, filtered: !this.isAllNamespaces }) + filterWarning : '',
|
|
121
|
-
expired: expired ? this.t('secret.certificate.warnings.expired', { count: expired, filtered: !this.isAllNamespaces }) + filterWarning : '',
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
beforeDestroy() {
|
|
127
|
-
// We're fetching secrets with a filter, clear it so as to not clash with other contexts
|
|
128
|
-
this.$store.dispatch('cluster/forgetType', SECRET);
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
});
|
|
132
|
-
</script>
|
|
133
|
-
|
|
134
|
-
<template>
|
|
135
|
-
<div>
|
|
136
|
-
<Banner
|
|
137
|
-
v-if="expiredData.expiring"
|
|
138
|
-
color="warning"
|
|
139
|
-
:label="expiredData.expiring"
|
|
140
|
-
/>
|
|
141
|
-
<Banner
|
|
142
|
-
v-if="expiredData.expired"
|
|
143
|
-
color="error"
|
|
144
|
-
:label="expiredData.expired"
|
|
145
|
-
/>
|
|
146
|
-
<ResourceTable
|
|
147
|
-
:loading="$fetchState.pending"
|
|
148
|
-
:schema="schema"
|
|
149
|
-
:headers="headers"
|
|
150
|
-
:rows="certs"
|
|
151
|
-
:paging-label="'secret.certificate.paging'"
|
|
152
|
-
:paging-params="pagingParams"
|
|
153
|
-
>
|
|
154
|
-
<template #col:certState="{row}">
|
|
155
|
-
<td>
|
|
156
|
-
<BadgeState
|
|
157
|
-
:color="row.certStateBackground"
|
|
158
|
-
:label="row.certStateDisplay"
|
|
159
|
-
/>
|
|
160
|
-
</td>
|
|
161
|
-
</template>
|
|
162
|
-
</ResourceTable>
|
|
163
|
-
</div>
|
|
164
|
-
</template>
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { shallowMount, Wrapper } from '@vue/test-utils';
|
|
2
|
-
import CodeMirror from '@shell/components/CodeMirror.vue';
|
|
3
|
-
import { _EDIT, _YAML } from '@shell/config/query-params';
|
|
4
|
-
|
|
5
|
-
describe('component: CodeMirror.vue', () => {
|
|
6
|
-
let wrapper: Wrapper<InstanceType<typeof CodeMirror>>;
|
|
7
|
-
|
|
8
|
-
const options = {
|
|
9
|
-
readOnly: false,
|
|
10
|
-
gutters: [
|
|
11
|
-
'CodeMirror-lint-markers',
|
|
12
|
-
'CodeMirror-foldgutter'
|
|
13
|
-
],
|
|
14
|
-
mode: 'yaml',
|
|
15
|
-
lint: true,
|
|
16
|
-
lineNumbers: true,
|
|
17
|
-
styleActiveLine: true,
|
|
18
|
-
tabSize: 2,
|
|
19
|
-
indentWithTabs: false,
|
|
20
|
-
cursorBlinkRate: 530,
|
|
21
|
-
extraKeys: { 'Ctrl-Space': 'autocomplete' }
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const mountOptions = {
|
|
25
|
-
propsData: {
|
|
26
|
-
value: '',
|
|
27
|
-
mode: _EDIT,
|
|
28
|
-
options,
|
|
29
|
-
asTextArea: false,
|
|
30
|
-
showKeyMapBox: true,
|
|
31
|
-
},
|
|
32
|
-
mocks: {
|
|
33
|
-
$store: {
|
|
34
|
-
getters: {
|
|
35
|
-
currentStore: () => 'current_store',
|
|
36
|
-
'current_store/schemaFor': jest.fn(),
|
|
37
|
-
'current_store/all': jest.fn(),
|
|
38
|
-
'i18n/t': () => 'Vim',
|
|
39
|
-
'prefs/get': () => 'Vim',
|
|
40
|
-
'prefs/theme': jest.fn(),
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
$route: { query: { AS: _YAML } },
|
|
44
|
-
$router: { applyQuery: jest.fn() },
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
describe('keyMap info', () => {
|
|
49
|
-
(window as any).__codeMirrorLoader = () => new Promise((resolve) => {
|
|
50
|
-
resolve(true);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
wrapper = shallowMount(
|
|
54
|
-
CodeMirror,
|
|
55
|
-
mountOptions,
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
it(`should show keyMap preference`, async() => {
|
|
59
|
-
await wrapper.vm.$nextTick();
|
|
60
|
-
|
|
61
|
-
const keyMapBox = wrapper.find('[data-testid="code-mirror-keymap"]');
|
|
62
|
-
const closeIcon = keyMapBox.find('.icon');
|
|
63
|
-
|
|
64
|
-
expect(keyMapBox.element.textContent).toContain('Vim');
|
|
65
|
-
expect(closeIcon.element).toBeUndefined();
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it(`should show keyMap close icon on mouse over`, async() => {
|
|
69
|
-
await wrapper.vm.$nextTick();
|
|
70
|
-
|
|
71
|
-
const keyMapBox = wrapper.find('[data-testid="code-mirror-keymap"]');
|
|
72
|
-
|
|
73
|
-
keyMapBox.trigger('mouseover');
|
|
74
|
-
await wrapper.vm.$nextTick();
|
|
75
|
-
|
|
76
|
-
const closeIcon = keyMapBox.find('.icon');
|
|
77
|
-
|
|
78
|
-
expect(closeIcon.element).toBeDefined();
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it(`should remove keyMap box`, async() => {
|
|
82
|
-
await wrapper.vm.$nextTick();
|
|
83
|
-
|
|
84
|
-
let keyMapBox = wrapper.find('[data-testid="code-mirror-keymap"]');
|
|
85
|
-
|
|
86
|
-
keyMapBox.trigger('mouseover');
|
|
87
|
-
await wrapper.vm.$nextTick();
|
|
88
|
-
|
|
89
|
-
const closeIcon = keyMapBox.find('.icon');
|
|
90
|
-
|
|
91
|
-
closeIcon.element.click();
|
|
92
|
-
await wrapper.vm.$nextTick();
|
|
93
|
-
|
|
94
|
-
keyMapBox = wrapper.find('[data-testid="code-mirror-keymap"]');
|
|
95
|
-
|
|
96
|
-
expect(keyMapBox.element).toBeUndefined();
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
});
|
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
import { mount } from '@vue/test-utils';
|
|
2
|
-
import FleetSummary from '@shell/components/fleet/FleetSummary.vue';
|
|
3
|
-
|
|
4
|
-
const REPO_NAME = 'testrepo';
|
|
5
|
-
|
|
6
|
-
const REPO_NAME_VARIANT = 'testrepo-again';
|
|
7
|
-
|
|
8
|
-
const CLUSTER_NAME = 'testcluster';
|
|
9
|
-
|
|
10
|
-
const mockedBundlesInRepo = [{
|
|
11
|
-
id: `fleet-default/${ REPO_NAME }-${ CLUSTER_NAME }-1234`,
|
|
12
|
-
type: 'fleet.cattle.io.bundle',
|
|
13
|
-
apiVersion: 'fleet.cattle.io/v1alpha1',
|
|
14
|
-
kind: 'Bundle',
|
|
15
|
-
repoName: REPO_NAME,
|
|
16
|
-
metadata: {
|
|
17
|
-
labels: {
|
|
18
|
-
'fleet.cattle.io/commit': '3640888439d1b7b6a53dbeee291a533eea2632ab',
|
|
19
|
-
'fleet.cattle.io/repo-name': REPO_NAME
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
name: `${ REPO_NAME }-${ CLUSTER_NAME }-1234`,
|
|
23
|
-
namespace: 'fleet-default',
|
|
24
|
-
state: {
|
|
25
|
-
error: false,
|
|
26
|
-
message: 'Resource is Ready',
|
|
27
|
-
name: 'active',
|
|
28
|
-
transitioning: false
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
spec: {
|
|
32
|
-
correctDrift: { },
|
|
33
|
-
forceSyncGeneration: 2,
|
|
34
|
-
ignore: { },
|
|
35
|
-
namespace: 'custom-namespace-name',
|
|
36
|
-
resources: [
|
|
37
|
-
{
|
|
38
|
-
content: 'apiVersion: v1\nkind: ConfigMap\nmetadata:\n name: configmap-test\n annotations:\n {}\n# key: string\n labels:\n {}\n# key: string\ndata:\n key1: val1\n key2: val2\n key3: val3',
|
|
39
|
-
name: 'test-configmap.yaml'
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
targets: [
|
|
43
|
-
{
|
|
44
|
-
clusterName: 'nb-cluster0-28',
|
|
45
|
-
namespace: 'custom-namespace-name'
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: `fleet-default/${ REPO_NAME }-${ CLUSTER_NAME }-5678`,
|
|
52
|
-
type: 'fleet.cattle.io.bundle',
|
|
53
|
-
apiVersion: 'fleet.cattle.io/v1alpha1',
|
|
54
|
-
kind: 'Bundle',
|
|
55
|
-
repoName: REPO_NAME,
|
|
56
|
-
metadata: {
|
|
57
|
-
labels: {
|
|
58
|
-
'fleet.cattle.io/commit': '3640888439d1b7b6a53dbeee291a533eea2632ab',
|
|
59
|
-
'fleet.cattle.io/repo-name': REPO_NAME
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
name: `${ REPO_NAME }-${ CLUSTER_NAME }-5678`,
|
|
63
|
-
namespace: 'fleet-default',
|
|
64
|
-
state: {
|
|
65
|
-
error: false,
|
|
66
|
-
message: 'Resource is Ready',
|
|
67
|
-
name: 'active',
|
|
68
|
-
transitioning: false
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
spec: {
|
|
72
|
-
correctDrift: { },
|
|
73
|
-
forceSyncGeneration: 2,
|
|
74
|
-
ignore: { },
|
|
75
|
-
namespace: 'custom-namespace-name',
|
|
76
|
-
resources: [
|
|
77
|
-
{
|
|
78
|
-
content: 'apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: nginx-cluster0\n labels:\n app: nginx\nspec:\n replicas: 1\n selector:\n matchLabels:\n app: nginx\n template:\n metadata:\n labels:\n app: nginx\n spec:\n containers:\n - name: nginx\n image: nginx:latest\n ports:\n - containerPort: 80',
|
|
79
|
-
name: 'nginx.yml'
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
targets: [
|
|
83
|
-
{
|
|
84
|
-
clusterName: 'nb-cluster0-28',
|
|
85
|
-
namespace: 'custom-namespace-name'
|
|
86
|
-
}
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
}];
|
|
90
|
-
|
|
91
|
-
const mockedBundlesOutOfRepo = [{
|
|
92
|
-
id: `fleet-default/${ REPO_NAME_VARIANT }-${ CLUSTER_NAME }-1234`,
|
|
93
|
-
type: 'fleet.cattle.io.bundle',
|
|
94
|
-
apiVersion: 'fleet.cattle.io/v1alpha1',
|
|
95
|
-
kind: 'Bundle',
|
|
96
|
-
repoName: REPO_NAME_VARIANT,
|
|
97
|
-
metadata: {
|
|
98
|
-
labels: {
|
|
99
|
-
'fleet.cattle.io/commit': '3640888439d1b7b6a53dbeee291a533eea2632ab',
|
|
100
|
-
'fleet.cattle.io/repo-name': REPO_NAME_VARIANT
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
name: `${ REPO_NAME_VARIANT }-${ CLUSTER_NAME }-1234`,
|
|
104
|
-
namespace: 'fleet-default',
|
|
105
|
-
state: {
|
|
106
|
-
error: false,
|
|
107
|
-
message: 'Resource is Ready',
|
|
108
|
-
name: 'active',
|
|
109
|
-
transitioning: false
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
spec: {
|
|
113
|
-
correctDrift: { },
|
|
114
|
-
forceSyncGeneration: 2,
|
|
115
|
-
ignore: { },
|
|
116
|
-
namespace: 'custom-namespace-name',
|
|
117
|
-
resources: [
|
|
118
|
-
{
|
|
119
|
-
content: 'apiVersion: v1\nkind: ConfigMap\nmetadata:\n name: configmap-test\n annotations:\n {}\n# key: string\n labels:\n {}\n# key: string\ndata:\n key1: val1\n key2: val2\n key3: val3',
|
|
120
|
-
name: 'test-configmap.yaml'
|
|
121
|
-
}
|
|
122
|
-
],
|
|
123
|
-
targets: [
|
|
124
|
-
{
|
|
125
|
-
clusterName: 'nb-cluster0-28',
|
|
126
|
-
namespace: 'custom-namespace-name'
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
id: `fleet-default/${ REPO_NAME_VARIANT }-${ CLUSTER_NAME }-5678`,
|
|
133
|
-
type: 'fleet.cattle.io.bundle',
|
|
134
|
-
apiVersion: 'fleet.cattle.io/v1alpha1',
|
|
135
|
-
kind: 'Bundle',
|
|
136
|
-
repoName: REPO_NAME_VARIANT,
|
|
137
|
-
metadata: {
|
|
138
|
-
labels: {
|
|
139
|
-
'fleet.cattle.io/commit': '3640888439d1b7b6a53dbeee291a533eea2632ab',
|
|
140
|
-
'fleet.cattle.io/repo-name': REPO_NAME_VARIANT
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
name: `${ REPO_NAME_VARIANT }-${ CLUSTER_NAME }-5678`,
|
|
144
|
-
namespace: 'fleet-default',
|
|
145
|
-
state: {
|
|
146
|
-
error: false,
|
|
147
|
-
message: 'Resource is Ready',
|
|
148
|
-
name: 'active',
|
|
149
|
-
transitioning: false
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
spec: {
|
|
153
|
-
correctDrift: { },
|
|
154
|
-
forceSyncGeneration: 2,
|
|
155
|
-
ignore: { },
|
|
156
|
-
namespace: 'custom-namespace-name',
|
|
157
|
-
resources: [
|
|
158
|
-
{
|
|
159
|
-
content: 'apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: nginx-cluster0\n labels:\n app: nginx\nspec:\n replicas: 1\n selector:\n matchLabels:\n app: nginx\n template:\n metadata:\n labels:\n app: nginx\n spec:\n containers:\n - name: nginx\n image: nginx:latest\n ports:\n - containerPort: 80',
|
|
160
|
-
name: 'nginx.yml'
|
|
161
|
-
},
|
|
162
|
-
],
|
|
163
|
-
targets: [
|
|
164
|
-
{
|
|
165
|
-
clusterName: 'nb-cluster0-28',
|
|
166
|
-
namespace: 'custom-namespace-name'
|
|
167
|
-
}
|
|
168
|
-
]
|
|
169
|
-
}
|
|
170
|
-
}];
|
|
171
|
-
|
|
172
|
-
const mockRepo = {
|
|
173
|
-
id: `fleet-default/${ REPO_NAME }`,
|
|
174
|
-
type: 'fleet.cattle.io.gitrepo',
|
|
175
|
-
apiVersion: 'fleet.cattle.io/v1alpha1',
|
|
176
|
-
kind: 'GitRepo',
|
|
177
|
-
metadata: {
|
|
178
|
-
|
|
179
|
-
name: `${ REPO_NAME }`,
|
|
180
|
-
namespace: 'fleet-default',
|
|
181
|
-
state: {
|
|
182
|
-
error: false,
|
|
183
|
-
message: 'Resource is Ready',
|
|
184
|
-
name: 'active',
|
|
185
|
-
transitioning: false
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
spec: {
|
|
189
|
-
branch: 'main',
|
|
190
|
-
correctDrift: { enabled: false },
|
|
191
|
-
forceSyncGeneration: 2,
|
|
192
|
-
insecureSkipTLSVerify: false,
|
|
193
|
-
paths: [
|
|
194
|
-
'./cluster0'
|
|
195
|
-
],
|
|
196
|
-
repo: 'https://github.com/testuser/testrepo.git',
|
|
197
|
-
targetNamespace: 'custom-namespace-name',
|
|
198
|
-
targets: [
|
|
199
|
-
{ clusterName: `${ CLUSTER_NAME }` }
|
|
200
|
-
]
|
|
201
|
-
},
|
|
202
|
-
status: {
|
|
203
|
-
commit: '3640888439d1b7b6a53dbeee291a533eea2632ab',
|
|
204
|
-
conditions: [
|
|
205
|
-
{
|
|
206
|
-
error: false,
|
|
207
|
-
lastUpdateTime: '2023-10-05T18:06:27Z',
|
|
208
|
-
status: 'True',
|
|
209
|
-
transitioning: false,
|
|
210
|
-
type: 'Ready'
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
error: false,
|
|
214
|
-
lastUpdateTime: '2023-10-05T20:35:07Z',
|
|
215
|
-
status: 'True',
|
|
216
|
-
transitioning: false,
|
|
217
|
-
type: 'Accepted'
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
error: false,
|
|
221
|
-
lastUpdateTime: '2023-10-05T18:05:09Z',
|
|
222
|
-
status: 'True',
|
|
223
|
-
transitioning: false,
|
|
224
|
-
type: 'ImageSynced'
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
error: false,
|
|
228
|
-
lastUpdateTime: '2023-10-05T18:06:22Z',
|
|
229
|
-
status: 'False',
|
|
230
|
-
transitioning: false,
|
|
231
|
-
type: 'Reconciling'
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
error: false,
|
|
235
|
-
lastUpdateTime: '2023-10-05T18:05:09Z',
|
|
236
|
-
status: 'False',
|
|
237
|
-
transitioning: false,
|
|
238
|
-
type: 'Stalled'
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
error: false,
|
|
242
|
-
lastUpdateTime: '2023-10-05T20:35:07Z',
|
|
243
|
-
status: 'True',
|
|
244
|
-
transitioning: false,
|
|
245
|
-
type: 'Synced'
|
|
246
|
-
}
|
|
247
|
-
],
|
|
248
|
-
desiredReadyClusters: 1,
|
|
249
|
-
display: { readyBundleDeployments: '2/2' },
|
|
250
|
-
gitJobStatus: 'Current',
|
|
251
|
-
lastSyncedImageScanTime: null,
|
|
252
|
-
observedGeneration: 2,
|
|
253
|
-
readyClusters: 1,
|
|
254
|
-
resourceCounts: {
|
|
255
|
-
desiredReady: 2,
|
|
256
|
-
missing: 0,
|
|
257
|
-
modified: 0,
|
|
258
|
-
notReady: 0,
|
|
259
|
-
orphaned: 0,
|
|
260
|
-
ready: 2,
|
|
261
|
-
unknown: 0,
|
|
262
|
-
waitApplied: 0
|
|
263
|
-
},
|
|
264
|
-
resources: [
|
|
265
|
-
{
|
|
266
|
-
apiVersion: 'apps/v1',
|
|
267
|
-
id: 'custom-namespace-name/nginx-cluster0',
|
|
268
|
-
kind: 'Deployment',
|
|
269
|
-
name: 'nginx-cluster0',
|
|
270
|
-
namespace: 'custom-namespace-name',
|
|
271
|
-
state: 'Ready',
|
|
272
|
-
type: 'apps.deployment'
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
apiVersion: 'v1',
|
|
276
|
-
id: 'custom-namespace-name/configmap-test',
|
|
277
|
-
kind: 'ConfigMap',
|
|
278
|
-
name: 'configmap-test',
|
|
279
|
-
namespace: 'custom-namespace-name',
|
|
280
|
-
state: 'Ready',
|
|
281
|
-
type: 'configmap'
|
|
282
|
-
}
|
|
283
|
-
],
|
|
284
|
-
summary: {
|
|
285
|
-
desiredReady: 1,
|
|
286
|
-
ready: 1
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
const mockStore = { getters: { 'i18n/withFallback': (key, opt, fallback) => fallback } };
|
|
292
|
-
|
|
293
|
-
describe('component: FleetSummary', () => {
|
|
294
|
-
it.each([
|
|
295
|
-
[[...mockedBundlesInRepo, ...mockedBundlesOutOfRepo], '2'],
|
|
296
|
-
[mockedBundlesInRepo, '2'],
|
|
297
|
-
])('displays the number of bundles associated with the current gitrepo', (bundles: any[], bundleCount: string) => {
|
|
298
|
-
const wrapper = mount(FleetSummary, { propsData: { bundles, value: mockRepo }, mocks: { $store: mockStore } });
|
|
299
|
-
|
|
300
|
-
const bundleCountEl = wrapper.find('[data-testid="gitrepo-bundle-summary"] .count');
|
|
301
|
-
|
|
302
|
-
expect(bundleCountEl.text()).toBe(bundleCount);
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
it.each([
|
|
306
|
-
[[...mockedBundlesInRepo, ...mockedBundlesOutOfRepo], '2'],
|
|
307
|
-
[mockedBundlesInRepo, '2'],
|
|
308
|
-
|
|
309
|
-
])('displays the number of deployments associated with the current gitrepo', (bundles: any[], bundleCount: string) => {
|
|
310
|
-
const wrapper = mount(FleetSummary, { propsData: { bundles, value: mockRepo }, mocks: { $store: mockStore } });
|
|
311
|
-
|
|
312
|
-
const bundleCountEl = wrapper.find('[data-testid="gitrepo-deployment-summary"] .count');
|
|
313
|
-
|
|
314
|
-
expect(bundleCountEl.text()).toBe(bundleCount);
|
|
315
|
-
});
|
|
316
|
-
});
|