Skip to content

implement kmeshctl version#919

Merged
LiZhenCheng9527 merged 4 commits intokmesh-net:mainfrom
YaoZengzeng:version
Oct 10, 2024
Merged

implement kmeshctl version#919
LiZhenCheng9527 merged 4 commits intokmesh-net:mainfrom
YaoZengzeng:version

Conversation

@YaoZengzeng
Copy link
Copy Markdown
Member

What type of PR is this?

/kind enhancement

What this PR does / why we need it:

Implement kmeshctl version to show version of kmeshctl or Kmesh daemon

Which issue(s) this PR fixes:
Fixes #898

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@kmesh-bot kmesh-bot added the kind/enhancement New feature or request label Sep 30, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Project coverage is 53.07%. Comparing base (dc26806) to head (ef71fe9).
Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
pkg/status/status_server.go 0.00% 10 Missing ⚠️
Files with missing lines Coverage Δ
pkg/status/status_server.go 40.74% <0.00%> (-1.57%) ⬇️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 973cbc6...ef71fe9. Read the comment docs.

func RunVersion(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
v := version.Get()
fmt.Printf("%s\n", v.GitVersion)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

since the CLI tool is built with cobra, is there a reason we shouldn't use the cobra cmd.Printf(), cmd.PrintErrf(), etc methods?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good catch! I'll look into it :)

Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
@YaoZengzeng
Copy link
Copy Markdown
Member Author

@hzxuzhonghu PTAL

kmeshctl version

# Show version info of a specific Kmesh daemon
kmesh version <kmesh-daemon-pod>`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

kmesh version ? or kmeshctl version

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good catch!

Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
@kmesh-bot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu

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

The pull request process is described here

Details 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

@YaoZengzeng
Copy link
Copy Markdown
Member Author

@hzxuzhonghu maybe this PR could get merged.

@hzxuzhonghu
Copy link
Copy Markdown
Member

@LiZhenCheng9527 Any other comments?

@YaoZengzeng
Copy link
Copy Markdown
Member Author

ping @LiZhenCheng9527

@LiZhenCheng9527
Copy link
Copy Markdown
Contributor

/lgtm

@kmesh-bot kmesh-bot added the lgtm label Oct 10, 2024
@LiZhenCheng9527 LiZhenCheng9527 added this pull request to the merge queue Oct 10, 2024
Merged via the queue into kmesh-net:main with commit 18c383a Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support kmeshctl version sub command

5 participants