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(kuma-dp): Kuma DP + Envoy version in Dataplane Insights (#1112) #1192

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
58224d7
feat(kuma-dp): Send Kuma DP and Envoy version in bootstrap request (#…
jewertow Nov 22, 2020
94921e7
style(kuma-dp): Reformat code with go fmt
jewertow Nov 22, 2020
d42a9f1
feat(dp-server): Generate bootstrap with KumaDp and Envoy version
jewertow Nov 23, 2020
7e8d452
style: Fix format of imports
jewertow Nov 24, 2020
1673c80
refactor: Remove redundant function flatJson from tests.
jewertow Nov 24, 2020
320bcea
refactor: Refactor logging
jewertow Nov 24, 2020
4952af8
refactor: Return the wrapped error instead of logging it.
jewertow Nov 24, 2020
43e0f0c
refactor: Use spaces in multi-line strings instead of tabs.
jewertow Nov 24, 2020
ac76c77
feat(api): Extend DataplaneInsight with Version
jewertow Nov 26, 2020
cc0c6d3
feature(kuma-cp): Store dataplane version in dataplane_status_tracker
jewertow Nov 28, 2020
0db6270
fix: Fix parsing node.metadata
jewertow Nov 30, 2020
8bc8fe1
tests: Implement additional tests for function readVersion
jewertow Nov 30, 2020
b5ebc86
fix: Remove redundant log
jewertow Dec 1, 2020
61df91c
refactor: Add comments for fields in .proto file to keep convention
jewertow Dec 1, 2020
52576b8
Merge branch 'master' into feat/kumadp-and-envoy-version-in-dataplane…
jewertow Dec 1, 2020
623e160
fix: Correct parsing Envoy version
jewertow Dec 1, 2020
a285661
Merge branch 'master' into feat/kumadp-and-envoy-version-in-dataplane…
jewertow Dec 2, 2020
d9f2dc8
Merge branch 'master' into feat/kumadp-and-envoy-version-in-dataplane…
jewertow Dec 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
266 changes: 222 additions & 44 deletions api/mesh/v1alpha1/dataplane_insight.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions api/mesh/v1alpha1/dataplane_insight.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ message DiscoverySubscription {
// Status of the ADS subscription.
DiscoverySubscriptionStatus status = 5
[ (validate.rules).message.required = true ];

// Version of Envoy and Kuma dataplane
Version version = 6;
}

// DiscoverySubscriptionStatus defines status of an ADS subscription.
Expand Down Expand Up @@ -93,3 +96,39 @@ message DiscoveryServiceStats {
// Number of xDS responses NACKed by the Dataplane.
uint64 responses_rejected = 3;
}

// Version defines version of Kuma Dataplane and Envoy
message Version {
jakubdyszkiewicz marked this conversation as resolved.
Show resolved Hide resolved

// Version of Kuma Dataplane
KumaDpVersion dpVersion = 1;

// Version of Envoy
EnvoyVersion envoy = 2;
}

// KumaDpVersion describes details of Kuma Dataplane version
message KumaDpVersion {

// Version number of Kuma Dataplane
string version = 1;

// Git tag of Kuma Dataplane version
string gitTag = 2;

// Git commit of Kuma Dataplane version
string gitCommit = 3;

// Build date of Kuma Dataplane version
string buildDate = 4;
}

// EnvoyVersion describes details of Envoy version
message EnvoyVersion {

// Version number of Envoy
string version = 1;

// Full build tag of Envoy version
string build = 2;
}
15 changes: 15 additions & 0 deletions api/mesh/v1alpha1/dataplane_insight_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ func NewSubscriptionStatus() *DiscoverySubscriptionStatus {
}
}

func NewVersion() *Version {
return &Version{
DpVersion: &KumaDpVersion{
Version: "",
GitTag: "",
GitCommit: "",
BuildDate: "",
},
Envoy: &EnvoyVersion{
Version: "",
Build: "",
},
}
}

func (ds *DataplaneInsight) IsOnline() bool {
for _, s := range ds.GetSubscriptions() {
if s.ConnectTime != nil && s.DisconnectTime == nil {
Expand Down
9 changes: 5 additions & 4 deletions app/kuma-dp/cmd/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var _ = Describe("run", func() {
BeforeEach(func() {
backupSetupSignalHandler = core.SetupSignalHandler
backupBootstrapGenerator = bootstrapGenerator
bootstrapGenerator = func(_ string, cfg kumadp.Config, _ *rest.Resource) (proto.Message, error) {
bootstrapGenerator = func(_ string, cfg kumadp.Config, _ *rest.Resource, version envoy.EnvoyVersion) (proto.Message, error) {
bootstrap := envoy_bootstrap.Bootstrap{}
respBytes, err := ioutil.ReadFile(filepath.Join("testdata", "bootstrap-config.golden.yaml"))
Expect(err).ToNot(HaveOccurred())
Expand Down Expand Up @@ -152,13 +152,14 @@ var _ = Describe("run", func() {
Expect(err).ToNot(HaveOccurred())
// and
actualArgs := strings.Split(string(cmdline), "\n")
Expect(actualArgs[0]).To(Equal("-c"))
actualConfigFile := actualArgs[1]
Expect(actualArgs[0]).To(Equal("--version"))
Expect(actualArgs[1]).To(Equal("-c"))
actualConfigFile := actualArgs[2]
Expect(actualConfigFile).To(BeARegularFile())

// then
if given.expectedFile != "" {
Expect(actualArgs[1]).To(Equal(given.expectedFile))
Expect(actualArgs[2]).To(Equal(given.expectedFile))
}

// when
Expand Down
Loading