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) return Kuma DP and Envoy version in the output of inspect dataplanes #1298

Conversation

jewertow
Copy link
Contributor

@jewertow jewertow commented Dec 13, 2020

Summary

This change allows to inspect version of Kuma DP and Envoy.
It is compatible with older versions of Kuma CP which don't collect these versions.

Issues resolved

Fix #1112 and #1244

…lanes

Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
@jewertow jewertow requested a review from a team as a code owner December 13, 2020 14:20
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Copy link
Contributor

@jakubdyszkiewicz jakubdyszkiewicz left a comment

Choose a reason for hiding this comment

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

One small thing, otherwise 🆗

@@ -102,6 +102,17 @@ func printDataplaneOverviews(now time.Time, dataplaneInsights *mesh_core.Datapla
dataplaneInsight.GetMTLS().GetCertificateExpirationTime()
certRegenerations := strconv.Itoa(int(dataplaneInsight.GetMTLS().GetCertificateRegenerations()))

var kumaDpVersion string
var envoyVersion string
if lastSubscription.Version != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

lastSubscription.GetVersion() which is nil safety version of .Version. Otherwise I saw that

❯❯❯ kumactl inspect dataplanes
MESH   NAME   TAGS   STATUS   LAST CONNECTED AGO   LAST UPDATED AGO   TOTAL UPDATES   TOTAL ERRORS   CERT REGENERATED AGO   CERT EXPIRATION   CERT REGENERATIONS   KUMA-DP VERSION   ENVOY VERSION
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x173aed0]

goroutine 1 [running]:
github.com/kumahq/kuma/app/kumactl/cmd/inspect.printDataplaneOverviews.func1.1(0x0, 0x0, 0x0)
	/Users/jakob/kong/kuma/app/kumactl/cmd/inspect/inspect_dataplanes.go:107 +0x2b0
github.com/kumahq/kuma/app/kumactl/pkg/output/table.(*printer).Print(0x3ee5908, 0xc000bce270, 0xd, 0xd, 0xc000bec660, 0x0, 0x0, 0x2db7540, 0xc00000e018, 0x0, ...)
	/Users/jakob/kong/kuma/app/kumactl/pkg/output/table/printer.go:37 +0xa8
github.com/kumahq/kuma/app/kumactl/cmd/inspect.printDataplaneOverviews(0xbfede8845b03aa28, 0x3ab6861, 0x3ea9760, 0xc0004a1200, 0x2db7540, 0xc00000e018, 0xc000950000, 0xc0004a1200)
	/Users/jakob/kong/kuma/app/kumactl/cmd/inspect/inspect_dataplanes.go:134 +0x22a
github.com/kumahq/kuma/app/kumactl/cmd/inspect.newInspectDataplanesCmd.func1(0xc000b4a2c0, 0x3ee5908, 0x0, 0x0, 0xc000bb7d78, 0xc000bb7d50)
	/Users/jakob/kong/kuma/app/kumactl/cmd/inspect/inspect_dataplanes.go:51 +0x2b7
github.com/kumahq/kuma/app/kumactl/pkg/errors.FormatErrorWrapper.func1(0xc000b4a2c0, 0x3ee5908, 0x0, 0x0, 0x0, 0x0)
	/Users/jakob/kong/kuma/app/kumactl/pkg/errors/formatter.go:14 +0x51
github.com/spf13/cobra.(*Command).execute(0xc000b4a2c0, 0x3ee5908, 0x0, 0x0, 0xc000b4a2c0, 0x3ee5908)
	/Users/jakob/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:842 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xc000b80580, 0xc000b80580, 0x0, 0x0)
	/Users/jakob/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/jakob/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
github.com/kumahq/kuma/app/kumactl/cmd.Execute()
	/Users/jakob/kong/kuma/app/kumactl/cmd/root.go:95 +0xa5
main.main()
	/Users/jakob/kong/kuma/app/kumactl/main.go:6 +0x25

for a short moment when DP was up.

Dataplane may not have DataplaneInsight yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@jakubdyszkiewicz jakubdyszkiewicz merged commit 15f4754 into kumahq:master Dec 17, 2020
mergify bot pushed a commit that referenced this pull request Dec 17, 2020
…ect dataplanes` (#1298)

Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
(cherry picked from commit 15f4754)
nickolaev pushed a commit that referenced this pull request Dec 21, 2020
…ect dataplanes` (#1298) (#1329)

Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
(cherry picked from commit 15f4754)

Co-authored-by: Jacek Ewertowski <jacek.ewertowski1@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.

Kuma DP + Envoy version in Dataplane Insights
2 participants