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

cluster-service: add version subcommand and change some startup logging #274

Merged
merged 1 commit into from Dec 13, 2017

Conversation

hsanjuan
Copy link
Collaborator

The --version flag is default from our cli library so I left that. The
version subcommand prints only the version number + the short commit
so it's a bit more easy to parse.

I have additionally reduced the amount of output on start up by converting
some messages to debug. I wish there was a level between INFO and DEBUG
though.

Fixes #201

License: MIT
Signed-off-by: Hector Sanjuan code@hector.link

@hsanjuan hsanjuan self-assigned this Dec 12, 2017
@ghost ghost added the status/in-progress In progress label Dec 12, 2017
err := hraft.BootstrapCluster(cfg.RaftConfig,
log, stable, snap, transport, srvCfg)
if err != nil {
logger.Error("bootstrapping cluster: ", err)
return nil, err
}
} else {
logger.Info("raft cluster is already bootstrapped")
logger.Debug("raft cluster is already bootstrapped")
Copy link
Collaborator

Choose a reason for hiding this comment

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

As you changed bootstrapping to initializing above it seems like you should do it here too for consistency.

@@ -86,7 +86,7 @@ func NewCluster(
return nil, err
}

logger.Infof("IPFS Cluster v%s listening on:", Version)
logger.Infof("IPFS Cluster v%s-%s listening on:", Version, Commit[0:8])
Copy link
Collaborator

Choose a reason for hiding this comment

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

As TestClusterStateSync doesn't hit the cluster service version command this slice dereference seems to be the cause of the slice out of bounds error that Travis catches for these changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks

The --version flag is default from our cli library so I left that. The
version subcommand prints only the version number + the short commit
so it's a bit more easy to parse.

I have additionally reduced the amount of output on start up by converting
some messages to debug. I wish there was a level between INFO and DEBUG
though.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 72.799% when pulling 2b6dfa4 on feat/201-version-subcmd into 5bc33d7 on master.

Copy link
Collaborator

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

lgtm

@hsanjuan hsanjuan merged commit 0f3391b into master Dec 13, 2017
@hsanjuan hsanjuan deleted the feat/201-version-subcmd branch December 13, 2017 15:56
@ghost ghost removed the status/in-progress In progress label Dec 13, 2017
@hsanjuan hsanjuan mentioned this pull request Jan 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants