Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonQ committed Jan 8, 2024
1 parent 4cfafdd commit 5357c18
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -419,4 +419,4 @@ replace (
// Exclude this version because the version has an invalid checksum.
exclude github.com/docker/distribution v2.8.0+incompatible

replace github.com/elastic/elastic-agent-client/v7 => github.com/AndersonQ/elastic-agent-client/v7 v7.0.0-20240108094727-ab590759de8d
replace github.com/elastic/elastic-agent-client/v7 => github.com/AndersonQ/elastic-agent-client/v7 v7.0.0-20240108150033-8c2dfcb2d868
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN
github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
github.com/AndersonQ/elastic-agent-client/v7 v7.0.0-20240108094727-ab590759de8d h1:4RpV8WPkT+GUlWAOzUevjL1FwD3d9JaxDoKfDxQ1IBw=
github.com/AndersonQ/elastic-agent-client/v7 v7.0.0-20240108094727-ab590759de8d/go.mod h1:arA5Vauukv2jFKcobkXoC/d28/jFFLnxVW1bQEIHDGA=
github.com/AndersonQ/elastic-agent-client/v7 v7.0.0-20240108150033-8c2dfcb2d868 h1:3EM8SWAHL1j6LsX3TLybG9RBfzoAYdmbWMNexWFs/4I=
github.com/AndersonQ/elastic-agent-client/v7 v7.0.0-20240108150033-8c2dfcb2d868/go.mod h1:arA5Vauukv2jFKcobkXoC/d28/jFFLnxVW1bQEIHDGA=
github.com/Azure/azure-amqp-common-go/v3 v3.2.1 h1:uQyDk81yn5hTP1pW4Za+zHzy97/f4vDz9o1d/exI4j4=
github.com/Azure/azure-amqp-common-go/v3 v3.2.1/go.mod h1:O6X1iYHP7s2x7NjUKsXVhkwWrQhxrd+d8/3rRadj4CI=
github.com/Azure/azure-event-hubs-go/v3 v3.3.15 h1:2yAik9gS5Qjs4Z6EM1B6d0tfZJ506B/0oA08JlRQxb8=
Expand Down
8 changes: 0 additions & 8 deletions libbeat/version/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,12 @@ package version

import "time"

// packageVersion is the Elastic Agent's package version. When running in managed
// mode the beats should report the Agent's package version instead its own version.
var packageVersion string

// GetDefaultVersion returns the current libbeat version.
// This method is in a separate file as the version.go file is auto generated
// TODO(AndersonQ): does it need to be changed? in the agent's code there is still a GetDefaultVersion
// with the same behaviour as this one and it's used in several place. And there
// is another function for the package version.
func GetDefaultVersion() string {
if packageVersion != "" {
return packageVersion
}

if qualifier == "" {
return defaultBeatVersion
}
Expand Down
5 changes: 3 additions & 2 deletions x-pack/libbeat/management/managerV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,10 @@ func NewV2AgentManager(config *conf.C, registry *reload.Registry) (lbmanagement.
if err != nil {
return nil, fmt.Errorf("faile dreading connection information from stdin: %w", err)
}

ver := version.GetDefaultVersion()
if connInfo.VersionOverride != "" {
ver = connInfo.VersionOverride
if connInfo.PackageVersion != "" {
ver = connInfo.PackageVersion
}

var agentClient client.V2
Expand Down

0 comments on commit 5357c18

Please sign in to comment.