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

add "version" command to display git version string #221

Merged
merged 2 commits into from
Mar 1, 2019
Merged

Conversation

kdomanski
Copy link
Contributor

What this PR does / why we need it:
Fixes #216

Added 'version' command to display KubeOne version from git.

@kubermatic-bot kubermatic-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 1, 2019
@kdomanski
Copy link
Contributor Author

/assign @xmudrii

Long: `Prints the exact version number, as embedded by the build system.`,
Args: cobra.ExactArgs(0),
RunE: func(_ *cobra.Command, args []string) error {
fmt.Printf("KubeOne %s\n", versionString)
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about using JSON here like kubectl does? You might lose some readability, but it's much better if you're running KubeOne using scripts and want to quickly parse version. We can also build on base of that so users can use Go to check version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can add a --json parameter later if we end up needing it.

@kdomanski
Copy link
Contributor Author

/retest

@xmudrii
Copy link
Member

xmudrii commented Mar 1, 2019

/lgtm
/approve

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 1, 2019
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 964daa3cdc536237f771108b920def39806efd66

@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xmudrii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubermatic-bot kubermatic-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 1, 2019
@kubermatic-bot kubermatic-bot merged commit 805b686 into master Mar 1, 2019
@kubermatic-bot kubermatic-bot deleted the version branch March 1, 2019 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants