Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

tools: Added etcd_init.sh #18

Merged
merged 3 commits into from
Oct 17, 2016
Merged

tools: Added etcd_init.sh #18

merged 3 commits into from
Oct 17, 2016

Conversation

ashcrow
Copy link
Collaborator

@ashcrow ashcrow commented Oct 16, 2016

Created the tools directory to house non-required yet helpful tools we may want to provide along with the service code. etcd_init.sh is the first tool added which initializes the Commissaire etcd keyspace.

Issue originally found by @gbraad while installing commissaire-storage-service for the first time.

Created the tools directory to house non-required yet helpful tools we may want to provide along with the service code. etcd_init.sh is the first tool added which initializes the Commissaire etcd keyspace.
@mbarnes
Copy link
Contributor

mbarnes commented Oct 17, 2016

Oh hey, good timing! You know what else this script could do is make sure there's an entry for the default cluster network (as in C.DEFAULT_CLUSTER_NETWORK_JSON) so that storage lookups don't require a special case. I hacked that into the investigator service but this is clearly a better place for it.

I'll do a proper review in the morning.

@ashcrow
Copy link
Collaborator Author

ashcrow commented Oct 17, 2016

👍 will add hopefully before standup this morning.

@ashcrow
Copy link
Collaborator Author

ashcrow commented Oct 17, 2016

⬆️

Copy link
Contributor

@mbarnes mbarnes left a comment

Choose a reason for hiding this comment

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

I learned from Colin to always add set -euo pipefail at the beginning of bash scripts so it fails on error the way you would expect a program to. Otherwise looks and works great!

Update: Actually if you do add that, also append || true to the etcdctl mkdir line so the script doesn't abort over the key existing already.

(see: http://redsymbol.net/articles/unofficial-bash-strict-mode/)

@ashcrow
Copy link
Collaborator Author

ashcrow commented Oct 17, 2016

⬆️

@mbarnes mbarnes merged commit 52da60f into projectatomic:master Oct 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants