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

feat(kumactl) print control plane version with version cmd #2834

Merged
merged 3 commits into from
Sep 29, 2021

Conversation

michaelbeaumont
Copy link
Contributor

@michaelbeaumont michaelbeaumont commented Sep 24, 2021

Summary

The version subcommand now prints the control plane version.

Full changelog

  • Add control plane version to version command output

Testing

  • Unit tests
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

Backwards compatibility

  • Add backport-to-stable label if the code is backwards compatible. Otherwise, list breaking changes.

@michaelbeaumont michaelbeaumont requested a review from a team as a code owner September 24, 2021 14:08
Signed-off-by: Michael Beaumont <mjboamail@gmail.com>
@codecov-commenter
Copy link

Codecov Report

Merging #2834 (0021107) into master (1333e7c) will increase coverage by 0.07%.
The diff coverage is 70.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2834      +/-   ##
==========================================
+ Coverage   52.01%   52.08%   +0.07%     
==========================================
  Files         882      883       +1     
  Lines       51321    51350      +29     
==========================================
+ Hits        26694    26747      +53     
+ Misses      22514    22474      -40     
- Partials     2113     2129      +16     
Impacted Files Coverage Δ
app/kumactl/cmd/version/version.go 68.96% <68.96%> (ø)
app/kumactl/cmd/root.go 74.13% <100.00%> (ø)
pkg/xds/generator/direct_access_proxy_generator.go 83.90% <0.00%> (+1.14%) ⬆️
pkg/insights/resyncer.go 67.16% <0.00%> (+2.98%) ⬆️
pkg/core/resources/manager/cache.go 84.41% <0.00%> (+5.19%) ⬆️
pkg/events/eventbus.go 92.59% <0.00%> (+7.40%) ⬆️
pkg/core/bootstrap/autoconfig.go 54.46% <0.00%> (+8.03%) ⬆️
.../core/managers/apis/ratelimit/ratelimit_manager.go 45.16% <0.00%> (+9.67%) ⬆️
pkg/insights/components.go 100.00% <0.00%> (+30.00%) ⬆️

Continue to review full report at Codecov.

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

}

if kumaCPInfo != nil {
cmd.Printf("kuma-cp: %s\n", kumaCPInfo.Version)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably include the product as well, so the user knows if they are using Kuma kumactl with Kong Mesh kuma-cp.

Copy link
Contributor

Choose a reason for hiding this comment

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

how about

Client: Kuma 1.2.3
Server: Kuma 1.2.4

?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, and if the server is kong mesh -

Client: Kuma 1.2.3
Server: Kong Mesh 1.4.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@parkanzky parkanzky left a comment

Choose a reason for hiding this comment

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

Approving, contingent on the minor change requested.

@jpeach
Copy link
Contributor

jpeach commented Sep 27, 2021

@michaelbeaumont Pretty sure that this change is OK for the 1.3 release branch, in which case, apply the backport-to-stable label and mergify will automatically open a cherry pick PR.

@@ -111,7 +111,7 @@ func NewRootCmd(root *kumactl_cmd.RootContext) *cobra.Command {
cmd.AddCommand(inspect.NewInspectCmd(root))
cmd.AddCommand(install.NewInstallCmd(root))
cmd.AddCommand(uninstall.NewUninstallCmd())
cmd.AddCommand(version.NewVersionCmd())
cmd.AddCommand(version.NewCmd(root))
Copy link
Contributor

Choose a reason for hiding this comment

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

So we gonna have 2 version command: github.com/kumahq/kuma/app/kumactl/cmd/version and github.com/kumahq/kuma/pkg/cmd/version? Maybe we can create method BuildInfo.Print, to have this formatting in one place:

cmd.Println(fmt.Sprintf("Product:    %s", kuma_version.Product))
cmd.Println(fmt.Sprintf("Version:    %s", buildInfo.Version))
cmd.Println(fmt.Sprintf("Git Tag:    %s", buildInfo.GitTag))
cmd.Println(fmt.Sprintf("Git Commit: %s", buildInfo.GitCommit))
cmd.Println(fmt.Sprintf("Build Date: %s", buildInfo.BuildDate))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@michaelbeaumont michaelbeaumont force-pushed the feat/server_version branch 3 times, most recently from a62bb1e to f57fe2f Compare September 27, 2021 15:54
Signed-off-by: Michael Beaumont <mjboamail@gmail.com>
Signed-off-by: Michael Beaumont <mjboamail@gmail.com>
@michaelbeaumont michaelbeaumont merged commit df0b186 into kumahq:master Sep 29, 2021
@michaelbeaumont michaelbeaumont deleted the feat/server_version branch September 29, 2021 13:41
mergify bot pushed a commit that referenced this pull request Sep 29, 2021
* feat(kumactl) print control plane version with version cmd

Signed-off-by: Michael Beaumont <mjboamail@gmail.com>

* feat(kumactl) display server product and add Client/Server prefix

Signed-off-by: Michael Beaumont <mjboamail@gmail.com>

* refactor(kumactl) deduplicate version printing code

Signed-off-by: Michael Beaumont <mjboamail@gmail.com>
(cherry picked from commit df0b186)
michaelbeaumont added a commit that referenced this pull request Sep 29, 2021
* feat(kumactl) print control plane version with version cmd

Signed-off-by: Michael Beaumont <mjboamail@gmail.com>

* feat(kumactl) display server product and add Client/Server prefix

Signed-off-by: Michael Beaumont <mjboamail@gmail.com>

* refactor(kumactl) deduplicate version printing code

Signed-off-by: Michael Beaumont <mjboamail@gmail.com>
Signed-off-by: Mike <mjboamail@gmail.com>
(cherry picked from commit df0b186)
michaelbeaumont added a commit that referenced this pull request Sep 29, 2021
…2850)

* feat(kumactl) print control plane version with version cmd

Signed-off-by: Michael Beaumont <mjboamail@gmail.com>

* feat(kumactl) display server product and add Client/Server prefix

Signed-off-by: Michael Beaumont <mjboamail@gmail.com>

* refactor(kumactl) deduplicate version printing code

Signed-off-by: Michael Beaumont <mjboamail@gmail.com>
Signed-off-by: Mike <mjboamail@gmail.com>
(cherry picked from commit df0b186)

Co-authored-by: Mike <mjboamail@gmail.com>
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

6 participants