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

Provider compatible with 2.12.0 security plugin admin password change #160

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ jobs:
- name: Wait for OpenSearch
# ensure that OS has come up and is available
run: |
./script/wait-for-endpoint --timeout=20 http://admin:admin@localhost:9200
./script/wait-for-endpoint --timeout=60 http://admin:myStrongPassword123%40456@localhost:9200
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
- name: Run the tests
run: |
export OPENSEARCH_URL=http://admin:admin@localhost:9200
export OPENSEARCH_URL=http://admin:myStrongPassword123%40456@localhost:9200
export TF_LOG=INFO
TF_ACC=1 go test ./... -v -parallel 20 -cover -short
# check goreleaser config for deprecations
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export OPENSEARCH_URL=http://admin:admin@localhost:9200
export TF_LOG=INFO
TF_ACC=1 go test ./... -v -parallel 20 -cover -short
```
Note: Starting from version `2.12.0`, the `admin` user password is determined by the `OPENSEARCH_INITIAL_ADMIN_PASSWORD` environment variable. If testing against a cluster with version `2.12.0` or later and have set `OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123@456`, please update the URL as follows: `export OPENSEARCH_URL=http://admin:myStrongPassword123%40456@localhost:9200`

#### To Run Specific Test
```sh
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
- network.publish_host=127.0.0.1
- logger.org.opensearch=warn
- "OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g"
- "OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123@456"
- "plugins.security.ssl.http.enabled=false"
- ${OSS_ENV_VAR:-FOO=bar}
command: ${OS_COMMAND}
Expand Down
2 changes: 1 addition & 1 deletion provider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func init() {

opendistroOriginalConfigureFunc := testAccOpendistroProvider.ConfigureContextFunc
testAccOpendistroProvider.ConfigureContextFunc = func(c context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) {
err := d.Set("url", "http://admin:admin@127.0.0.1:9200")
err := d.Set("url", os.Getenv("OPENSEARCH_URL"))
if err != nil {
return nil, diag.FromErr(err)
}
Expand Down
Loading