Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/eclipse/paho.mqtt.golang v1.2.1-0.20200121105743-0d940dd29fd2 h1:DW6WrARxK5J+o8uAKCiACi5wy9EK1UzrsCpGBPsKHAA=
github.com/eclipse/paho.mqtt.golang v1.2.1-0.20200121105743-0d940dd29fd2/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts=
github.com/elastic/beats v7.6.2+incompatible h1:jHdLv83KURaqWUC6f55iMyVP6LYZrgElfeqxKWcskVE=
Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops

github.com/elastic/dhcp v0.0.0-20200227161230-57ec251c7eb3 h1:lnDkqiRFKm0rxdljqrj3lotWinO9+jFmeDXIC4gvIQs=
github.com/elastic/dhcp v0.0.0-20200227161230-57ec251c7eb3/go.mod h1:aPqzac6AYkipvp4hufTyMj5PDIphF3+At8zr7r51xjY=
github.com/elastic/ecs v1.5.0 h1:/VEIBsRU4ecq2+U3RPfKNc6bFyomP6qnthYEcQZu8GU=
Expand Down
1 change: 1 addition & 0 deletions x-pack/elastic-agent/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@
- Enable introspecting configuration {pull}18124[18124]
- Follow home path for all config files {pull}18161[18161]
- Use nested objects so fleet can handle metadata correctly {pull}18234[18234]
- Pick up version from libbeat {pull}18350[18350]
4 changes: 2 additions & 2 deletions x-pack/elastic-agent/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ func flagsSet() []string {
isSnapshot, _ := os.LookupEnv(snapshotEnv)

return []string{
fmt.Sprintf(`-X "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release.buildTime=%s"`, ts),
fmt.Sprintf(`-X "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release.commit=%s"`, commitID),
fmt.Sprintf(`-X "github.com/elastic/beats/v7/libbeat/version.buildTime=%s"`, ts),
fmt.Sprintf(`-X "github.com/elastic/beats/v7/libbeat/version.commit=%s"`, commitID),
fmt.Sprintf(` -X "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release.snapshot=%s"`, isSnapshot),
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need this now? I would assume this would be handled by the libbeat part?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you're right i will try it to make sure

}
}
Expand Down
27 changes: 5 additions & 22 deletions x-pack/elastic-agent/pkg/release/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,26 @@ package release
import (
"strconv"
"time"
)

// version is the current version of the elastic-agent.
var version = "8.0.0"

// buildHash is the hash of the current build.
var commit = "<unknown>"

// buildTime when the binary was build
var buildTime = "<unknown>"

// qualifier returns the version qualifier like alpha1.
var qualifier = ""
libbeatVersion "github.com/elastic/beats/v7/libbeat/version"
)

// snapshot is a flag marking build as a snapshot.
var snapshot = ""

// Commit returns the current build hash or unknown if it was not injected in the build process.
func Commit() string {
return commit
return libbeatVersion.Commit()
}

// BuildTime returns the build time of the binaries.
func BuildTime() time.Time {
t, err := time.Parse(time.RFC3339, buildTime)
if err != nil {
return time.Time{}
}
return t
return libbeatVersion.BuildTime()
}

// Version returns the version of the application.
func Version() string {
if qualifier == "" {
return version
}
return version + "-" + qualifier
return libbeatVersion.GetDefaultVersion()
}

// Snapshot returns true if binary was built as snapshot.
Expand Down
42 changes: 0 additions & 42 deletions x-pack/elastic-agent/pkg/release/version_test.go

This file was deleted.