Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Default Password for OS 2.12 #707

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

nhtruong
Copy link
Collaborator

@nhtruong nhtruong commented Jan 29, 2024

Description

Prepare repo for the advent of OS 2.12 where admin:admin is no longer an accepted credential.

Issues Resolved

Closes #699

Check List

  • New functionality includes testing.
    • All tests pass
  • Linter check was successfull - yarn run lint doesn't show any errors
  • Commits are signed per the DCO using --signoff
  • Changelog was updated.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty @nhtruong for working on this!

@@ -5,10 +5,4 @@ ARG opensearch_path=/usr/share/opensearch
ARG opensearch_yml=$opensearch_path/config/opensearch.yml

ARG SECURE_INTEGRATION

Copy link
Member

@DarshitChanpura DarshitChanpura Jan 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to replace this health-check with something else?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added to this repo to solve a flaky spec issue myself when I first started. No other client repo has this. From what I've observed so far, it doesn't really help. If it happens again, I'm better equiped to find a better solution. This also adds complexity to the CI workflows esp now that HEALTHCHECK has to be aware of the OS version.

.github/workflows/integration.yml Outdated Show resolved Hide resolved
return major === 2 && minor >= 12;
}

function createSecuredClient() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where would this be used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is meant to be used in integration tests only. It's a helper function inside test folder.

- Updated secured test suite to use strong password when OS 2.12 or up is detected
- Removed autoheal
- Simplified client creation step for the guides

Signed-off-by: Theo Truong <theotr@amazon.com>
@nhtruong
Copy link
Collaborator Author

This is ready for review but we won't be able to merged this till 2.12.x is released on Docker repo as all workflows using latest for OS version are failing right now.

.github/workflows/integration.yml Show resolved Hide resolved
@@ -6,10 +6,11 @@ In this guide, we will look at some advanced index actions that are not covered
Let's create a client instance, and an index named `movies`:
```javascript
const { Client } = require('@opensearch-project/opensearch');

const client = new Client({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not point to createSecureClient() here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beecause that's a helper function for our test suites only. The function creates a client using admin:admin or admin:myStrongPassword123! depending on the OPENSEARCH_VERSION env. Users should not use that function because their password will be different.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh I see. ty for explanation!!

return major === 2 && minor >= 12;
}

function createSecuredClient() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where would this be used?

```

Let's create a client instance to access this cluster:
Let's create a client instance to access an OpenSearch cluster:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we skip mentioning how to start a cluster here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should. These guides should focus on OpenSearch features, not how to setup a cluster. We can have another guide to cover how to set up a cluster, but that's already covered in the Readme and especially the OpenSearch website itself.

Signed-off-by: Theo Truong <theotr@amazon.com>
Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @nhtruong !

@DarshitChanpura DarshitChanpura mentioned this pull request Feb 22, 2024
5 tasks
@DarshitChanpura
Copy link
Member

@nhtruong Now that 2.12 is released this should be unblocked.

@nhtruong
Copy link
Collaborator Author

@DarshitChanpura All workflows pass now 🥳
Need another maintainer to approve the PR.
@VachaShah @dblock can you review this?

Copy link
Collaborator

@VachaShah VachaShah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nhtruong nhtruong merged commit 50da527 into opensearch-project:main Feb 26, 2024
64 checks passed
@nhtruong nhtruong deleted the default-password branch February 26, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v2.12.0] Ensure CI/documentation reflect changes to default admin credentials
3 participants