Skip to content

Commit

Permalink
Add security plugin changes (#160)
Browse files Browse the repository at this point in the history
Signed-off-by: Prudhvi Godithi <[email protected]>
  • Loading branch information
prudhvigodithi authored Feb 27, 2024
1 parent d8e81eb commit f8fb3fa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
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:[email protected]:9200")
err := d.Set("url", os.Getenv("OPENSEARCH_URL"))
if err != nil {
return nil, diag.FromErr(err)
}
Expand Down

0 comments on commit f8fb3fa

Please sign in to comment.