-
Notifications
You must be signed in to change notification settings - Fork 326
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
Add support for version command #741
Conversation
|
||
var ( |
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.
this code moved to version/version
in top-level
@@ -12,7 +12,7 @@ type Command struct { | |||
} | |||
|
|||
func (c *Command) Run(_ []string) int { | |||
c.UI.Output(fmt.Sprintf("consul-k8s %s", c.Version)) | |||
c.UI.Output(fmt.Sprintf("consul-k8s-control-plane %s", c.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.
fix missing change from monorepo move
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.
Thanks for adding this, looks great!
We did have one changelog entry that went into the alpha release (only install was merged at the time) https://github.com/hashicorp/consul-k8s/blob/main/CHANGELOG.md#0340-september-17-2021
So this could be added to the changelog as support for version command.
I think the changelog is missing the uninstall command as well
cli/cmd/version/version.go
Outdated
} | ||
|
||
func (c *Command) Synopsis() string { | ||
return "Prints the 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.
return "Prints the version." | |
return "Prints the version of the CLI." |
cli/cmd/version/version.go
Outdated
} | ||
|
||
func (c *Command) Help() string { | ||
return "" |
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 there be something returned here?
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.
yeah good call, I copied https://github.com/hashicorp/consul/blob/main/command/version/version.go#L90
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.
Just a few comments
- Also refactor the version code out into top-level version pkg to match how the control-plane is factored
528d361
to
feb37bd
Compare
They never succeed because the Docker mirror is refusing our pulls.
How I've tested this PR:
How I expect reviewers to test this PR:
Checklist: