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

fix(relay): Fix failed to write credentials #450

Merged
merged 2 commits into from Apr 27, 2020
Merged

Conversation

BYK
Copy link
Collaborator

@BYK BYK commented Apr 27, 2020

@BYK BYK requested a review from jan-auer April 27, 2020 15:21
install.sh Outdated
# We need the ugly hack below as `relay generate credentials` tries to read the config and the credentials
# even with the `--stdout` and `--overwrite` flags and then errors out when the credentials file exists but
# not valid JSON.
$dcr --no-deps --entrypoint /bin/bash relay -c "mkdir /work/.relay && cp /etc/relay/config.yml /work/.relay/config.yml && /bin/relay credentials generate > /dev/null && cat /work/.relay/config.yml" > "$RELAY_CREDENTIALS_JSON"
Copy link
Member

Choose a reason for hiding this comment

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

This will probably also need credential.json to work.

I wonder if you could just use /bin/relay credentials generate --stdout instead of generate && cat? There will be some additional output on stderr in either case, btw.

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 wonder if you could just use /bin/relay credentials generate --stdout instead of generate && cat? There will be some additional output on stderr in either case, btw.

See my comment here please: I tried using stdout first but it fails if there's already a credentials.json file that is not valid. In our case I'd do relay credentials generate > relay/credentials.json which causes the credentials.json to be created as an empty file before relay runs and then relay complains about invalid config files as it cannot read an empty file as JSON.

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha, must be a misunderstanding on my end. I thought that it doesn't matter whether you run with or without --stdout as to whether the config is loaded beforehand. I'll follow up in Relay and make sure this works as expected.

- fix some issues
- echo success messages on key generation
@BYK BYK requested a review from jan-auer April 27, 2020 16:18
@BYK BYK merged commit ecccb21 into master Apr 27, 2020
@BYK BYK deleted the byk/fix/relay-credentials branch April 27, 2020 17:55
MaicolBen pushed a commit to hinthealth/onpremise that referenced this pull request Jul 20, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants