Skip to content

Commit

Permalink
[v2] Delete more unused code from v2 transition (#790)
Browse files Browse the repository at this point in the history
* Remove more unused code that was including already deleted code.

* Fix all unit tests.

* Fix lint.

* More lint fixes, maybe this time?

* More lint.... really?

* Update NOTICE.txt.
  • Loading branch information
blakerouse authored Jul 27, 2022
1 parent e141de5 commit ff667df
Show file tree
Hide file tree
Showing 36 changed files with 331 additions and 3,146 deletions.
1,208 changes: 182 additions & 1,026 deletions NOTICE.txt

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ require (
github.com/elastic/elastic-agent-autodiscover v0.0.0-20220404145827-89887023c1ab
github.com/elastic/elastic-agent-client/v7 v7.0.0-20220524131921-43bacbeec516
github.com/elastic/elastic-agent-libs v0.2.3
github.com/elastic/elastic-agent-system-metrics v0.3.0
github.com/elastic/go-licenser v0.4.0
github.com/elastic/go-sysinfo v1.7.1
github.com/elastic/go-ucfg v0.8.5
github.com/gofrs/flock v0.8.1
github.com/gofrs/uuid v4.2.0+incompatible
github.com/google/go-cmp v0.5.6
github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.8.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901
Expand Down Expand Up @@ -71,9 +68,7 @@ require (
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v20.10.12+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/elastic/go-structform v0.0.9 // indirect
github.com/elastic/go-windows v1.0.1 // indirect
github.com/elastic/gosigar v0.14.2 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
Expand All @@ -86,6 +81,7 @@ require (
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/licenseclassifier v0.0.0-20200402202327-879cb1424de0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
Expand Down Expand Up @@ -144,7 +140,6 @@ require (
github.com/hashicorp/go-version v1.2.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
go.elastic.co/apm v1.15.0
go.elastic.co/apm/module/apmgorilla v1.15.0
go.elastic.co/apm/module/apmgrpc v1.15.0
k8s.io/klog/v2 v2.30.0 // indirect
)
Expand Down
12 changes: 0 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -385,18 +385,14 @@ github.com/elastic/elastic-agent-autodiscover v0.0.0-20220404145827-89887023c1ab
github.com/elastic/elastic-agent-client/v7 v7.0.0-20220524131921-43bacbeec516 h1:8sGoTlgXRCesR1+FjBv8YY5CyVhNSDjXlo4uq5q1RGM=
github.com/elastic/elastic-agent-client/v7 v7.0.0-20220524131921-43bacbeec516/go.mod h1:fkvyUfFwyAG5OnMF0h+FV9sC0Xn9YLITwQpSuwungQs=
github.com/elastic/elastic-agent-libs v0.0.0-20220303160015-5b4e674da3dd/go.mod h1://82M1l73IHx0wDbS2Tzkq6Fx9fkmytS1KgkIyzvNTM=
github.com/elastic/elastic-agent-libs v0.2.2/go.mod h1:1xDLBhIqBIjhJ7lr2s+xRFFkQHpitSp8q2zzv1Dqg+s=
github.com/elastic/elastic-agent-libs v0.2.3 h1:GY8M0fxOs/GBY2nIB+JOB91aoD72S87iEcm2qVGFUqI=
github.com/elastic/elastic-agent-libs v0.2.3/go.mod h1:1xDLBhIqBIjhJ7lr2s+xRFFkQHpitSp8q2zzv1Dqg+s=
github.com/elastic/elastic-agent-system-metrics v0.3.0 h1:W8L0E8lWJmdguH+oIR7OzuFgopvw8ucZAE9w6iqVlpE=
github.com/elastic/elastic-agent-system-metrics v0.3.0/go.mod h1:RIYhJOS7mUeyIthfOSqmmbEILYSzaDWLi5zQ70bQo+o=
github.com/elastic/elastic-package v0.32.1/go.mod h1:l1fEnF52XRBL6a5h6uAemtdViz2bjtjUtgdQcuRhEAY=
github.com/elastic/go-elasticsearch/v7 v7.16.0/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4=
github.com/elastic/go-elasticsearch/v8 v8.0.0-20210317102009-a9d74cec0186/go.mod h1:xe9a/L2aeOgFKKgrO3ibQTnMdpAeL0GC+5/HpGScSa4=
github.com/elastic/go-licenser v0.3.1/go.mod h1:D8eNQk70FOCVBl3smCGQt/lv7meBeQno2eI1S5apiHQ=
github.com/elastic/go-licenser v0.4.0 h1:jLq6A5SilDS/Iz1ABRkO6BHy91B9jBora8FwGRsDqUI=
github.com/elastic/go-licenser v0.4.0/go.mod h1:V56wHMpmdURfibNBggaSBfqgPxyT1Tldns1i87iTEvU=
github.com/elastic/go-structform v0.0.9 h1:HpcS7xljL4kSyUfDJ8cXTJC6rU5ChL1wYb6cx3HLD+o=
github.com/elastic/go-structform v0.0.9/go.mod h1:CZWf9aIRYY5SuKSmOhtXScE5uQiLZNqAFnwKR4OrIM4=
github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0=
github.com/elastic/go-sysinfo v1.7.1 h1:Wx4DSARcKLllpKT2TnFVdSUJOsybqMYCNQZq1/wO+s0=
Expand All @@ -407,8 +403,6 @@ github.com/elastic/go-ucfg v0.8.5/go.mod h1:4E8mPOLSUV9hQ7sgLEJ4bvt0KhMuDJa8joDT
github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU=
github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0=
github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss=
github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4=
github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
github.com/elastic/package-spec v1.3.0/go.mod h1:KzGTSDqCkdhmL1IFpOH2ZQNSSE9JEhNtndxU3ZrQilA=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
Expand Down Expand Up @@ -646,10 +640,8 @@ github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2c
github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw=
github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
Expand Down Expand Up @@ -1199,8 +1191,6 @@ go.elastic.co/apm v1.13.0/go.mod h1:dylGv2HKR0tiCV+wliJz1KHtDyuD8SPe69oV7VyK6WY=
go.elastic.co/apm v1.15.0 h1:uPk2g/whK7c7XiZyz/YCUnAUBNPiyNeE3ARX3G6Gx7Q=
go.elastic.co/apm v1.15.0/go.mod h1:dylGv2HKR0tiCV+wliJz1KHtDyuD8SPe69oV7VyK6WY=
go.elastic.co/apm/module/apmelasticsearch v1.10.0/go.mod h1:lwoaGDfZzfb9e6TXd3h8/KNmLAONOas7o5NLVNmv8Xk=
go.elastic.co/apm/module/apmgorilla v1.15.0 h1:1yTAksffgaFXYEIwlLRiQnxLfy3p3RtpDw8HDupIJfY=
go.elastic.co/apm/module/apmgorilla v1.15.0/go.mod h1:+23mZudYvZ9VgxCQjseLo9EF5gkKEr0KSQBupw+rzP8=
go.elastic.co/apm/module/apmgrpc v1.15.0 h1:Z7h58uuMJUoYXK6INFunlcGEXZQ18QKAhPh6NFYDNHE=
go.elastic.co/apm/module/apmgrpc v1.15.0/go.mod h1:IEbTGJzY5Xx737PkHDT3bbzh9syovK+IfAlckJsUgPE=
go.elastic.co/apm/module/apmhttp v1.10.0/go.mod h1:Y4timwcJ8sQWbWpcw3Y7Mat1OssNpGhpwyfUnpqIDew=
Expand Down Expand Up @@ -1441,7 +1431,6 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -1564,7 +1553,6 @@ golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//nolint:dupl // duplicate code is in test cases
package fleet

import (
Expand Down Expand Up @@ -322,14 +321,16 @@ func TestFleetGateway(t *testing.T) {

errCh := runFleetGateway(ctx, gateway)

var count int
for {
waitFn()
count++
if count == 4 {
return
func() {
var count int
for {
waitFn()
count++
if count == 4 {
return
}
}
}
}()

cancel()
err = <-errCh
Expand Down
49 changes: 25 additions & 24 deletions internal/pkg/agent/cmd/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package cmd

import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
Expand All @@ -22,8 +21,6 @@ import (
"syscall"
"time"

"github.com/elastic/elastic-agent/internal/pkg/agent/application/upgrade/artifact"

"github.com/spf13/cobra"
"gopkg.in/yaml.v2"

Expand All @@ -33,11 +30,9 @@ import (
"github.com/elastic/elastic-agent/internal/pkg/agent/application/paths"
"github.com/elastic/elastic-agent/internal/pkg/agent/configuration"
"github.com/elastic/elastic-agent/internal/pkg/agent/errors"
"github.com/elastic/elastic-agent/internal/pkg/agent/program"
"github.com/elastic/elastic-agent/internal/pkg/artifact/install/tar"
"github.com/elastic/elastic-agent/internal/pkg/cli"
"github.com/elastic/elastic-agent/internal/pkg/config"
"github.com/elastic/elastic-agent/internal/pkg/release"
"github.com/elastic/elastic-agent/pkg/component"
"github.com/elastic/elastic-agent/pkg/core/logger"
"github.com/elastic/elastic-agent/pkg/core/process"
"github.com/elastic/elastic-agent/version"
Expand Down Expand Up @@ -268,7 +263,7 @@ func runContainerCmd(streams *cli.IOStreams, cfg setupConfig) error {
_, err = os.Stat(paths.AgentConfigFile())
if !os.IsNotExist(err) && !cfg.Fleet.Force {
// already enrolled, just run the standard run
return run(logToStderr)
return run(logToStderr, isContainer)
}

if cfg.Kibana.Fleet.Setup || cfg.FleetServer.Enable {
Expand Down Expand Up @@ -333,7 +328,7 @@ func runContainerCmd(streams *cli.IOStreams, cfg setupConfig) error {
}
}

return run(logToStderr)
return run(logToStderr, isContainer)
}

// TokenResp is used to decode a response for generating a service token
Expand Down Expand Up @@ -700,23 +695,22 @@ func truncateString(b []byte) string {
func runLegacyAPMServer(streams *cli.IOStreams, path string) (*process.Info, error) {
name := "apm-server"
logInfo(streams, "Preparing apm-server for legacy mode.")
cfg := artifact.DefaultConfig()

logInfo(streams, fmt.Sprintf("Extracting apm-server into install directory %s.", path))
installer, err := tar.NewInstaller(cfg)
platform, err := component.LoadPlatformDetail(isContainer)
if err != nil {
return nil, errors.New(err, "creating installer")
return nil, fmt.Errorf("failed to gather system information: %w", err)
}
spec := program.Spec{Name: name, Cmd: name, Artifact: name}
version := release.Version()
if release.Snapshot() {
version = fmt.Sprintf("%s-SNAPSHOT", version)

specs, err := component.LoadRuntimeSpecs(paths.Components(), platform)
if err != nil {
return nil, fmt.Errorf("failed to detect inputs and outputs: %w", err)
}
// Extract the bundled apm-server into the APM_SERVER_PATH
if err := installer.Install(context.Background(), spec, version, path); err != nil {
return nil, errors.New(err,
fmt.Sprintf("installing %s (%s) from %s to %s", spec.Name, version, cfg.TargetDirectory, path))

spec, err := specs.GetInput(name)
if err != nil {
return nil, fmt.Errorf("failed to detect apm-server input: %w", err)
}

// Get the apm-server directory
files, err := ioutil.ReadDir(path)
if err != nil {
Expand All @@ -725,9 +719,7 @@ func runLegacyAPMServer(streams *cli.IOStreams, path string) (*process.Info, err
if len(files) != 1 || !files[0].IsDir() {
return nil, errors.New("expected one directory")
}
apmDir := filepath.Join(path, files[0].Name())
// Start apm-server process respecting path ENVs
apmBinary := filepath.Join(apmDir, spec.Cmd)

// add APM Server specific configuration
var args []string
addEnv := func(arg, env string) {
Expand All @@ -748,7 +740,7 @@ func runLegacyAPMServer(streams *cli.IOStreams, path string) (*process.Info, err
addEnv("--httpprof", "HTTPPROF")
addSettingEnv("gc_percent", "APMSERVER_GOGC")
logInfo(streams, "Starting legacy apm-server daemon as a subprocess.")
return process.Start(apmBinary, os.Geteuid(), os.Getegid(), args, nil)
return process.Start(spec.BinaryPath, os.Geteuid(), os.Getegid(), args, nil)
}

func logToStderr(cfg *configuration.Configuration) {
Expand Down Expand Up @@ -959,3 +951,12 @@ func envIntWithDefault(defVal string, keys ...string) (int, error) {

return strconv.Atoi(valStr)
}

// isContainer changes the platform details to be a container.
//
// Runtime specifications can provide unique configurations when running in a container, this ensures that
// those configurations are used versus the standard Linux configurations.
func isContainer(detail component.PlatformDetail) component.PlatformDetail {
detail.OS = component.Container
return detail
}
11 changes: 6 additions & 5 deletions internal/pkg/agent/cmd/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"io/fs"
"os"
"path/filepath"
"runtime"
"strings"
"text/tabwriter"
"time"
Expand All @@ -29,7 +28,6 @@ import (
"github.com/elastic/elastic-agent/internal/pkg/agent/control/client"
"github.com/elastic/elastic-agent/internal/pkg/agent/control/cproto"
"github.com/elastic/elastic-agent/internal/pkg/agent/errors"
"github.com/elastic/elastic-agent/internal/pkg/agent/program"
"github.com/elastic/elastic-agent/internal/pkg/cli"
"github.com/elastic/elastic-agent/internal/pkg/config/operations"
)
Expand Down Expand Up @@ -562,9 +560,10 @@ func zipLogs(zw *zip.Writer) error {
return err
}

if err := collectEndpointSecurityLogs(zw, program.SupportedMap); err != nil {
return fmt.Errorf("failed to collect endpoint-security logs: %w", err)
}
// TODO(blakerouse): Fix diagnostics for v2
//if err := collectEndpointSecurityLogs(zw, program.SupportedMap); err != nil {
// return fmt.Errorf("failed to collect endpoint-security logs: %w", err)
//}

// using Data() + "/logs", for some reason default paths/Logs() is the home dir...
logPath := filepath.Join(paths.Home(), "logs") + string(filepath.Separator)
Expand Down Expand Up @@ -595,6 +594,7 @@ func zipLogs(zw *zip.Writer) error {
})
}

/*
func collectEndpointSecurityLogs(zw *zip.Writer, specs map[string]program.Spec) error {
spec, ok := specs["endpoint-security"]
if !ok {
Expand Down Expand Up @@ -628,6 +628,7 @@ func collectEndpointSecurityLogs(zw *zip.Writer, specs map[string]program.Spec)
return saveLogs(name, path, zw)
})
}
*/

func saveLogs(name string, logPath string, zw *zip.Writer) error {
lf, err := os.Open(logPath)
Expand Down
4 changes: 3 additions & 1 deletion internal/pkg/agent/cmd/diagnostics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package cmd

/*
import (
"archive/zip"
"bytes"
Expand All @@ -19,7 +21,6 @@ import (
"github.com/stretchr/testify/require"
"github.com/elastic/elastic-agent/internal/pkg/agent/control/client"
"github.com/elastic/elastic-agent/internal/pkg/agent/program"
)
var testDiagnostics = DiagnosticsInfo{
Expand Down Expand Up @@ -137,3 +138,4 @@ func Test_collectEndpointSecurityLogs_noEndpointSecurity(t *testing.T) {
err := collectEndpointSecurityLogs(zw, specs)
assert.NoError(t, err, "collectEndpointSecurityLogs should not return an error")
}
*/
3 changes: 2 additions & 1 deletion internal/pkg/agent/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"github.com/elastic/elastic-agent/internal/pkg/config"
monitoringCfg "github.com/elastic/elastic-agent/internal/pkg/core/monitoring/config"
"github.com/elastic/elastic-agent/internal/pkg/release"
"github.com/elastic/elastic-agent/pkg/component"
"github.com/elastic/elastic-agent/pkg/core/logger"
)

Expand All @@ -57,7 +58,7 @@ func newRunCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Command {
}
}

func run(override cfgOverrider, modifiers ...application.PlatformModifier) error {
func run(override cfgOverrider, modifiers ...component.PlatformModifier) error {
// Windows: Mark service as stopped.
// After this is run, the service is considered by the OS to be stopped.
// This must be the first deferred cleanup task (last to execute).
Expand Down
Loading

0 comments on commit ff667df

Please sign in to comment.