opensearch-project / reporting-cli

Apache License 2.0
4 stars 13 forks source link

[BUG] Invalid username or password when multi-tenancy is disabled #29

Closed 51CGO closed 1 year ago

51CGO commented 1 year ago

reporting-cli fails when multi-tenancy is disabled as it tries to reach the tenant selection page

Steps to reproduce:

rupal-bq commented 1 year ago

HI @51CGO,

Thank you for reporting this issue. Will look into it.

51CGO commented 1 year ago

Thank you.

It should be easy to fix: To make it work for my configuration, I commented the following code:

try { if (tenant === 'global' || tenant === 'private') { await page.click('label[for=' + tenant + ']'); } else { await page.click('label[for="custom"]'); await page.click('button[data-test-subj="comboBoxToggleListButton"]'); await page.type('input[data-test-subj="comboBoxSearchInput"]', tenant); } } catch (err) { spinner.fail('Invalid username or password'); exit(1); }

await page.waitForTimeout(5000); await page.click('button[data-test-subj="confirm"]'); await page.waitForTimeout(25000); await overridePage.goto(url, { waitUntil: 'networkidle0' }); await overridePage.waitForTimeout(5000); // Check if tenant was selected successfully. if ((await overridePage.$('button[data-test-subj="confirm"]')) !== null) { spinner.fail('Invalid tenant'); exit(1); }

Adding a parameter "--multitenancy=false" and surrounding the above code with "if multitenancy ... then ..." should do the job.

rupal-bq commented 1 year ago

@51CGO Thank you for the analysis. Feel free to open PR if you would like.

brijos commented 1 year ago

@51CGO It looks like you have the solution. Are you interested in submitting a PR? We are always looking for external contributions to the project.

51CGO commented 1 year ago

@rupal-bq @brijos I'm sorry. This is not a language I know enough to make good code and all the checks needed. I was only able to see were the issue came from but I can't make all the reuired fixes.