-
Notifications
You must be signed in to change notification settings - Fork 490
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
make cscli use crowdsec version for hub #194
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we merge the 3 checks for last version + warning display to a single one ? besides that lgtm
cmd/crowdsec-cli/install.go
Outdated
cwhub.HubBranch = "master" | ||
} else { | ||
log.Warnf("Crowdsec is not the latest version. Current version is '%s' and latest version is '%s'. Please update it!", cwversion.Version, latest) | ||
cwhub.HubBranch = cwversion.Version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we want to specify to which branch we're going to stick if it's not master ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is what the ligne above does no ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmh my bad, it doesn't precise the branch, but says what is the current crowdsec version and what is the latest. Is it enough ?
cmd/crowdsec-cli/update.go
Outdated
/* | ||
if no branch has been specified in flags for the hub, then use the one corresponding to crowdsec version | ||
*/ | ||
if cwhub.HubBranch == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same answer as above
cmd/crowdsec-cli/install.go
Outdated
@@ -63,6 +63,10 @@ you should [update cscli](./cscli_update.md). | |||
if !config.configured { | |||
return fmt.Errorf("you must configure cli before interacting with hub") | |||
} | |||
|
|||
if err := setHubBranch(); err != nil { | |||
log.Errorf("error while setting hub branch: %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to return the error here, so that the PersistentPreRunE
can properly fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should return the error in the PersistentPreRunE
, so it can fail properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
No description provided.