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

[v2] Merge v2 feature branch into main #2064

Merged
merged 7 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from 6 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,122 changes: 366 additions & 756 deletions NOTICE.txt

Large diffs are not rendered by default.

24 changes: 15 additions & 9 deletions cmd/fleet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/elastic/fleet-server/v7/internal/pkg/logger"
"github.com/elastic/fleet-server/v7/internal/pkg/server"
"github.com/elastic/fleet-server/v7/internal/pkg/signal"
"github.com/elastic/fleet-server/v7/internal/pkg/status"
"github.com/elastic/fleet-server/v7/internal/pkg/state"

"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -69,7 +69,6 @@ func getRunCommand(bi build.Info) func(cmd *cobra.Command, args []string) error
}

var l *logger.Logger
var srv server.Server
if agentMode {
cfg, err := config.FromConfig(cliCfg)
if err != nil {
Expand All @@ -80,10 +79,16 @@ func getRunCommand(bi build.Info) func(cmd *cobra.Command, args []string) error
return err
}

srv, err = server.NewAgent(cliCfg, os.Stdin, bi, l)
srv, err := server.NewAgent(cliCfg, os.Stdin, bi, l)
if err != nil {
return err
}

if err := srv.Run(installSignalHandler()); err != nil && !errors.Is(err, context.Canceled) {
log.Error().Err(err).Msg("Exiting")
l.Sync()
return err
}
} else {
cfgPath, err := cmd.Flags().GetString("config")
if err != nil {
Expand All @@ -107,17 +112,18 @@ func getRunCommand(bi build.Info) func(cmd *cobra.Command, args []string) error
return err
}

srv, err = server.NewFleet(cfg, bi, status.NewLog())
srv, err := server.NewFleet(bi, state.NewLog())
if err != nil {
return err
}
}

if err := srv.Run(installSignalHandler()); err != nil && !errors.Is(err, context.Canceled) {
log.Error().Err(err).Msg("Exiting")
l.Sync()
return err
if err := srv.Run(installSignalHandler(), cfg); err != nil && !errors.Is(err, context.Canceled) {
log.Error().Err(err).Msg("Exiting")
l.Sync()
return err
}
}

l.Sync()
return nil
}
Expand Down
233 changes: 0 additions & 233 deletions cmd/fleet/main_integration_test.go

This file was deleted.

48 changes: 22 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.17
require (
github.com/Pallinder/go-randomdata v1.2.0
github.com/dgraph-io/ristretto v0.1.0
github.com/elastic/elastic-agent-client/v7 v7.0.0-20210922110810-e6f1f402a9ed
github.com/elastic/elastic-agent-libs v0.2.3
github.com/elastic/elastic-agent-client/v7 v7.0.0-20221102171927-bc376a4e0f9f
github.com/elastic/elastic-agent-libs v0.2.14
github.com/elastic/elastic-agent-system-metrics v0.3.0
github.com/elastic/go-elasticsearch/v7 v7.16.0
github.com/elastic/go-ucfg v0.8.5
Expand All @@ -21,7 +21,7 @@ require (
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
github.com/pkg/errors v0.9.1
github.com/rs/xid v1.3.0
github.com/rs/zerolog v1.26.1
github.com/rs/zerolog v1.27.0
github.com/spf13/cobra v1.3.0
github.com/stretchr/testify v1.7.0
go.elastic.co/apm v1.15.0
Expand All @@ -30,6 +30,8 @@ require (
go.uber.org/zap v1.21.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
google.golang.org/grpc v1.46.0
google.golang.org/protobuf v1.28.0
)

require (
Expand All @@ -39,57 +41,51 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/elastic/go-licenser v0.4.0 // indirect
github.com/elastic/go-structform v0.0.9 // indirect
github.com/elastic/go-structform v0.0.10 // indirect
github.com/elastic/go-sysinfo v1.7.1 // indirect
github.com/elastic/go-windows v1.0.1 // indirect
github.com/elastic/gosigar v0.14.2 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/magefile/mage v1.13.0 // indirect
github.com/magefile/mage v1.14.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/santhosh-tekuri/jsonschema v1.2.4 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.2.0 // indirect
go.elastic.co/apm/module/apmgrpc v1.15.0 // indirect
go.elastic.co/apm/module/apmhttp v1.15.0 // indirect
go.elastic.co/apm/module/apmhttp/v2 v2.0.0 // indirect
go.elastic.co/apm/v2 v2.0.0 // indirect
go.elastic.co/ecszap v1.0.1 // indirect
go.elastic.co/fastjson v1.1.0 // indirect
go.uber.org/goleak v1.1.12 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.5.1 // indirect
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.9 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/genproto v0.0.0-20220426171045-31bebdecfb46 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
howett.net/plist v1.0.0 // indirect
)

require (
github.com/elastic/elastic-agent v0.0.0-20220510120738-63b682fefc61
github.com/fatih/color v1.13.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/elastic/elastic-agent v0.0.0-20221107053805-657f66dad4bd
github.com/jcchavezs/porto v0.4.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
go.elastic.co/apm/module/apmhttprouter v1.14.0
go.elastic.co/ecszap v1.0.1 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64 // indirect
golang.org/x/tools v0.1.9 // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
google.golang.org/grpc v1.43.0 // indirect
howett.net/plist v1.0.0 // indirect
)

replace (
Expand Down
Loading