From ad6831c0f3647ef3286dd5e77d6ab80918b9da96 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Mon, 18 Jul 2022 00:08:13 +0530 Subject: [PATCH] mgr/dashboard: fix dashboard cephadm e2e errors https://tracker.ceph.com/issues/56079 Signed-off-by: Nizamudeen A --- src/pybind/mgr/dashboard/controllers/osd.py | 2 +- .../workflow/06-cluster-check.e2e-spec.ts | 44 ++++++++++++------- .../osd/osd-form/osd-form.component.html | 2 +- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/pybind/mgr/dashboard/controllers/osd.py b/src/pybind/mgr/dashboard/controllers/osd.py index dd3e80261acf6..d89ef0f287d25 100644 --- a/src/pybind/mgr/dashboard/controllers/osd.py +++ b/src/pybind/mgr/dashboard/controllers/osd.py @@ -371,7 +371,7 @@ class Osd(RESTController): option]['encrypted'] = data[0]['encrypted'] orch.osds.create([DriveGroupSpec.from_json( predefined_drive_groups[option])]) - except (ValueError, TypeError, DriveGroupValidationError) as e: + except (ValueError, TypeError, KeyError, DriveGroupValidationError) as e: raise DashboardException(e, component='osd') def _create_bare(self, data): diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts index 589cbaa904c23..a58db90417404 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts @@ -32,35 +32,45 @@ describe('when cluster creation is completed', () => { hosts.navigateTo(); }); - it('should check if monitoring stacks are running on the root host', () => { - const monitoringStack = ['alertmanager', 'grafana', 'node-exporter', 'prometheus']; - hosts.clickTab('cd-host-details', 'ceph-node-00', 'Daemons'); - for (const daemon of monitoringStack) { - cy.get('cd-host-details').within(() => { - services.checkServiceStatus(daemon); - }); - } - }); - - // avoid creating node-exporter on the newly added host - // to favour the host draining process - it('should reduce the count for node-exporter', () => { - services.editService('node-exporter', '3'); - }); - // grafana ip address is set to the fqdn by default. // kcli is not working with that, so setting the IP manually. - it('should change ip address of grafana', { retries: 2 }, () => { + it('should change ip address of grafana, prometheus and alertmanager', () => { const dashboardArr: Input[] = [ { id: 'GRAFANA_API_URL', newValue: 'https://192.168.100.100:3000', oldValue: '' + }, + { + id: 'PROMETHEUS_API_HOST', + newValue: 'http://192.168.100.100:9095', + oldValue: '' + }, + { + id: 'ALERTMANAGER_API_HOST', + newValue: 'http://192.168.100.100:9093', + oldValue: '' } ]; mgrmodules.editMgrModule('dashboard', dashboardArr); }); + // avoid creating node-exporter on the newly added host + // to favour the host draining process + it('should reduce the count for node-exporter', { retries: 2 }, () => { + services.editService('node-exporter', '3'); + }); + + it('should check if monitoring stacks are running on the root host', { retries: 2 }, () => { + const monitoringStack = ['alertmanager', 'grafana', 'node-exporter', 'prometheus']; + hosts.clickTab('cd-host-details', 'ceph-node-00', 'Daemons'); + for (const daemon of monitoringStack) { + cy.get('cd-host-details').within(() => { + services.checkServiceStatus(daemon); + }); + } + }); + it('should add one more host', () => { hosts.navigateTo('add'); hosts.add(hostnames[3]); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.html index d4b6d9faea109..531bae2573941 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.html @@ -41,7 +41,7 @@ [id]="'label_' + optionName" [for]="optionName" i18n>{{ deploymentOptions?.options[optionName].title }} - {{ deploymentOptions.recommended_option === optionName ? "(Recommended)" : "" }} + {{ deploymentOptions?.recommended_option === optionName ? "(Recommended)" : "" }} {{ deploymentOptions?.options[optionName].desc }} -- 2.39.5