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 script to not print null values #4871

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Conversation

rowansmithhc
Copy link
Contributor

Added a select(.value != "") entry to the jq statement to avoid it printing null values. This is to make life easier when copy/pasting the output from the script.

This solves the problem of people overwriting existing values they already may have set and do not want overwritten, namely VAULT_ADDR and VAULT_TOKEN.

before:

➜  enos git:(main) ✗ bash scripts/test_e2e_env.sh               
export BOUNDARY_ADDR='http://some-address:9200'
export BOUNDARY_LICENSE=''
export E2E_AWS_ACCESS_KEY_ID=''
export E2E_AWS_BUCKET_NAME=''
export E2E_AWS_HOST_SET_FILTER=''
export E2E_AWS_HOST_SET_FILTER2=''
export E2E_AWS_HOST_SET_IPS='[""]'
export E2E_AWS_HOST_SET_IPS2='[""]'
export E2E_AWS_REGION=''
export E2E_AWS_SECRET_ACCESS_KEY=''
export E2E_MAX_PAGE_SIZE='10'
export E2E_PASSWORD_ADMIN_LOGIN_NAME='admin'
export E2E_PASSWORD_ADMIN_PASSWORD='xdBht'
export E2E_PASSWORD_AUTH_METHOD_ID='ampw_UI0wkZdCfJ'
export E2E_SSH_CA_KEY=''
export E2E_SSH_KEY_PATH='/Users/something.pem'
export E2E_SSH_USER='ubuntu'
export E2E_TARGET_ADDRESS='10.13.1.254'
export E2E_TARGET_PORT='22'
export E2E_TESTS='true'
export E2E_VAULT_ADDR=''
export E2E_WORKER_ADDRESS=''
export E2E_WORKER_TAG_EGRESS=''
export E2E_WORKER_TAG_INGRESS=''
export VAULT_ADDR=''
export VAULT_TOKEN=''

after:

➜  enos git:(main) ✗ bash scripts/test_e2e_env.sh               
export BOUNDARY_ADDR='http://some-address:9200'
export E2E_AWS_HOST_SET_IPS='[""]'
export E2E_AWS_HOST_SET_IPS2='[""]'
export E2E_MAX_PAGE_SIZE='10'
export E2E_PASSWORD_ADMIN_LOGIN_NAME='admin'
export E2E_PASSWORD_ADMIN_PASSWORD='xdBht'
export E2E_PASSWORD_AUTH_METHOD_ID='ampw_UI0wkZdCfJ'
export E2E_SSH_CA_KEY=''
export E2E_SSH_KEY_PATH='/Users/something.pem'
export E2E_SSH_USER='ubuntu'
export E2E_TARGET_ADDRESS='10.13.1.254'
export E2E_TARGET_PORT='22'
export E2E_TESTS='true'

Added a `select(.value != "")` entry to the jq statement to avoid it printing null values. This is to make life easier when copy/pasting the output from the script.

This solves the problem of people overwriting existing values they may have set, namely `VAULT_ADDR` and `VAULT_TOKEN`.

before:

```
➜  enos git:(main) ✗ bash scripts/test_e2e_env.sh               
export BOUNDARY_ADDR='http://some-address:9200'
export BOUNDARY_LICENSE=''
export E2E_AWS_ACCESS_KEY_ID=''
export E2E_AWS_BUCKET_NAME=''
export E2E_AWS_HOST_SET_FILTER=''
export E2E_AWS_HOST_SET_FILTER2=''
export E2E_AWS_HOST_SET_IPS='[""]'
export E2E_AWS_HOST_SET_IPS2='[""]'
export E2E_AWS_REGION=''
export E2E_AWS_SECRET_ACCESS_KEY=''
export E2E_MAX_PAGE_SIZE='10'
export E2E_PASSWORD_ADMIN_LOGIN_NAME='admin'
export E2E_PASSWORD_ADMIN_PASSWORD='xdBht'
export E2E_PASSWORD_AUTH_METHOD_ID='ampw_UI0wkZdCfJ'
export E2E_SSH_CA_KEY=''
export E2E_SSH_KEY_PATH='/Users/something.pem'
export E2E_SSH_USER='ubuntu'
export E2E_TARGET_ADDRESS='10.13.1.254'
export E2E_TARGET_PORT='22'
export E2E_TESTS='true'
export E2E_VAULT_ADDR=''
export E2E_WORKER_ADDRESS=''
export E2E_WORKER_TAG_EGRESS=''
export E2E_WORKER_TAG_INGRESS=''
export VAULT_ADDR=''
export VAULT_TOKEN=''
```

after:

```
➜  enos git:(main) ✗ bash scripts/test_e2e_env.sh               
export BOUNDARY_ADDR='http://some-address:9200'
export E2E_AWS_HOST_SET_IPS='[""]'
export E2E_AWS_HOST_SET_IPS2='[""]'
export E2E_MAX_PAGE_SIZE='10'
export E2E_PASSWORD_ADMIN_LOGIN_NAME='admin'
export E2E_PASSWORD_ADMIN_PASSWORD='xdBht'
export E2E_PASSWORD_AUTH_METHOD_ID='ampw_UI0wkZdCfJ'
export E2E_SSH_CA_KEY=''
export E2E_SSH_KEY_PATH='/Users/something.pem'
export E2E_SSH_USER='ubuntu'
export E2E_TARGET_ADDRESS='10.13.1.254'
export E2E_TARGET_PORT='22'
export E2E_TESTS='true'
```
@rowansmithhc rowansmithhc requested a review from ryancragun June 3, 2024 23:46
@moduli moduli added the pr/no-milestone Ignores the Milestone Check label Jun 4, 2024
Copy link
Collaborator

@moduli moduli left a comment

Choose a reason for hiding this comment

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

Nice change! Thanks!

@moduli moduli merged commit d161124 into main Jun 4, 2024
64 of 66 checks passed
@moduli moduli deleted the boundary-script-tweak branch June 4, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-milestone Ignores the Milestone Check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants