diff --git a/.travis.yml b/.travis.yml index 5beb1351d0b5..7717c0366f8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -188,13 +188,13 @@ jobs: # Agent - os: linux - before_install: .ci/scripts/travis_has_changes.sh x-pack/agent libbeat || travis_terminate 0 - env: TARGETS="-C x-pack/agent testsuite" + before_install: .ci/scripts/travis_has_changes.sh x-pack/elastic-agent libbeat || travis_terminate 0 + env: TARGETS="-C x-pack/elastic-agent testsuite" go: $TRAVIS_GO_VERSION stage: test - os: osx - before_install: .ci/scripts/travis_has_changes.sh x-pack/agent libbeat || travis_terminate 0 - env: TARGETS="TEST_ENVIRONMENT=0 -C x-pack/agent testsuite" + before_install: .ci/scripts/travis_has_changes.sh x-pack/elastic-agent libbeat || travis_terminate 0 + env: TARGETS="TEST_ENVIRONMENT=0 -C x-pack/elastic-agent testsuite" go: $TRAVIS_GO_VERSION stage: test diff --git a/Makefile b/Makefile index 2d08ff6c959b..d4c810472686 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ BUILD_DIR=$(CURDIR)/build COVERAGE_DIR=$(BUILD_DIR)/coverage -BEATS?=auditbeat filebeat heartbeat journalbeat metricbeat packetbeat winlogbeat x-pack/functionbeat x-pack/agent +BEATS?=auditbeat filebeat heartbeat journalbeat metricbeat packetbeat winlogbeat x-pack/functionbeat x-pack/elastic-agent PROJECTS=libbeat $(BEATS) PROJECTS_ENV=libbeat filebeat metricbeat PYTHON_ENV?=$(BUILD_DIR)/python-env diff --git a/dev-tools/packaging/packages.yml b/dev-tools/packaging/packages.yml index 807bb330350f..4945ea36c12f 100644 --- a/dev-tools/packaging/packages.yml +++ b/dev-tools/packaging/packages.yml @@ -35,11 +35,11 @@ shared: content: > {{ commit }} mode: 0644 - /etc/{{.BeatName}}/agent.reference.yml: - source: 'agent.reference.yml' + /etc/{{.BeatName}}/elastic-agent.reference.yml: + source: 'elastic-agent.reference.yml' mode: 0644 - /etc/{{.BeatName}}/agent.yml: - source: 'agent.yml' + /etc/{{.BeatName}}/elastic-agent.yml: + source: 'elastic-agent.yml' mode: 0600 config: true /usr/share/{{.BeatName}}/bin/{{.BeatName}}-god: @@ -90,11 +90,11 @@ shared: /Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/{{.identifier}}.plist: template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/darwin/launchd-daemon.plist.tmpl' mode: 0644 - /etc/{{.BeatName}}/agent.reference.yml: - source: 'agent.reference.yml' + /etc/{{.BeatName}}/elastic-agent.reference.yml: + source: 'elastic-agent.reference.yml' mode: 0644 - /etc/{{.BeatName}}/agent.yml: - source: 'agent.yml' + /etc/{{.BeatName}}/elastic-agent.yml: + source: 'elastic-agent.yml' mode: 0600 config: true /etc/{{.BeatName}}/data/downloads/filebeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz: @@ -118,11 +118,11 @@ shared: content: > {{ commit }} mode: 0644 - 'agent.reference.yml': - source: 'agent.reference.yml' + 'elastic-agent.reference.yml': + source: 'elastic-agent.reference.yml' mode: 0644 - 'agent.yml': - source: 'agent.yml' + 'elastic-agent.yml': + source: 'elastic-agent.yml' mode: 0600 config: true @@ -163,8 +163,8 @@ shared: user: 'root' linux_capabilities: '' files: - 'agent.yml': - source: 'agent.docker.yml' + 'elastic-agent.yml': + source: 'elastic-agent.docker.yml' mode: 0600 config: true diff --git a/dev-tools/packaging/templates/docker/Dockerfile.agent.tmpl b/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl similarity index 100% rename from dev-tools/packaging/templates/docker/Dockerfile.agent.tmpl rename to dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl diff --git a/dev-tools/packaging/templates/docker/docker-entrypoint.agent.tmpl b/dev-tools/packaging/templates/docker/docker-entrypoint.elastic-agent.tmpl similarity index 100% rename from dev-tools/packaging/templates/docker/docker-entrypoint.agent.tmpl rename to dev-tools/packaging/templates/docker/docker-entrypoint.elastic-agent.tmpl diff --git a/x-pack/agent/pkg/agent/application/configuration_embed.go b/x-pack/agent/pkg/agent/application/configuration_embed.go deleted file mode 100644 index 2276d1d32761..000000000000 --- a/x-pack/agent/pkg/agent/application/configuration_embed.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -// or more contributor license agreements. Licensed under the Elastic License; -// you may not use this file except in compliance with the Elastic License. - -// Code generated by dev-tools/cmd/buildfleetcfg/buildfleetcfg.go - DO NOT EDIT. - -package application - -import "github.com/elastic/beats/v7/x-pack/agent/pkg/packer" - -// DefaultAgentFleetConfig is the content of the default configuration when we enroll a beat, the agent.yml -// will be replaced with this variables. -var DefaultAgentFleetConfig []byte - -func init() { - // Packed File - // _meta/agent.fleet.yml - unpacked := packer.MustUnpack("eJyMVV+Po74Vfe/H2A/wK3+G1VLp9xBnBmMW2IbM2NgvFbYzhsROUBMgUPW7VyZMZqYdVfsQRQJ8zz3nnnv8r2//MLtL9ddK7Y6XP171bnf5YzT629++ockJ//78ez/0JDU3eKRkUL975v7bnPboKdG0LCYE9YRg3nPDWubjkZGNkiQ4sBKpwlw1KzdnFOtebsGekgfFIDYVCTSCbi/8jRIediTUHfOzn2gERpjwguLixLYgrUhSc/Ok8MuhQ9F7DVmCAy0Lbb+rykwxo89sCxw+gj33AlMR6QrzoiSsNYpzLeOi5UZO9ntabixObd9zEzoozl0Rg14cC83WoNltAeQQa7l++MlJ1FEiNSe4k4+nn2gNLtwr9K9m1bAbt2at2gP3ZcdhWLP5m9UexXkvy2TPtqBnDXAq+KJomTgVYTX1iyldg5GVkVuViRYj0BxGk4R6j+C1rbwXJfxilCR3ZJloBKOOrUFHidtyIxT36I0XTFpuorEieFo3K4VGoFMjVOrLlpuil3522T0qLz22rVid1L0njLfb55NCpnZkDKZfzY/+U28Gn2mZOxXJOur96BkMfW6uPSXFlHq3macjWniCWkKlJPyx9FS0wuC9hOG4286zcCjRXUWCI4JFL73gzL3oYD0iYLSvvOjIyszq6tAyObKyeGVQj4zkDveTwOqcxJeBlsUpNUUtYRSm3nsdce+jaDnBvSw3iplw/Ig1Y8egpt6lZt7LjFURV3MfO7+a1ZTF2a0GZC2HL7Yvp1rPXqpRDFxqri0dwT9ZeVCyzK1HDPeRkgaPFWHBV9w+6rnMpmUN6Li/efNqK0YwCIMnRgIHweg4/8ey5XBQMk4CFBc9glb3jRIxbvjsj4vebZcdgZ/mpKSHG+Fph20fLMeB+cBU5Kq/1vD9rIByQOqk0DpTFQkmCaMzj8L5ewQLLbx8rMjs09nHHIZ7WhYt9x5mL97PQHx41xlPqQ9G7smREndKG5DI9cy55nHeo9jy3rzp3osGjIzcZ7Wcc5TwgaaeNhXJawl1z49ZZ/X87z6/5qg74Rc1h4Pd0UGYcM/KfPq1cOWzL92ar8HA/cRBMHC55dnc5it8UEsvsPO+n128eqlI8CpgOMrHk8qeV0P2uFq4uPUO6ou0vdv3a9BJ4jY2C2dfxvlAS9nN/o+Tnnp4Et5tfzmJHkrf5tDmO3rMbM1h8c7dr4tWe2FwPWfmCDpWik+10gb4FcTdTcdcCz9TNiPfso7Oz3IjyfVsd/RWCx8QnD0356mE+sJI6MrVTSurozhuFPeBFiZyKhJ299w/5i2Dt9ynW2Ao0WebW7b3RcPXez2r1wSmtWpHVhbj7nnJS4g7SpKzrcEgdliZWI2t5ywXp4J4RHGi572wuDav/byl5qrTBjwxwmpJrs6tJ2Y9plM75/e631FsM/VlyYu5VsvK/JV6ocuPmw9ew9MHL9j8nnu1z/8H6/HmRzSC7czHZp6PO7m251ZXBF1NSWDvyPtuU/OihMGOMNp6q+fzPaUvbAtqdixmTPuMmajlMR6Xfb73UHp5L0kwZ9eCfWDkWu+2YBIQ7yvCWmbvxDkfDqoiD4qXmaIGO9LDmv9/PoMYrG6FvZOCz/no1rso/BLLercirsu3915a3oCLGEHDysJnxPrxTfOsQ0+FZiZyebyZvZlNqwX3A8bzSeXEuWE/4QcBw85mZEWis+1PQjzaHbb40qu1vX9E845v8+rd29GE4Oca6ZID2NNOtZ553jWjJDigx+w+JzFZ367O6JEO6Xp1zfbgTfsvvWffsbIeuBdofixaSobv93fqzz+//fsv/wkAAP//30VSPA==") - raw, ok := unpacked["_meta/agent.fleet.yml"] - if !ok { - // ensure we have something loaded. - panic("agent.fleet.yml is not included in the binary") - } - DefaultAgentFleetConfig = raw -} diff --git a/x-pack/agent/.gitignore b/x-pack/elastic-agent/.gitignore similarity index 93% rename from x-pack/agent/.gitignore rename to x-pack/elastic-agent/.gitignore index 8ec1b138bbde..cf53b23c7ece 100644 --- a/x-pack/agent/.gitignore +++ b/x-pack/elastic-agent/.gitignore @@ -1,6 +1,6 @@ # agent build/ -agent.dev.yml +elastic-agent.dev.yml pkg/agent/operation/tests/scripts/short--1.0.yml pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86/configurable pkg/agent/operation/tests/scripts/configurablebyfile-1.0-darwin-x86/configurablebyfile diff --git a/x-pack/agent/CHANGELOG.asciidoc b/x-pack/elastic-agent/CHANGELOG.asciidoc similarity index 94% rename from x-pack/agent/CHANGELOG.asciidoc rename to x-pack/elastic-agent/CHANGELOG.asciidoc index 53a58fda05ea..8a202864a1f6 100644 --- a/x-pack/agent/CHANGELOG.asciidoc +++ b/x-pack/elastic-agent/CHANGELOG.asciidoc @@ -9,6 +9,7 @@ ==== Breaking changes +- Rename agent to elastic-agent {pull}17391[17391] ==== Bugfixes diff --git a/x-pack/agent/Dockerfile b/x-pack/elastic-agent/Dockerfile similarity index 100% rename from x-pack/agent/Dockerfile rename to x-pack/elastic-agent/Dockerfile diff --git a/x-pack/agent/Makefile b/x-pack/elastic-agent/Makefile similarity index 100% rename from x-pack/agent/Makefile rename to x-pack/elastic-agent/Makefile diff --git a/x-pack/agent/_meta/common.p1.yml b/x-pack/elastic-agent/_meta/common.p1.yml similarity index 71% rename from x-pack/agent/_meta/common.p1.yml rename to x-pack/elastic-agent/_meta/common.p1.yml index 6c9a9f190e72..0e94bd3c0744 100644 --- a/x-pack/agent/_meta/common.p1.yml +++ b/x-pack/elastic-agent/_meta/common.p1.yml @@ -1,5 +1,5 @@ ###################### Agent Configuration Example ######################### # This file is an example configuration file highlighting only the most common -# options. The agent.reference.yml file from the same directory contains all the +# options. The elastic-agent.reference.yml file from the same directory contains all the # supported options with more comments. You can use it as a reference. diff --git a/x-pack/agent/_meta/common.p2.yml b/x-pack/elastic-agent/_meta/common.p2.yml similarity index 93% rename from x-pack/agent/_meta/common.p2.yml rename to x-pack/elastic-agent/_meta/common.p2.yml index 2fc2da9071e3..0ff0776250e4 100644 --- a/x-pack/agent/_meta/common.p2.yml +++ b/x-pack/elastic-agent/_meta/common.p2.yml @@ -24,9 +24,9 @@ datasources: dataset: system.filesystem management: - # Mode of magement, the agent support two modes of operation: + # Mode of management, the Elastic Agent support two modes of operation: # - # local: The agent will expect to find the inputs configuration in the local file. + # local: The Elastic Agent will expect to find the inputs configuration in the local file. # # Default is local. mode: "local" @@ -65,7 +65,7 @@ management: # Allow fleet to reload his configuration locally on disk. # Notes: Only specific process configuration will be reloaded. reload: - # enabled configure the agent to reload or not the local configuration. + # enabled configure the Elastic Agent to reload or not the local configuration. # # Default is true enabled: true diff --git a/x-pack/agent/_meta/common.reference.p1.yml b/x-pack/elastic-agent/_meta/common.reference.p1.yml similarity index 71% rename from x-pack/agent/_meta/common.reference.p1.yml rename to x-pack/elastic-agent/_meta/common.reference.p1.yml index 6c9a9f190e72..0e94bd3c0744 100644 --- a/x-pack/agent/_meta/common.reference.p1.yml +++ b/x-pack/elastic-agent/_meta/common.reference.p1.yml @@ -1,5 +1,5 @@ ###################### Agent Configuration Example ######################### # This file is an example configuration file highlighting only the most common -# options. The agent.reference.yml file from the same directory contains all the +# options. The elastic-agent.reference.yml file from the same directory contains all the # supported options with more comments. You can use it as a reference. diff --git a/x-pack/agent/_meta/common.reference.p2.yml b/x-pack/elastic-agent/_meta/common.reference.p2.yml similarity index 93% rename from x-pack/agent/_meta/common.reference.p2.yml rename to x-pack/elastic-agent/_meta/common.reference.p2.yml index 97ac70329c31..b27d681bfb9a 100644 --- a/x-pack/agent/_meta/common.reference.p2.yml +++ b/x-pack/elastic-agent/_meta/common.reference.p2.yml @@ -24,9 +24,9 @@ datasources: dataset: system.filesystem management: - # Mode of management, the agent currently only support the following mode: + # Mode of management, the Elastic Agent currently only support the following mode: # - # local: The agent will expect to find the inputs configuration in the local file. + # local: The Elastic Agent will expect to find the inputs configuration in the local file. # # Default is local. mode: local @@ -65,7 +65,7 @@ management: # Allow fleet to reload his configuration locally on disk. # Notes: Only specific process configuration will be reloaded. reload: - # enabled configure the agent to reload or not the local configuration. + # enabled configure the Elastic Agent to reload or not the local configuration. # # Default is true enabled: true diff --git a/x-pack/agent/_meta/agent.docker.yml b/x-pack/elastic-agent/_meta/elastic-agent.docker.yml similarity index 86% rename from x-pack/agent/_meta/agent.docker.yml rename to x-pack/elastic-agent/_meta/elastic-agent.docker.yml index 07f764269b08..07dec01f4a10 100644 --- a/x-pack/agent/_meta/agent.docker.yml +++ b/x-pack/elastic-agent/_meta/elastic-agent.docker.yml @@ -24,9 +24,9 @@ datasources: dataset: system.filesystem management: - # Mode of management, the agent support two modes of operation: + # Mode of management, the Elastic Agent support two modes of operation: # - # local: The agent will expect to find the inputs configuration in the local file. + # local: The Elastic Agent will expect to find the inputs configuration in the local file. # # Default is local. mode: "local" @@ -36,10 +36,10 @@ management: # format in which logs will be written, options are json or default. format: "default" - # Allow the agent to reload his configuration locally on disk. + # Allow the Elastic Agent to reload his configuration locally on disk. # Notes: Only specific process configuration will be reloaded. reload: - # enabled configure the agent to reload or not the local configuration. + # enabled configure the Elastic Agent to reload or not the local configuration. # # Default is true enabled: true @@ -56,7 +56,7 @@ download: # timeout for downloading package timeout: 30s # file path to a public key used for verifying downloaded artifacts - # if not file is present agent will try to load public key from elastic.co website. + # if not file is present Elastic Agent will try to load public key from elastic.co website. pgpfile: "${path.data}/elastic.pgp" # install_path describes the location of installed packages/programs. It is also used # for reading program specifications. diff --git a/x-pack/agent/_meta/agent.fleet.yml b/x-pack/elastic-agent/_meta/elastic-agent.fleet.yml similarity index 94% rename from x-pack/agent/_meta/agent.fleet.yml rename to x-pack/elastic-agent/_meta/elastic-agent.fleet.yml index 883f1c35835f..08304cbaa92d 100644 --- a/x-pack/agent/_meta/agent.fleet.yml +++ b/x-pack/elastic-agent/_meta/elastic-agent.fleet.yml @@ -14,7 +14,7 @@ download: # timeout for downloading package timeout: 30s # file path to a public key used for verifying downloaded artifacts - # if not file is present agent will try to load public key from elastic.co website. + # if not file is present Elastic Agent will try to load public key from elastic.co website. pgpfile: "${path.data}/elastic.pgp" # install_path describes the location of installed packages/programs. It is also used # for reading program specifications. diff --git a/x-pack/agent/_meta/agent.yml b/x-pack/elastic-agent/_meta/elastic-agent.yml similarity index 86% rename from x-pack/agent/_meta/agent.yml rename to x-pack/elastic-agent/_meta/elastic-agent.yml index c17c32405e1f..e0f7acc636de 100644 --- a/x-pack/agent/_meta/agent.yml +++ b/x-pack/elastic-agent/_meta/elastic-agent.yml @@ -24,9 +24,9 @@ datasources: dataset: system.filesystem management: - # Mode of management, the agent support two modes of operation: + # Mode of management, the Elastic Agent support two modes of operation: # - # local: The agent will expect to find the inputs configuration in the local file. + # local: The Elastic Agent will expect to find the inputs configuration in the local file. # # Default is local. mode: "local" @@ -37,10 +37,10 @@ management: # format in which logs will be written, options are json or default. format: "default" - # Allow the agent to reload his configuration locally on disk. + # Allow the Elastic Agent to reload his configuration locally on disk. # Notes: Only specific process configuration will be reloaded. reload: - # enabled configure the agent to reload or not the local configuration. + # enabled configure the Elastic Agent to reload or not the local configuration. # # Default is true enabled: true @@ -57,7 +57,7 @@ download: # timeout for downloading package timeout: 30s # file path to a public key used for verifying downloaded artifacts - # if not file is present agent will try to load public key from elastic.co website. + # if not file is present Elastic Agent will try to load public key from elastic.co website. pgpfile: "${path.data}/elastic.pgp" # install_path describes the location of installed packages/programs. It is also used # for reading program specifications. diff --git a/x-pack/agent/cmd/agent/agent.go b/x-pack/elastic-agent/cmd/elastic-agent/elastic-agent.go similarity index 89% rename from x-pack/agent/cmd/agent/agent.go rename to x-pack/elastic-agent/cmd/elastic-agent/elastic-agent.go index 6b1301ee388b..dd33de565753 100644 --- a/x-pack/agent/cmd/agent/agent.go +++ b/x-pack/elastic-agent/cmd/elastic-agent/elastic-agent.go @@ -10,7 +10,7 @@ import ( "os" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/cmd" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/cmd" ) // main just a wrapper, all commands are defined in 'pkg/agent/cmd'. diff --git a/x-pack/agent/dev-tools/cmd/buildfleetcfg/buildfleetcfg.go b/x-pack/elastic-agent/dev-tools/cmd/buildfleetcfg/buildfleetcfg.go similarity index 87% rename from x-pack/agent/dev-tools/cmd/buildfleetcfg/buildfleetcfg.go rename to x-pack/elastic-agent/dev-tools/cmd/buildfleetcfg/buildfleetcfg.go index 4987fffcce99..b1d6946cff73 100644 --- a/x-pack/agent/dev-tools/cmd/buildfleetcfg/buildfleetcfg.go +++ b/x-pack/elastic-agent/dev-tools/cmd/buildfleetcfg/buildfleetcfg.go @@ -14,7 +14,7 @@ import ( "text/template" "github.com/elastic/beats/v7/licenses" - "github.com/elastic/beats/v7/x-pack/agent/pkg/packer" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/packer" ) var ( @@ -35,9 +35,9 @@ var tmpl = template.Must(template.New("cfg").Parse(` package application -import "github.com/elastic/beats/v7/x-pack/agent/pkg/packer" +import "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/packer" -// DefaultAgentFleetConfig is the content of the default configuration when we enroll a beat, the agent.yml +// DefaultAgentFleetConfig is the content of the default configuration when we enroll a beat, the elastic-agent.yml // will be replaced with this variables. var DefaultAgentFleetConfig []byte @@ -47,10 +47,10 @@ func init() { // {{ $f }} {{ end -}} unpacked := packer.MustUnpack("{{ .Pack }}") - raw, ok := unpacked["_meta/agent.fleet.yml"] + raw, ok := unpacked["_meta/elastic-agent.fleet.yml"] if !ok { // ensure we have something loaded. - panic("agent.fleet.yml is not included in the binary") + panic("elastic-agent.fleet.yml is not included in the binary") } DefaultAgentFleetConfig = raw } diff --git a/x-pack/agent/dev-tools/cmd/buildspec/buildspec.go b/x-pack/elastic-agent/dev-tools/cmd/buildspec/buildspec.go similarity index 94% rename from x-pack/agent/dev-tools/cmd/buildspec/buildspec.go rename to x-pack/elastic-agent/dev-tools/cmd/buildspec/buildspec.go index 7cef6ef9a726..980c3d90d335 100644 --- a/x-pack/agent/dev-tools/cmd/buildspec/buildspec.go +++ b/x-pack/elastic-agent/dev-tools/cmd/buildspec/buildspec.go @@ -14,7 +14,7 @@ import ( "text/template" "github.com/elastic/beats/v7/licenses" - "github.com/elastic/beats/v7/x-pack/agent/pkg/packer" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/packer" ) var ( @@ -38,7 +38,7 @@ package program import ( "strings" - "github.com/elastic/beats/v7/x-pack/agent/pkg/packer" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/packer" ) var Supported []Spec diff --git a/x-pack/agent/dev-tools/cmd/fakewebapi/README.md b/x-pack/elastic-agent/dev-tools/cmd/fakewebapi/README.md similarity index 93% rename from x-pack/agent/dev-tools/cmd/fakewebapi/README.md rename to x-pack/elastic-agent/dev-tools/cmd/fakewebapi/README.md index 23853de9a5c4..43def1b4cc7c 100644 --- a/x-pack/agent/dev-tools/cmd/fakewebapi/README.md +++ b/x-pack/elastic-agent/dev-tools/cmd/fakewebapi/README.md @@ -1,6 +1,6 @@ Fakewebapi is a simple test only Webserver -The server implements the minimal calls and response to do high level testing of the agent: +The server implements the minimal calls and response to do high level testing of the elastic-agent: - Enroll successfully an Agent. - Allow an Agent to periodically check in. diff --git a/x-pack/agent/dev-tools/cmd/fakewebapi/action_example.json b/x-pack/elastic-agent/dev-tools/cmd/fakewebapi/action_example.json similarity index 100% rename from x-pack/agent/dev-tools/cmd/fakewebapi/action_example.json rename to x-pack/elastic-agent/dev-tools/cmd/fakewebapi/action_example.json diff --git a/x-pack/agent/dev-tools/cmd/fakewebapi/checkin.json b/x-pack/elastic-agent/dev-tools/cmd/fakewebapi/checkin.json similarity index 100% rename from x-pack/agent/dev-tools/cmd/fakewebapi/checkin.json rename to x-pack/elastic-agent/dev-tools/cmd/fakewebapi/checkin.json diff --git a/x-pack/agent/dev-tools/cmd/fakewebapi/fetch.sh b/x-pack/elastic-agent/dev-tools/cmd/fakewebapi/fetch.sh similarity index 100% rename from x-pack/agent/dev-tools/cmd/fakewebapi/fetch.sh rename to x-pack/elastic-agent/dev-tools/cmd/fakewebapi/fetch.sh diff --git a/x-pack/agent/dev-tools/cmd/fakewebapi/main.go b/x-pack/elastic-agent/dev-tools/cmd/fakewebapi/main.go similarity index 98% rename from x-pack/agent/dev-tools/cmd/fakewebapi/main.go rename to x-pack/elastic-agent/dev-tools/cmd/fakewebapi/main.go index 27611b784670..3a40641678a7 100644 --- a/x-pack/agent/dev-tools/cmd/fakewebapi/main.go +++ b/x-pack/elastic-agent/dev-tools/cmd/fakewebapi/main.go @@ -18,7 +18,7 @@ import ( "sync" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" ) var ( diff --git a/x-pack/agent/dev-tools/cmd/fakewebapi/push.sh b/x-pack/elastic-agent/dev-tools/cmd/fakewebapi/push.sh similarity index 100% rename from x-pack/agent/dev-tools/cmd/fakewebapi/push.sh rename to x-pack/elastic-agent/dev-tools/cmd/fakewebapi/push.sh diff --git a/x-pack/agent/docker-compose.yml b/x-pack/elastic-agent/docker-compose.yml similarity index 100% rename from x-pack/agent/docker-compose.yml rename to x-pack/elastic-agent/docker-compose.yml diff --git a/x-pack/agent/docs/agent.asciidoc b/x-pack/elastic-agent/docs/elastic-agent.asciidoc similarity index 100% rename from x-pack/agent/docs/agent.asciidoc rename to x-pack/elastic-agent/docs/elastic-agent.asciidoc diff --git a/x-pack/agent/docs/agent_configuration_example.yml b/x-pack/elastic-agent/docs/elastic-agent_configuration_example.yml similarity index 100% rename from x-pack/agent/docs/agent_configuration_example.yml rename to x-pack/elastic-agent/docs/elastic-agent_configuration_example.yml diff --git a/x-pack/agent/agent.docker.yml b/x-pack/elastic-agent/elastic-agent.docker.yml similarity index 86% rename from x-pack/agent/agent.docker.yml rename to x-pack/elastic-agent/elastic-agent.docker.yml index 07f764269b08..07dec01f4a10 100644 --- a/x-pack/agent/agent.docker.yml +++ b/x-pack/elastic-agent/elastic-agent.docker.yml @@ -24,9 +24,9 @@ datasources: dataset: system.filesystem management: - # Mode of management, the agent support two modes of operation: + # Mode of management, the Elastic Agent support two modes of operation: # - # local: The agent will expect to find the inputs configuration in the local file. + # local: The Elastic Agent will expect to find the inputs configuration in the local file. # # Default is local. mode: "local" @@ -36,10 +36,10 @@ management: # format in which logs will be written, options are json or default. format: "default" - # Allow the agent to reload his configuration locally on disk. + # Allow the Elastic Agent to reload his configuration locally on disk. # Notes: Only specific process configuration will be reloaded. reload: - # enabled configure the agent to reload or not the local configuration. + # enabled configure the Elastic Agent to reload or not the local configuration. # # Default is true enabled: true @@ -56,7 +56,7 @@ download: # timeout for downloading package timeout: 30s # file path to a public key used for verifying downloaded artifacts - # if not file is present agent will try to load public key from elastic.co website. + # if not file is present Elastic Agent will try to load public key from elastic.co website. pgpfile: "${path.data}/elastic.pgp" # install_path describes the location of installed packages/programs. It is also used # for reading program specifications. diff --git a/x-pack/agent/agent.reference.yml b/x-pack/elastic-agent/elastic-agent.reference.yml similarity index 91% rename from x-pack/agent/agent.reference.yml rename to x-pack/elastic-agent/elastic-agent.reference.yml index 53cb79b40b51..7b1ee5cca989 100644 --- a/x-pack/agent/agent.reference.yml +++ b/x-pack/elastic-agent/elastic-agent.reference.yml @@ -1,7 +1,7 @@ ###################### Agent Configuration Example ######################### # This file is an example configuration file highlighting only the most common -# options. The agent.reference.yml file from the same directory contains all the +# options. The elastic-agent.reference.yml file from the same directory contains all the # supported options with more comments. You can use it as a reference. ###################################### # Fleet configuration @@ -29,9 +29,9 @@ datasources: dataset: system.filesystem management: - # Mode of management, the agent currently only support the following mode: + # Mode of management, the Elastic Agent currently only support the following mode: # - # local: The agent will expect to find the inputs configuration in the local file. + # local: The Elastic Agent will expect to find the inputs configuration in the local file. # # Default is local. mode: local @@ -70,7 +70,7 @@ management: # Allow fleet to reload his configuration locally on disk. # Notes: Only specific process configuration will be reloaded. reload: - # enabled configure the agent to reload or not the local configuration. + # enabled configure the Elastic Agent to reload or not the local configuration. # # Default is true enabled: true diff --git a/x-pack/agent/agent.yml b/x-pack/elastic-agent/elastic-agent.yml similarity index 91% rename from x-pack/agent/agent.yml rename to x-pack/elastic-agent/elastic-agent.yml index ac4ed658ced7..a5fd150155bd 100644 --- a/x-pack/agent/agent.yml +++ b/x-pack/elastic-agent/elastic-agent.yml @@ -1,7 +1,7 @@ ###################### Agent Configuration Example ######################### # This file is an example configuration file highlighting only the most common -# options. The agent.reference.yml file from the same directory contains all the +# options. The elastic-agent.reference.yml file from the same directory contains all the # supported options with more comments. You can use it as a reference. ###################################### # Fleet configuration @@ -29,9 +29,9 @@ datasources: dataset: system.filesystem management: - # Mode of magement, the agent support two modes of operation: + # Mode of management, the Elastic Agent support two modes of operation: # - # local: The agent will expect to find the inputs configuration in the local file. + # local: The Elastic Agent will expect to find the inputs configuration in the local file. # # Default is local. mode: "local" @@ -70,7 +70,7 @@ management: # Allow fleet to reload his configuration locally on disk. # Notes: Only specific process configuration will be reloaded. reload: - # enabled configure the agent to reload or not the local configuration. + # enabled configure the Elastic Agent to reload or not the local configuration. # # Default is true enabled: true diff --git a/x-pack/agent/magefile.go b/x-pack/elastic-agent/magefile.go similarity index 91% rename from x-pack/agent/magefile.go rename to x-pack/elastic-agent/magefile.go index a9934e941a18..deb05fd4d40c 100644 --- a/x-pack/agent/magefile.go +++ b/x-pack/elastic-agent/magefile.go @@ -22,7 +22,7 @@ import ( devtools "github.com/elastic/beats/v7/dev-tools/mage" "github.com/elastic/beats/v7/dev-tools/mage/target/common" "github.com/elastic/beats/v7/dev-tools/mage/target/unittest" - "github.com/elastic/beats/v7/x-pack/agent/pkg/release" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release" // mage:import _ "github.com/elastic/beats/v7/dev-tools/mage/target/common" @@ -37,6 +37,7 @@ const ( buildDir = "build" metaDir = "_meta" snapshotEnv = "SNAPSHOT" + configFile = "elastic-agent.yml" ) // Aliases for commands required by master makefile @@ -91,17 +92,17 @@ func (Build) All() { mg.Deps(Build.Binary) } -// GenerateConfig generates the configuration from _meta/agent.yml +// GenerateConfig generates the configuration from _meta/elastic-agent.yml func (Build) GenerateConfig() error { mg.Deps(Mkdir(buildDir)) - return sh.Copy(filepath.Join(buildDir, "agent.yml"), filepath.Join(metaDir, "agent.yml")) + return sh.Copy(filepath.Join(buildDir, configFile), filepath.Join(metaDir, configFile)) } // GolangCrossBuildOSS build the Beat binary inside of the golang-builder. // Do not use directly, use crossBuild instead. func GolangCrossBuildOSS() error { params := devtools.DefaultGolangCrossBuildArgs() - params.InputFiles = []string{"cmd/agent/agent.go"} + params.InputFiles = []string{"cmd/elastic-agent/elastic-agent.go"} params.LDFlags = flagsSet() return devtools.GolangCrossBuild(params) } @@ -110,7 +111,7 @@ func GolangCrossBuildOSS() error { // Do not use directly, use crossBuild instead. func GolangCrossBuild() error { params := devtools.DefaultGolangCrossBuildArgs() - params.InputFiles = []string{"cmd/agent/agent.go"} + params.InputFiles = []string{"cmd/elastic-agent/elastic-agent.go"} params.OutputDir = "build/golang-crossbuild" params.LDFlags = flagsSet() if err := devtools.GolangCrossBuild(params); err != nil { @@ -133,9 +134,9 @@ func (Build) BinaryOSS() error { mg.Deps(Prepare.Env) return RunGo( "build", - "-o", filepath.Join(buildDir, "agent-oss"), + "-o", filepath.Join(buildDir, "elastic-agent-oss"), "-ldflags", flags(), - "cmd/agent/agent.go", + "cmd/elastic-agent/elastic-agent.go", ) } @@ -144,9 +145,9 @@ func (Build) Binary() error { mg.Deps(Prepare.Env) return RunGo( "build", - "-o", filepath.Join(buildDir, "agent"), + "-o", filepath.Join(buildDir, "elastic-agent"), "-ldflags", flags(), - "cmd/agent/agent.go", + "cmd/elastic-agent/elastic-agent.go", ) } @@ -156,9 +157,9 @@ func (Build) Dev() error { return RunGo( "build", "-tags", "dev", - "-o", filepath.Join(buildDir, "agent"), + "-o", filepath.Join(buildDir, "elastic-agent"), "-ldflags", flags(), - "cmd/agent/agent.go", + "cmd/elastic-agent/elastic-agent.go", ) } @@ -366,9 +367,9 @@ func flagsSet() []string { isSnapshot, _ := os.LookupEnv(snapshotEnv) return []string{ - fmt.Sprintf(`-X "github.com/elastic/beats/v7/x-pack/agent/pkg/release.buildTime=%s"`, ts), - fmt.Sprintf(`-X "github.com/elastic/beats/v7/x-pack/agent/pkg/release.commit=%s"`, commitID), - fmt.Sprintf(` -X "github.com/elastic/beats/v7/x-pack/agent/pkg/release.snapshot=%s"`, isSnapshot), + 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/x-pack/elastic-agent/pkg/release.snapshot=%s"`, isSnapshot), } } @@ -419,7 +420,7 @@ func ConfigFileParams() devtools.ConfigFileParams { devtools.XPackBeatDir("_meta/common.reference.p2.yml"), }, DockerParts: []string{ - devtools.XPackBeatDir("_meta/agent.docker.yml"), + devtools.XPackBeatDir("_meta/elastic-agent.docker.yml"), }, } } @@ -468,7 +469,7 @@ func IntegTest() { // BuildFleetCfg embed the default fleet configuration as part of the binary. func BuildFleetCfg() error { goF := filepath.Join("dev-tools", "cmd", "buildfleetcfg", "buildfleetcfg.go") - in := filepath.Join("_meta", "agent.fleet.yml") + in := filepath.Join("_meta", "elastic-agent.fleet.yml") out := filepath.Join("pkg", "agent", "application", "configuration_embed.go") fmt.Printf(">> BuildFleetCfg %s to %s\n", in, out) diff --git a/x-pack/agent/main.go b/x-pack/elastic-agent/main.go similarity index 88% rename from x-pack/agent/main.go rename to x-pack/elastic-agent/main.go index db421a72f162..f9bf84484ac1 100644 --- a/x-pack/agent/main.go +++ b/x-pack/elastic-agent/main.go @@ -10,7 +10,7 @@ import ( "os" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/cmd" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/cmd" ) // Setups and Runs agent. diff --git a/x-pack/agent/main_test.go b/x-pack/elastic-agent/main_test.go similarity index 100% rename from x-pack/agent/main_test.go rename to x-pack/elastic-agent/main_test.go diff --git a/x-pack/agent/pkg/agent/application/action_dispatcher.go b/x-pack/elastic-agent/pkg/agent/application/action_dispatcher.go similarity index 92% rename from x-pack/agent/pkg/agent/application/action_dispatcher.go rename to x-pack/elastic-agent/pkg/agent/application/action_dispatcher.go index e37c54683bdd..833f9a984767 100644 --- a/x-pack/agent/pkg/agent/application/action_dispatcher.go +++ b/x-pack/elastic-agent/pkg/agent/application/action_dispatcher.go @@ -10,9 +10,9 @@ import ( "reflect" "strings" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" ) type action = fleetapi.Action diff --git a/x-pack/agent/pkg/agent/application/action_dispatcher_test.go b/x-pack/elastic-agent/pkg/agent/application/action_dispatcher_test.go similarity index 100% rename from x-pack/agent/pkg/agent/application/action_dispatcher_test.go rename to x-pack/elastic-agent/pkg/agent/application/action_dispatcher_test.go diff --git a/x-pack/agent/pkg/agent/application/action_store.go b/x-pack/elastic-agent/pkg/agent/application/action_store.go similarity index 97% rename from x-pack/agent/pkg/agent/application/action_store.go rename to x-pack/elastic-agent/pkg/agent/application/action_store.go index 11260fa6daa4..2da8d3c0a8f0 100644 --- a/x-pack/agent/pkg/agent/application/action_store.go +++ b/x-pack/elastic-agent/pkg/agent/application/action_store.go @@ -10,8 +10,8 @@ import ( yaml "gopkg.in/yaml.v2" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" ) // actionStore receives multiples actions to persist to disk, the implementation of the store only diff --git a/x-pack/agent/pkg/agent/application/action_store_test.go b/x-pack/elastic-agent/pkg/agent/application/action_store_test.go similarity index 93% rename from x-pack/agent/pkg/agent/application/action_store_test.go rename to x-pack/elastic-agent/pkg/agent/application/action_store_test.go index 5859b59ba693..02e62efd1a4e 100644 --- a/x-pack/agent/pkg/agent/application/action_store_test.go +++ b/x-pack/elastic-agent/pkg/agent/application/action_store_test.go @@ -13,9 +13,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/storage" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/storage" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" ) func TestActionStore(t *testing.T) { diff --git a/x-pack/agent/pkg/agent/application/application.go b/x-pack/elastic-agent/pkg/agent/application/application.go similarity index 77% rename from x-pack/agent/pkg/agent/application/application.go rename to x-pack/elastic-agent/pkg/agent/application/application.go index d2e3e4f72e56..786340559894 100644 --- a/x-pack/agent/pkg/agent/application/application.go +++ b/x-pack/elastic-agent/pkg/agent/application/application.go @@ -7,11 +7,11 @@ package application import ( "context" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/application/info" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/warn" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/application/info" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/warn" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) // Application is the application interface implemented by the different running mode. @@ -24,8 +24,8 @@ type Application interface { // New creates a new Agent and bootstrap the required subsystem. func New(log *logger.Logger, pathConfigFile string) (Application, error) { // Load configuration from disk to understand in which mode of operation - // we must start the agent, the mode of operation cannot be changed without restarting the - // agent. + // we must start the elastic-agent, the mode of operation cannot be changed without restarting the + // elastic-agent. config, err := config.LoadYAML(pathConfigFile) if err != nil { return nil, err diff --git a/x-pack/agent/pkg/agent/application/application_test.go b/x-pack/elastic-agent/pkg/agent/application/application_test.go similarity index 100% rename from x-pack/agent/pkg/agent/application/application_test.go rename to x-pack/elastic-agent/pkg/agent/application/application_test.go diff --git a/x-pack/agent/pkg/agent/application/config.go b/x-pack/elastic-agent/pkg/agent/application/config.go similarity index 88% rename from x-pack/agent/pkg/agent/application/config.go rename to x-pack/elastic-agent/pkg/agent/application/config.go index c9a1488ce791..edec6b4c7f8f 100644 --- a/x-pack/agent/pkg/agent/application/config.go +++ b/x-pack/elastic-agent/pkg/agent/application/config.go @@ -8,12 +8,12 @@ import ( "fmt" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/application/info" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/kibana" - fleetreporter "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter/fleet" - logreporter "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter/log" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/application/info" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/kibana" + fleetreporter "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter/fleet" + logreporter "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter/log" ) // TODO(ph) correctly setup global path. @@ -109,7 +109,7 @@ func localConfigDefault() *localConfig { } // FleetAgentConfig is the internal configuration of the agent after the enrollment is done, -// this configuration is not exposed in anyway in the agent.yml and is only internal configuration. +// this configuration is not exposed in anyway in the elastic-agent.yml and is only internal configuration. type FleetAgentConfig struct { API *APIAccess `config:"api" yaml:"api"` Reporting *LogReporting `config:"reporting" yaml:"reporting"` diff --git a/x-pack/agent/pkg/agent/application/config_request.go b/x-pack/elastic-agent/pkg/agent/application/config_request.go similarity index 93% rename from x-pack/agent/pkg/agent/application/config_request.go rename to x-pack/elastic-agent/pkg/agent/application/config_request.go index 52e8cd3b4cdf..ae3c067429fe 100644 --- a/x-pack/agent/pkg/agent/application/config_request.go +++ b/x-pack/elastic-agent/pkg/agent/application/config_request.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" ) const shortID = 8 diff --git a/x-pack/agent/pkg/agent/application/config_request_test.go b/x-pack/elastic-agent/pkg/agent/application/config_request_test.go similarity index 100% rename from x-pack/agent/pkg/agent/application/config_request_test.go rename to x-pack/elastic-agent/pkg/agent/application/config_request_test.go diff --git a/x-pack/agent/pkg/agent/application/config_test.go b/x-pack/elastic-agent/pkg/agent/application/config_test.go similarity index 96% rename from x-pack/agent/pkg/agent/application/config_test.go rename to x-pack/elastic-agent/pkg/agent/application/config_test.go index c1cd3e29459d..688f3d3ed02d 100644 --- a/x-pack/agent/pkg/agent/application/config_test.go +++ b/x-pack/elastic-agent/pkg/agent/application/config_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" ) func TestConfig(t *testing.T) { diff --git a/x-pack/elastic-agent/pkg/agent/application/configuration_embed.go b/x-pack/elastic-agent/pkg/agent/application/configuration_embed.go new file mode 100644 index 000000000000..8a064cf92680 --- /dev/null +++ b/x-pack/elastic-agent/pkg/agent/application/configuration_embed.go @@ -0,0 +1,25 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// Code generated by dev-tools/cmd/buildfleetcfg/buildfleetcfg.go - DO NOT EDIT. + +package application + +import "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/packer" + +// DefaultAgentFleetConfig is the content of the default configuration when we enroll a beat, the elastic-agent.yml +// will be replaced with this variables. +var DefaultAgentFleetConfig []byte + +func init() { + // Packed File + // _meta/elastic-agent.fleet.yml + unpacked := packer.MustUnpack("eJyMlk2Xo7oRhvf5GbPPDR/NnCE7CzdCjKFjfFtfmxwkeQS2ZHNigw05+e85wm53z6Rzz130xkh6q956qqr//eWfdnuu/7Y19encyr/Wens4//bDbLfn30Zrvvz9C5q8+B+//7k/9KyMsHhk5KL/7J3H3/q4Q8+5YbSaEDQTguUgLO94iEdO1lqRaM8p0pW9Gk7XJ5SZQW3AjpEnzSG2NYkMgv4gw7WWAfYUND0Pi+9oBFba+Iyy6sg3YFWTvBH2WePXfY/S9zcUBXtGK+PO1bTQ3JoT3wBPjGAngsjWRPnSvmoFG4Oy0qis6oRVkzvP6NrpNO67sLGHstKXGRjkoTI8Ae12A6CA2Kjk6bsgac+IMoLgXi2P31ECziKozEu7aPkttzbR3V6Eqhcwbvh8ZrFDWTkomu/4Bgy8BV4NXzWjuVcT3rCwmlYJGDlN/ZrmRo7ACJhOCpodgteuDl61DKtRkdJTNDcIpj1PQM+I3wkrtQjYLS+Yd8KmY03wlLQLjUZgVlbqVag6YatBhcV5u9TB6tB1cnHUj5gw3mx+P2pkG09lYHppvw0/xWbxidHSq0nRs+DbwGEcCnsdGKmmVXCr+WpE9zxBo6DWCn67x1R10uKdgvG43cy18BgxfU2iA4LVoILoJIJ07xiRMN3VQXrgtHC+eozmB06rHxyakZPSE2EeOZ/z7HxhtDqubNUomMar4P0d+Yij6gTBg6JrzW08ftSatTPQsODc8OB11qqJb0SIvZd2MRVZcXsD8k7AVxeXVyczSw3KgM/stWMj+Bene61o6RixIkRaWTzWhEef5fbRz3ttOt6CXoTrN1Y7OYKLtHjiJPLQ88NzvXa8HdZaBeYkEuDJw372d+YrARdF8pM7Vwc4QpCPIvA0J9dGhlXHxmgnRhBykk81rcxKu7qDg7zl9hUlaL8N55r1HKYeo97w4e6Fh4v2LV5xKD1Grid6O+/6dmJh3jGLp3t/nkRQNgqaQbQz5487v9R3kFk+8DBvBC169Gy828xITzL4dvPU8ZkUt9pluWGkmll/3NuASUK8qwnvWJB6NYl7OT65Wv4a56c51iSaFExPIkHfkwMYRVAaGRZf77meaxJ1gqQnNM+BtRYHfGYWjwjyQbZOOw2FxXuUvd0tjbwcNYJ+J0x8EWHuWLoWy8WluOciSPpUE98XGzB/RzDyBcmNbG/8SBdjEDmeLtLGO07L6d4LZ0abHxLGo1oedTEtLsVy8X84L0dOnB+Owcio8ae3epSpIydPs48swJMcZ+5mDmWId/NvAfcFvEZvb838zsw17uyjV+5eOR9HlYBBQjwyWnUieNJuBrMg7mVg9pzmLqcGQd7U5OrmsMvp5qGJ/6f3kkNuVJZHL/rOAIka5mZrAvacVkZaN/ccc+rIaXV0e0VaPPeF05UwnmRgWgFfe/RcGW5TX2RrfdsLjrHX3sX+eHd51CrLfb6+6c1vWWOkH+9EiHuVvLPGafGBhdg6NlWWd7O3v2gVM4+LHUpv+bidqFxvu3vLZy0IbsSh0DV99HbLN24PVG6G7xGMe7fDnD8IplbBWdP9ZhkxJ7cLbv38FkP5gwWxLw7rr2j5NsMqt0silJUXTsqOu7xGsHc9vt2ATrTgLEfQclqFnOD+D/OZwDy7OHSzae80LjPzd7Zp8KmWY7cTFJ8fsUDTI+hPCDotZWYe3zwfn3QFsWUUn1Ti2FxMxfKm+1HjpV344l6vijYXEURGHKrO/e/CIfY4zV0PO/2whtirZ+8e+m5evbPtuPj5jf7ONq1pdZzzfPesEXati/FRp2nmNrnocrc4oeXz+Ngfn7Pn2DfbDAzC4l5B04jl8fHty3/+8t8AAAD///ycVl0=") + raw, ok := unpacked["_meta/elastic-agent.fleet.yml"] + if !ok { + // ensure we have something loaded. + panic("elastic-agent.fleet.yml is not included in the binary") + } + DefaultAgentFleetConfig = raw +} diff --git a/x-pack/agent/pkg/agent/application/emitter.go b/x-pack/elastic-agent/pkg/agent/application/emitter.go similarity index 85% rename from x-pack/agent/pkg/agent/application/emitter.go rename to x-pack/elastic-agent/pkg/agent/application/emitter.go index 4d3c0181987f..2e4c07bf0ddb 100644 --- a/x-pack/agent/pkg/agent/application/emitter.go +++ b/x-pack/elastic-agent/pkg/agent/application/emitter.go @@ -7,11 +7,11 @@ package application import ( "strings" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/transpiler" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/transpiler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) type decoratorFunc = func(string, *transpiler.AST, []program.Program) ([]program.Program, error) diff --git a/x-pack/agent/pkg/agent/application/enroll_cmd.go b/x-pack/elastic-agent/pkg/agent/application/enroll_cmd.go similarity index 90% rename from x-pack/agent/pkg/agent/application/enroll_cmd.go rename to x-pack/elastic-agent/pkg/agent/application/enroll_cmd.go index bfcbf09e03f2..b1743e924179 100644 --- a/x-pack/agent/pkg/agent/application/enroll_cmd.go +++ b/x-pack/elastic-agent/pkg/agent/application/enroll_cmd.go @@ -14,12 +14,12 @@ import ( "gopkg.in/yaml.v2" "github.com/elastic/beats/v7/libbeat/common/transport/tlscommon" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/application/info" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/storage" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" - "github.com/elastic/beats/v7/x-pack/agent/pkg/kibana" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/application/info" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/storage" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/kibana" ) type store interface { diff --git a/x-pack/agent/pkg/agent/application/enroll_cmd_test.go b/x-pack/elastic-agent/pkg/agent/application/enroll_cmd_test.go similarity index 97% rename from x-pack/agent/pkg/agent/application/enroll_cmd_test.go rename to x-pack/elastic-agent/pkg/agent/application/enroll_cmd_test.go index 519de8b99e8d..678513f52453 100644 --- a/x-pack/agent/pkg/agent/application/enroll_cmd_test.go +++ b/x-pack/elastic-agent/pkg/agent/application/enroll_cmd_test.go @@ -19,9 +19,9 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/authority" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/authority" ) type mockStore struct { diff --git a/x-pack/agent/pkg/agent/application/error.go b/x-pack/elastic-agent/pkg/agent/application/error.go similarity index 100% rename from x-pack/agent/pkg/agent/application/error.go rename to x-pack/elastic-agent/pkg/agent/application/error.go diff --git a/x-pack/agent/pkg/agent/application/filters/constraints_filter.go b/x-pack/elastic-agent/pkg/agent/application/filters/constraints_filter.go similarity index 94% rename from x-pack/agent/pkg/agent/application/filters/constraints_filter.go rename to x-pack/elastic-agent/pkg/agent/application/filters/constraints_filter.go index 999d5bae9983..9241f3dd3e6f 100644 --- a/x-pack/agent/pkg/agent/application/filters/constraints_filter.go +++ b/x-pack/elastic-agent/pkg/agent/application/filters/constraints_filter.go @@ -10,12 +10,12 @@ import ( "github.com/Masterminds/semver" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/application/info" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/transpiler" - "github.com/elastic/beats/v7/x-pack/agent/pkg/boolexp" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/release" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/application/info" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/transpiler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/boolexp" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release" "github.com/elastic/go-sysinfo" ) diff --git a/x-pack/agent/pkg/agent/application/filters/constraints_filter_test.go b/x-pack/elastic-agent/pkg/agent/application/filters/constraints_filter_test.go similarity index 96% rename from x-pack/agent/pkg/agent/application/filters/constraints_filter_test.go rename to x-pack/elastic-agent/pkg/agent/application/filters/constraints_filter_test.go index e5a05ccd265c..d7a748d7fbdc 100644 --- a/x-pack/agent/pkg/agent/application/filters/constraints_filter_test.go +++ b/x-pack/elastic-agent/pkg/agent/application/filters/constraints_filter_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/elastic/beats/v7/x-pack/agent/pkg/release" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release" ) func TestEvaluation(t *testing.T) { diff --git a/x-pack/agent/pkg/agent/application/fleet_acker.go b/x-pack/elastic-agent/pkg/agent/application/fleet_acker.go similarity index 85% rename from x-pack/agent/pkg/agent/application/fleet_acker.go rename to x-pack/elastic-agent/pkg/agent/application/fleet_acker.go index 46723462d3c2..80529dec4af8 100644 --- a/x-pack/agent/pkg/agent/application/fleet_acker.go +++ b/x-pack/elastic-agent/pkg/agent/application/fleet_acker.go @@ -9,10 +9,10 @@ import ( "fmt" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" - "github.com/elastic/beats/v7/x-pack/agent/pkg/scheduler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/scheduler" ) const fleetTimeFormat = "2006-01-02T15:04:05.99999-07:00" @@ -51,7 +51,7 @@ func (f *actionAcker) Ack(ctx context.Context, action fleetapi.Action) error { _, err := cmd.Execute(ctx, req) if err != nil { - return errors.New(err, fmt.Sprintf("acknowledge action '%s' for agent '%s' failed", action.ID(), agentID), errors.TypeNetwork) + return errors.New(err, fmt.Sprintf("acknowledge action '%s' for elastic-agent '%s' failed", action.ID(), agentID), errors.TypeNetwork) } return nil @@ -72,7 +72,7 @@ func (f *actionAcker) AckBatch(ctx context.Context, actions []fleetapi.Action) e _, err := cmd.Execute(ctx, req) if err != nil { - return errors.New(err, fmt.Sprintf("acknowledge %d actions '%v' for agent '%s' failed", len(actions), actions, agentID), errors.TypeNetwork) + return errors.New(err, fmt.Sprintf("acknowledge %d actions '%v' for elastic-agent '%s' failed", len(actions), actions, agentID), errors.TypeNetwork) } return nil diff --git a/x-pack/agent/pkg/agent/application/fleet_acker_test.go b/x-pack/elastic-agent/pkg/agent/application/fleet_acker_test.go similarity index 91% rename from x-pack/agent/pkg/agent/application/fleet_acker_test.go rename to x-pack/elastic-agent/pkg/agent/application/fleet_acker_test.go index 6a9f3b7f09eb..64d3f51f3e34 100644 --- a/x-pack/agent/pkg/agent/application/fleet_acker_test.go +++ b/x-pack/elastic-agent/pkg/agent/application/fleet_acker_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" ) func TestAcker(t *testing.T) { diff --git a/x-pack/agent/pkg/agent/application/fleet_gateway.go b/x-pack/elastic-agent/pkg/agent/application/fleet_gateway.go similarity index 94% rename from x-pack/agent/pkg/agent/application/fleet_gateway.go rename to x-pack/elastic-agent/pkg/agent/application/fleet_gateway.go index dd6b559972fe..9092033bc5cd 100644 --- a/x-pack/agent/pkg/agent/application/fleet_gateway.go +++ b/x-pack/elastic-agent/pkg/agent/application/fleet_gateway.go @@ -10,10 +10,10 @@ import ( "time" "github.com/elastic/beats/v7/libbeat/common/backoff" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" - "github.com/elastic/beats/v7/x-pack/agent/pkg/scheduler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/scheduler" ) type dispatcher interface { diff --git a/x-pack/agent/pkg/agent/application/fleet_gateway_test.go b/x-pack/elastic-agent/pkg/agent/application/fleet_gateway_test.go similarity index 97% rename from x-pack/agent/pkg/agent/application/fleet_gateway_test.go rename to x-pack/elastic-agent/pkg/agent/application/fleet_gateway_test.go index d02264035ac8..91cf687aa544 100644 --- a/x-pack/agent/pkg/agent/application/fleet_gateway_test.go +++ b/x-pack/elastic-agent/pkg/agent/application/fleet_gateway_test.go @@ -20,10 +20,10 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - repo "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter" - fleetreporter "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter/fleet" - "github.com/elastic/beats/v7/x-pack/agent/pkg/scheduler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + repo "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter" + fleetreporter "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter/fleet" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/scheduler" ) type clientCallbackFunc func(headers http.Header, body io.Reader) (*http.Response, error) diff --git a/x-pack/agent/pkg/agent/application/global_config.go b/x-pack/elastic-agent/pkg/agent/application/global_config.go similarity index 91% rename from x-pack/agent/pkg/agent/application/global_config.go rename to x-pack/elastic-agent/pkg/agent/application/global_config.go index 8dd956d71c3a..44e9f2772ff2 100644 --- a/x-pack/agent/pkg/agent/application/global_config.go +++ b/x-pack/elastic-agent/pkg/agent/application/global_config.go @@ -8,8 +8,8 @@ import ( "os" "path/filepath" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" ) var ( diff --git a/x-pack/agent/pkg/agent/application/handler_action_policy_change.go b/x-pack/elastic-agent/pkg/agent/application/handler_action_policy_change.go similarity index 79% rename from x-pack/agent/pkg/agent/application/handler_action_policy_change.go rename to x-pack/elastic-agent/pkg/agent/application/handler_action_policy_change.go index c17933015421..996811260efa 100644 --- a/x-pack/agent/pkg/agent/application/handler_action_policy_change.go +++ b/x-pack/elastic-agent/pkg/agent/application/handler_action_policy_change.go @@ -8,10 +8,10 @@ import ( "context" "fmt" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" ) type handlerConfigChange struct { diff --git a/x-pack/agent/pkg/agent/application/handler_action_policy_change_test.go b/x-pack/elastic-agent/pkg/agent/application/handler_action_policy_change_test.go similarity index 94% rename from x-pack/agent/pkg/agent/application/handler_action_policy_change_test.go rename to x-pack/elastic-agent/pkg/agent/application/handler_action_policy_change_test.go index a866ef1834fe..400052f66f4d 100644 --- a/x-pack/agent/pkg/agent/application/handler_action_policy_change_test.go +++ b/x-pack/elastic-agent/pkg/agent/application/handler_action_policy_change_test.go @@ -13,9 +13,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" ) type mockEmitter struct { diff --git a/x-pack/agent/pkg/agent/application/handler_default.go b/x-pack/elastic-agent/pkg/agent/application/handler_default.go similarity index 87% rename from x-pack/agent/pkg/agent/application/handler_default.go rename to x-pack/elastic-agent/pkg/agent/application/handler_default.go index 885944520c62..8cbc1985d009 100644 --- a/x-pack/agent/pkg/agent/application/handler_default.go +++ b/x-pack/elastic-agent/pkg/agent/application/handler_default.go @@ -7,7 +7,7 @@ package application import ( "context" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) type handlerDefault struct { diff --git a/x-pack/agent/pkg/agent/application/handler_unknown.go b/x-pack/elastic-agent/pkg/agent/application/handler_unknown.go similarity index 87% rename from x-pack/agent/pkg/agent/application/handler_unknown.go rename to x-pack/elastic-agent/pkg/agent/application/handler_unknown.go index dccbf8bd2828..b263bf6be8d5 100644 --- a/x-pack/agent/pkg/agent/application/handler_unknown.go +++ b/x-pack/elastic-agent/pkg/agent/application/handler_unknown.go @@ -7,7 +7,7 @@ package application import ( "context" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) type handlerUnknown struct { diff --git a/x-pack/agent/pkg/agent/application/info/agent_id.go b/x-pack/elastic-agent/pkg/agent/application/info/agent_id.go similarity index 94% rename from x-pack/agent/pkg/agent/application/info/agent_id.go rename to x-pack/elastic-agent/pkg/agent/application/info/agent_id.go index 89b4494a5e4c..c20f60972f95 100644 --- a/x-pack/agent/pkg/agent/application/info/agent_id.go +++ b/x-pack/elastic-agent/pkg/agent/application/info/agent_id.go @@ -12,9 +12,9 @@ import ( "github.com/gofrs/uuid" "gopkg.in/yaml.v2" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/storage" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/storage" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" ) // AgentConfigFile is a name of file used to store agent information diff --git a/x-pack/agent/pkg/agent/application/info/agent_info.go b/x-pack/elastic-agent/pkg/agent/application/info/agent_info.go similarity index 100% rename from x-pack/agent/pkg/agent/application/info/agent_info.go rename to x-pack/elastic-agent/pkg/agent/application/info/agent_info.go diff --git a/x-pack/agent/pkg/agent/application/lazy_acker.go b/x-pack/elastic-agent/pkg/agent/application/lazy_acker.go similarity index 94% rename from x-pack/agent/pkg/agent/application/lazy_acker.go rename to x-pack/elastic-agent/pkg/agent/application/lazy_acker.go index ea32dc6b8697..58b212ab8e41 100644 --- a/x-pack/agent/pkg/agent/application/lazy_acker.go +++ b/x-pack/elastic-agent/pkg/agent/application/lazy_acker.go @@ -7,7 +7,7 @@ package application import ( "context" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" ) type batchAcker interface { diff --git a/x-pack/agent/pkg/agent/application/lazy_acker_test.go b/x-pack/elastic-agent/pkg/agent/application/lazy_acker_test.go similarity index 95% rename from x-pack/agent/pkg/agent/application/lazy_acker_test.go rename to x-pack/elastic-agent/pkg/agent/application/lazy_acker_test.go index 358363a221d8..cd941e64f836 100644 --- a/x-pack/agent/pkg/agent/application/lazy_acker_test.go +++ b/x-pack/elastic-agent/pkg/agent/application/lazy_acker_test.go @@ -15,8 +15,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" ) func TestLazyAcker(t *testing.T) { diff --git a/x-pack/agent/pkg/agent/application/local_meta.go b/x-pack/elastic-agent/pkg/agent/application/local_meta.go similarity index 89% rename from x-pack/agent/pkg/agent/application/local_meta.go rename to x-pack/elastic-agent/pkg/agent/application/local_meta.go index af3c6b4c977f..47e358b62627 100644 --- a/x-pack/agent/pkg/agent/application/local_meta.go +++ b/x-pack/elastic-agent/pkg/agent/application/local_meta.go @@ -8,7 +8,7 @@ import ( "os" "runtime" - "github.com/elastic/beats/v7/x-pack/agent/pkg/release" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release" ) func metadata() (map[string]interface{}, error) { diff --git a/x-pack/agent/pkg/agent/application/local_mode.go b/x-pack/elastic-agent/pkg/agent/application/local_mode.go similarity index 83% rename from x-pack/agent/pkg/agent/application/local_mode.go rename to x-pack/elastic-agent/pkg/agent/application/local_mode.go index c7cac802a455..58a05bc86d04 100644 --- a/x-pack/agent/pkg/agent/application/local_mode.go +++ b/x-pack/elastic-agent/pkg/agent/application/local_mode.go @@ -7,15 +7,15 @@ package application import ( "context" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/application/filters" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/application/info" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/configrequest" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/dir" - reporting "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter" - logreporter "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter/log" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/application/filters" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/application/info" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/configrequest" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/dir" + reporting "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter" + logreporter "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter/log" ) type emitterFunc func(*config.Config) error diff --git a/x-pack/agent/pkg/agent/application/managed_mode.go b/x-pack/elastic-agent/pkg/agent/application/managed_mode.go similarity index 83% rename from x-pack/agent/pkg/agent/application/managed_mode.go rename to x-pack/elastic-agent/pkg/agent/application/managed_mode.go index bcd64c11164f..5e0ed7182397 100644 --- a/x-pack/agent/pkg/agent/application/managed_mode.go +++ b/x-pack/elastic-agent/pkg/agent/application/managed_mode.go @@ -13,16 +13,16 @@ import ( "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/application/filters" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/application/info" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/storage" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" - reporting "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter" - fleetreporter "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter/fleet" - logreporter "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter/log" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/application/filters" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/application/info" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/storage" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" + reporting "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter" + fleetreporter "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter/fleet" + logreporter "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter/log" ) var gatewaySettings = &fleetGatewaySettings{ @@ -81,7 +81,7 @@ func newManaged( config, err := config.NewConfigFrom(reader) if err != nil { return nil, errors.New(err, - fmt.Sprintf("fail to read configuration %s for the agent", path), + fmt.Sprintf("fail to read configuration %s for the elastic-agent", path), errors.TypeFilesystem, errors.M(errors.MetaKeyPath, path)) } @@ -185,14 +185,14 @@ func newManaged( return managedApplication, nil } -// Start starts a managed agent. +// Start starts a managed elastic-agent. func (m *Managed) Start() error { m.log.Info("Agent is starting") m.gateway.Start() return nil } -// Stop stops a managed agent. +// Stop stops a managed elastic-agent. func (m *Managed) Stop() error { defer m.log.Info("Agent is stopped") m.gateway.Stop() @@ -200,7 +200,7 @@ func (m *Managed) Stop() error { return nil } -// AgentInfo retrieves agent information. +// AgentInfo retrieves elastic-agent information. func (m *Managed) AgentInfo() *info.AgentInfo { return m.agentInfo } diff --git a/x-pack/agent/pkg/agent/application/monitoring_decorator.go b/x-pack/elastic-agent/pkg/agent/application/monitoring_decorator.go similarity index 94% rename from x-pack/agent/pkg/agent/application/monitoring_decorator.go rename to x-pack/elastic-agent/pkg/agent/application/monitoring_decorator.go index 87a69538a509..b6925b56b31a 100644 --- a/x-pack/agent/pkg/agent/application/monitoring_decorator.go +++ b/x-pack/elastic-agent/pkg/agent/application/monitoring_decorator.go @@ -7,8 +7,8 @@ package application import ( "fmt" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/transpiler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/transpiler" ) const ( diff --git a/x-pack/agent/pkg/agent/application/monitoring_decorator_test.go b/x-pack/elastic-agent/pkg/agent/application/monitoring_decorator_test.go similarity index 96% rename from x-pack/agent/pkg/agent/application/monitoring_decorator_test.go rename to x-pack/elastic-agent/pkg/agent/application/monitoring_decorator_test.go index f8b3e4d4bf8f..3d9b52650368 100644 --- a/x-pack/agent/pkg/agent/application/monitoring_decorator_test.go +++ b/x-pack/elastic-agent/pkg/agent/application/monitoring_decorator_test.go @@ -7,8 +7,8 @@ package application import ( "testing" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/transpiler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/transpiler" ) func TestMonitoringInjection(t *testing.T) { diff --git a/x-pack/agent/pkg/agent/application/once.go b/x-pack/elastic-agent/pkg/agent/application/once.go similarity index 85% rename from x-pack/agent/pkg/agent/application/once.go rename to x-pack/elastic-agent/pkg/agent/application/once.go index f67e5d6611d6..e4cb1d6dd90f 100644 --- a/x-pack/agent/pkg/agent/application/once.go +++ b/x-pack/elastic-agent/pkg/agent/application/once.go @@ -5,8 +5,8 @@ package application import ( - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) type once struct { diff --git a/x-pack/agent/pkg/agent/application/periodic.go b/x-pack/elastic-agent/pkg/agent/application/periodic.go similarity index 93% rename from x-pack/agent/pkg/agent/application/periodic.go rename to x-pack/elastic-agent/pkg/agent/application/periodic.go index c16407dbea60..1acf1a97377e 100644 --- a/x-pack/agent/pkg/agent/application/periodic.go +++ b/x-pack/elastic-agent/pkg/agent/application/periodic.go @@ -8,9 +8,9 @@ import ( "strings" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/filewatcher" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/filewatcher" ) type periodic struct { diff --git a/x-pack/agent/pkg/agent/application/router.go b/x-pack/elastic-agent/pkg/agent/application/router.go similarity index 92% rename from x-pack/agent/pkg/agent/application/router.go rename to x-pack/elastic-agent/pkg/agent/application/router.go index 3d4a46f36d20..b48156d7d48c 100644 --- a/x-pack/agent/pkg/agent/application/router.go +++ b/x-pack/elastic-agent/pkg/agent/application/router.go @@ -8,9 +8,9 @@ import ( "fmt" "strings" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/sorted" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/sorted" ) // defautlRK default routing keys until we implement the routing key / config matrix. diff --git a/x-pack/agent/pkg/agent/application/router_test.go b/x-pack/elastic-agent/pkg/agent/application/router_test.go similarity index 97% rename from x-pack/agent/pkg/agent/application/router_test.go rename to x-pack/elastic-agent/pkg/agent/application/router_test.go index 507629f053b6..6edcd145eeaa 100644 --- a/x-pack/agent/pkg/agent/application/router_test.go +++ b/x-pack/elastic-agent/pkg/agent/application/router_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) type rOp int diff --git a/x-pack/agent/pkg/agent/application/stream.go b/x-pack/elastic-agent/pkg/agent/application/stream.go similarity index 79% rename from x-pack/agent/pkg/agent/application/stream.go rename to x-pack/elastic-agent/pkg/agent/application/stream.go index 43334735840b..ab3e6426093f 100644 --- a/x-pack/agent/pkg/agent/application/stream.go +++ b/x-pack/elastic-agent/pkg/agent/application/stream.go @@ -10,14 +10,14 @@ import ( "net/http" "net/url" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/operation" - operatorCfg "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/operation/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/stateresolver" - downloader "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download/localremote" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/install" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation" + operatorCfg "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/stateresolver" + downloader "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download/localremote" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/install" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) // EventProcessor is an processor of application event diff --git a/x-pack/agent/pkg/agent/cmd/cmd_test.go b/x-pack/elastic-agent/pkg/agent/cmd/cmd_test.go similarity index 93% rename from x-pack/agent/pkg/agent/cmd/cmd_test.go rename to x-pack/elastic-agent/pkg/agent/cmd/cmd_test.go index fb0ba3975a7b..52ab81bc0b8e 100644 --- a/x-pack/agent/pkg/agent/cmd/cmd_test.go +++ b/x-pack/elastic-agent/pkg/agent/cmd/cmd_test.go @@ -19,7 +19,7 @@ func TestAgent(t *testing.T) { // t.Run("test run subcommand", func(t *testing.T) { // streams, _, out, _ := cli.NewTestingIOStreams() // cmd := newRunCommandWithArgs(globalFlags{ - // PathConfigFile: filepath.Join("build", "agent.yml"), + // PathConfigFile: filepath.Join("build", "elastic-agent.yml"), // }, []string{}, streams) // cmd.SetOutput(streams.Out) // cmd.Execute() diff --git a/x-pack/agent/pkg/agent/cmd/common.go b/x-pack/elastic-agent/pkg/agent/cmd/common.go similarity index 90% rename from x-pack/agent/pkg/agent/cmd/common.go rename to x-pack/elastic-agent/pkg/agent/cmd/common.go index 7c8019f3c616..0189f8e408d8 100644 --- a/x-pack/agent/pkg/agent/cmd/common.go +++ b/x-pack/elastic-agent/pkg/agent/cmd/common.go @@ -11,11 +11,11 @@ import ( "github.com/spf13/cobra" - "github.com/elastic/beats/v7/x-pack/agent/pkg/basecmd" - "github.com/elastic/beats/v7/x-pack/agent/pkg/cli" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/basecmd" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/cli" ) -var defaultConfig = "agent.yml" +var defaultConfig = "elastic-agent.yml" type globalFlags struct { PathConfigFile string @@ -45,7 +45,7 @@ func NewCommand() *cobra.Command { // NewCommandWithArgs returns a new agent with the flags and the subcommand. func NewCommandWithArgs(args []string, streams *cli.IOStreams) *cobra.Command { cmd := &cobra.Command{ - Use: "agent [subcommand]", + Use: "elastic-agent [subcommand]", } flags := &globalFlags{} diff --git a/x-pack/agent/pkg/agent/cmd/enroll.go b/x-pack/elastic-agent/pkg/agent/cmd/enroll.go similarity index 88% rename from x-pack/agent/pkg/agent/cmd/enroll.go rename to x-pack/elastic-agent/pkg/agent/cmd/enroll.go index d61804e9ba7c..a2a7ee48d220 100644 --- a/x-pack/agent/pkg/agent/cmd/enroll.go +++ b/x-pack/elastic-agent/pkg/agent/cmd/enroll.go @@ -13,12 +13,12 @@ import ( "github.com/spf13/cobra" c "github.com/elastic/beats/v7/libbeat/common/cli" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/application" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/warn" - "github.com/elastic/beats/v7/x-pack/agent/pkg/cli" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/application" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/warn" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/cli" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) var defaultDelay = 1 * time.Second diff --git a/x-pack/agent/pkg/agent/cmd/run.go b/x-pack/elastic-agent/pkg/agent/cmd/run.go similarity index 78% rename from x-pack/agent/pkg/agent/cmd/run.go rename to x-pack/elastic-agent/pkg/agent/cmd/run.go index 9bddb41f2e69..f0196ba7875e 100644 --- a/x-pack/agent/pkg/agent/cmd/run.go +++ b/x-pack/elastic-agent/pkg/agent/cmd/run.go @@ -12,17 +12,17 @@ import ( "github.com/spf13/cobra" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/application" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/cli" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/application" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/cli" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) func newRunCommandWithArgs(flags *globalFlags, _ []string, streams *cli.IOStreams) *cobra.Command { return &cobra.Command{ Use: "run", - Short: "Start the agent.", + Short: "Start the elastic-agent.", Run: func(_ *cobra.Command, _ []string) { if err := run(flags, streams); err != nil { fmt.Fprintf(streams.Err, "%v\n", err) diff --git a/x-pack/agent/pkg/agent/configrequest/request.go b/x-pack/elastic-agent/pkg/agent/configrequest/request.go similarity index 86% rename from x-pack/agent/pkg/agent/configrequest/request.go rename to x-pack/elastic-agent/pkg/agent/configrequest/request.go index 2c29513ed766..b3cb3063eccd 100644 --- a/x-pack/agent/pkg/agent/configrequest/request.go +++ b/x-pack/elastic-agent/pkg/agent/configrequest/request.go @@ -7,7 +7,7 @@ package configrequest import ( "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" ) // Request is the minimal interface a config request must have. diff --git a/x-pack/agent/pkg/agent/configrequest/step.go b/x-pack/elastic-agent/pkg/agent/configrequest/step.go similarity index 100% rename from x-pack/agent/pkg/agent/configrequest/step.go rename to x-pack/elastic-agent/pkg/agent/configrequest/step.go diff --git a/x-pack/agent/pkg/agent/errors/error.go b/x-pack/elastic-agent/pkg/agent/errors/error.go similarity index 100% rename from x-pack/agent/pkg/agent/errors/error.go rename to x-pack/elastic-agent/pkg/agent/errors/error.go diff --git a/x-pack/agent/pkg/agent/errors/error_test.go b/x-pack/elastic-agent/pkg/agent/errors/error_test.go similarity index 100% rename from x-pack/agent/pkg/agent/errors/error_test.go rename to x-pack/elastic-agent/pkg/agent/errors/error_test.go diff --git a/x-pack/agent/pkg/agent/errors/generators.go b/x-pack/elastic-agent/pkg/agent/errors/generators.go similarity index 100% rename from x-pack/agent/pkg/agent/errors/generators.go rename to x-pack/elastic-agent/pkg/agent/errors/generators.go diff --git a/x-pack/agent/pkg/agent/errors/types.go b/x-pack/elastic-agent/pkg/agent/errors/types.go similarity index 100% rename from x-pack/agent/pkg/agent/errors/types.go rename to x-pack/elastic-agent/pkg/agent/errors/types.go diff --git a/x-pack/agent/pkg/agent/internal/yamltest/yaml.go b/x-pack/elastic-agent/pkg/agent/internal/yamltest/yaml.go similarity index 100% rename from x-pack/agent/pkg/agent/internal/yamltest/yaml.go rename to x-pack/elastic-agent/pkg/agent/internal/yamltest/yaml.go diff --git a/x-pack/agent/pkg/agent/operation/common_test.go b/x-pack/elastic-agent/pkg/agent/operation/common_test.go similarity index 71% rename from x-pack/agent/pkg/agent/operation/common_test.go rename to x-pack/elastic-agent/pkg/agent/operation/common_test.go index 3985f296173c..a50b4dfc7a03 100644 --- a/x-pack/agent/pkg/agent/operation/common_test.go +++ b/x-pack/elastic-agent/pkg/agent/operation/common_test.go @@ -9,17 +9,17 @@ import ( "testing" "time" - operatorCfg "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/operation/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/stateresolver" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/install" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app/monitoring" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/process" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/retry" + operatorCfg "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/stateresolver" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/install" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app/monitoring" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/process" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/retry" ) var installPath = "tests/scripts" diff --git a/x-pack/agent/pkg/agent/operation/config/config.go b/x-pack/elastic-agent/pkg/agent/operation/config/config.go similarity index 67% rename from x-pack/agent/pkg/agent/operation/config/config.go rename to x-pack/elastic-agent/pkg/agent/operation/config/config.go index 35ff517f8bf1..74a4212e83ca 100644 --- a/x-pack/agent/pkg/agent/operation/config/config.go +++ b/x-pack/elastic-agent/pkg/agent/operation/config/config.go @@ -5,10 +5,10 @@ package config import ( - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app/monitoring" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/process" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/retry" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app/monitoring" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/process" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/retry" ) // Config is an operator configuration diff --git a/x-pack/agent/pkg/agent/operation/event_processor.go b/x-pack/elastic-agent/pkg/agent/operation/event_processor.go similarity index 100% rename from x-pack/agent/pkg/agent/operation/event_processor.go rename to x-pack/elastic-agent/pkg/agent/operation/event_processor.go diff --git a/x-pack/agent/pkg/agent/operation/monitoring.go b/x-pack/elastic-agent/pkg/agent/operation/monitoring.go similarity index 95% rename from x-pack/agent/pkg/agent/operation/monitoring.go rename to x-pack/elastic-agent/pkg/agent/operation/monitoring.go index c00eb605731e..8157bf9e876d 100644 --- a/x-pack/agent/pkg/agent/operation/monitoring.go +++ b/x-pack/elastic-agent/pkg/agent/operation/monitoring.go @@ -7,11 +7,11 @@ package operation import ( "github.com/hashicorp/go-multierror" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/configrequest" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app/monitoring" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/configrequest" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app/monitoring" ) const ( diff --git a/x-pack/agent/pkg/agent/operation/monitoring_test.go b/x-pack/elastic-agent/pkg/agent/operation/monitoring_test.go similarity index 85% rename from x-pack/agent/pkg/agent/operation/monitoring_test.go rename to x-pack/elastic-agent/pkg/agent/operation/monitoring_test.go index 4b2ae2b444ef..4ae08d4001c7 100644 --- a/x-pack/agent/pkg/agent/operation/monitoring_test.go +++ b/x-pack/elastic-agent/pkg/agent/operation/monitoring_test.go @@ -9,16 +9,16 @@ import ( "testing" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/configrequest" - operatorCfg "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/operation/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/stateresolver" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app/monitoring" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app/monitoring/beats" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/process" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/retry" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/state" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/configrequest" + operatorCfg "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/stateresolver" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app/monitoring" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app/monitoring/beats" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/process" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/retry" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/state" ) func TestGenerateSteps(t *testing.T) { diff --git a/x-pack/agent/pkg/agent/operation/operation.go b/x-pack/elastic-agent/pkg/agent/operation/operation.go similarity index 90% rename from x-pack/agent/pkg/agent/operation/operation.go rename to x-pack/elastic-agent/pkg/agent/operation/operation.go index b18fab74db1b..00545d3b34e8 100644 --- a/x-pack/agent/pkg/agent/operation/operation.go +++ b/x-pack/elastic-agent/pkg/agent/operation/operation.go @@ -7,8 +7,8 @@ package operation import ( "context" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app/monitoring" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/state" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app/monitoring" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/state" ) // operation is an operation definition diff --git a/x-pack/agent/pkg/agent/operation/operation_config.go b/x-pack/elastic-agent/pkg/agent/operation/operation_config.go similarity index 89% rename from x-pack/agent/pkg/agent/operation/operation_config.go rename to x-pack/elastic-agent/pkg/agent/operation/operation_config.go index 92722eba0dce..b50aef4de7a6 100644 --- a/x-pack/agent/pkg/agent/operation/operation_config.go +++ b/x-pack/elastic-agent/pkg/agent/operation/operation_config.go @@ -7,9 +7,9 @@ package operation import ( "context" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/operation/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) var ( diff --git a/x-pack/agent/pkg/agent/operation/operation_fetch.go b/x-pack/elastic-agent/pkg/agent/operation/operation_fetch.go similarity index 87% rename from x-pack/agent/pkg/agent/operation/operation_fetch.go rename to x-pack/elastic-agent/pkg/agent/operation/operation_fetch.go index df1556544f2d..3c25287e1c71 100644 --- a/x-pack/agent/pkg/agent/operation/operation_fetch.go +++ b/x-pack/elastic-agent/pkg/agent/operation/operation_fetch.go @@ -8,11 +8,11 @@ import ( "context" "os" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/operation/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) // operationFetch fetches artifact from preconfigured source diff --git a/x-pack/agent/pkg/agent/operation/operation_install.go b/x-pack/elastic-agent/pkg/agent/operation/operation_install.go similarity index 86% rename from x-pack/agent/pkg/agent/operation/operation_install.go rename to x-pack/elastic-agent/pkg/agent/operation/operation_install.go index 6f1ac2b12e4a..34faf9a7fc27 100644 --- a/x-pack/agent/pkg/agent/operation/operation_install.go +++ b/x-pack/elastic-agent/pkg/agent/operation/operation_install.go @@ -8,10 +8,10 @@ import ( "context" "os" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/operation/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/install" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/install" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) // operationInstall installs a artifact from predefined location diff --git a/x-pack/agent/pkg/agent/operation/operation_remove.go b/x-pack/elastic-agent/pkg/agent/operation/operation_remove.go similarity index 94% rename from x-pack/agent/pkg/agent/operation/operation_remove.go rename to x-pack/elastic-agent/pkg/agent/operation/operation_remove.go index 4d93d5850958..fb3370ba156a 100644 --- a/x-pack/agent/pkg/agent/operation/operation_remove.go +++ b/x-pack/elastic-agent/pkg/agent/operation/operation_remove.go @@ -7,7 +7,7 @@ package operation import ( "context" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" ) // operationRemove uninstall and removes all the bits related to the artifact diff --git a/x-pack/agent/pkg/agent/operation/operation_start.go b/x-pack/elastic-agent/pkg/agent/operation/operation_start.go similarity index 83% rename from x-pack/agent/pkg/agent/operation/operation_start.go rename to x-pack/elastic-agent/pkg/agent/operation/operation_start.go index f09c5dc85e31..5b10ef8b248e 100644 --- a/x-pack/agent/pkg/agent/operation/operation_start.go +++ b/x-pack/elastic-agent/pkg/agent/operation/operation_start.go @@ -7,11 +7,11 @@ package operation import ( "context" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/operation/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/process" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/process" ) // operationStart start installed process diff --git a/x-pack/agent/pkg/agent/operation/operation_stop.go b/x-pack/elastic-agent/pkg/agent/operation/operation_stop.go similarity index 88% rename from x-pack/agent/pkg/agent/operation/operation_stop.go rename to x-pack/elastic-agent/pkg/agent/operation/operation_stop.go index de7809612c01..b6206fd0d54c 100644 --- a/x-pack/agent/pkg/agent/operation/operation_stop.go +++ b/x-pack/elastic-agent/pkg/agent/operation/operation_stop.go @@ -7,9 +7,9 @@ package operation import ( "context" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/operation/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) // operationStop stops the running process diff --git a/x-pack/agent/pkg/agent/operation/operation_verify.go b/x-pack/elastic-agent/pkg/agent/operation/operation_verify.go similarity index 95% rename from x-pack/agent/pkg/agent/operation/operation_verify.go rename to x-pack/elastic-agent/pkg/agent/operation/operation_verify.go index b2ab818eb7d8..b0957ef20602 100644 --- a/x-pack/agent/pkg/agent/operation/operation_verify.go +++ b/x-pack/elastic-agent/pkg/agent/operation/operation_verify.go @@ -7,7 +7,7 @@ package operation import ( "context" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" ) // operationVerify verifies downloaded artifact for correct signature diff --git a/x-pack/agent/pkg/agent/operation/operator.go b/x-pack/elastic-agent/pkg/agent/operation/operator.go similarity index 87% rename from x-pack/agent/pkg/agent/operation/operator.go rename to x-pack/elastic-agent/pkg/agent/operation/operator.go index 9eee74af1cf2..6aed0d802f3f 100644 --- a/x-pack/agent/pkg/agent/operation/operator.go +++ b/x-pack/elastic-agent/pkg/agent/operation/operator.go @@ -12,20 +12,20 @@ import ( "sync" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/configrequest" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - operatorCfg "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/operation/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/stateresolver" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/install" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app/monitoring" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/retry" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/state" - rconfig "github.com/elastic/beats/v7/x-pack/agent/pkg/core/remoteconfig/grpc" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/configrequest" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + operatorCfg "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/stateresolver" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/install" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app/monitoring" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/retry" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/state" + rconfig "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/remoteconfig/grpc" ) // Operator runs Start/Stop/Update operations diff --git a/x-pack/agent/pkg/agent/operation/operator_handlers.go b/x-pack/elastic-agent/pkg/agent/operation/operator_handlers.go similarity index 88% rename from x-pack/agent/pkg/agent/operation/operator_handlers.go rename to x-pack/elastic-agent/pkg/agent/operation/operator_handlers.go index 34022763bcba..3e7d796f7a3b 100644 --- a/x-pack/agent/pkg/agent/operation/operator_handlers.go +++ b/x-pack/elastic-agent/pkg/agent/operation/operator_handlers.go @@ -7,11 +7,11 @@ package operation import ( "fmt" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/configrequest" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app" - "github.com/elastic/beats/v7/x-pack/agent/pkg/release" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/configrequest" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release" ) type handleFunc func(step configrequest.Step) error diff --git a/x-pack/agent/pkg/agent/operation/operator_test.go b/x-pack/elastic-agent/pkg/agent/operation/operator_test.go similarity index 97% rename from x-pack/agent/pkg/agent/operation/operator_test.go rename to x-pack/elastic-agent/pkg/agent/operation/operator_test.go index 07e24f69ef3d..ea763f7e8753 100644 --- a/x-pack/agent/pkg/agent/operation/operator_test.go +++ b/x-pack/elastic-agent/pkg/agent/operation/operator_test.go @@ -14,10 +14,10 @@ import ( "testing" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/state" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/state" ) func TestMain(m *testing.M) { diff --git a/x-pack/agent/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86/README.md b/x-pack/elastic-agent/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86/README.md similarity index 100% rename from x-pack/agent/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86/README.md rename to x-pack/elastic-agent/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86/README.md diff --git a/x-pack/agent/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86/main.go b/x-pack/elastic-agent/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86/main.go similarity index 90% rename from x-pack/agent/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86/main.go rename to x-pack/elastic-agent/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86/main.go index 78bfeaf2f9d7..0ca3be9192f0 100644 --- a/x-pack/agent/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86/main.go +++ b/x-pack/elastic-agent/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86/main.go @@ -11,8 +11,8 @@ import ( "gopkg.in/yaml.v2" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/server" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/remoteconfig/grpc" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/server" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/remoteconfig/grpc" ) func main() { diff --git a/x-pack/agent/pkg/agent/operation/tests/scripts/configurablebyfile-1.0-darwin-x86/README.md b/x-pack/elastic-agent/pkg/agent/operation/tests/scripts/configurablebyfile-1.0-darwin-x86/README.md similarity index 100% rename from x-pack/agent/pkg/agent/operation/tests/scripts/configurablebyfile-1.0-darwin-x86/README.md rename to x-pack/elastic-agent/pkg/agent/operation/tests/scripts/configurablebyfile-1.0-darwin-x86/README.md diff --git a/x-pack/agent/pkg/agent/operation/tests/scripts/configurablebyfile-1.0-darwin-x86/main.go b/x-pack/elastic-agent/pkg/agent/operation/tests/scripts/configurablebyfile-1.0-darwin-x86/main.go similarity index 100% rename from x-pack/agent/pkg/agent/operation/tests/scripts/configurablebyfile-1.0-darwin-x86/main.go rename to x-pack/elastic-agent/pkg/agent/operation/tests/scripts/configurablebyfile-1.0-darwin-x86/main.go diff --git a/x-pack/agent/pkg/agent/operation/tests/scripts/long-1.0-darwin-x86/README.md b/x-pack/elastic-agent/pkg/agent/operation/tests/scripts/long-1.0-darwin-x86/README.md similarity index 100% rename from x-pack/agent/pkg/agent/operation/tests/scripts/long-1.0-darwin-x86/README.md rename to x-pack/elastic-agent/pkg/agent/operation/tests/scripts/long-1.0-darwin-x86/README.md diff --git a/x-pack/agent/pkg/agent/operation/tests/scripts/short-1.0-darwin-x86/README.md b/x-pack/elastic-agent/pkg/agent/operation/tests/scripts/short-1.0-darwin-x86/README.md similarity index 100% rename from x-pack/agent/pkg/agent/operation/tests/scripts/short-1.0-darwin-x86/README.md rename to x-pack/elastic-agent/pkg/agent/operation/tests/scripts/short-1.0-darwin-x86/README.md diff --git a/x-pack/agent/pkg/agent/program/methods.go b/x-pack/elastic-agent/pkg/agent/program/methods.go similarity index 96% rename from x-pack/agent/pkg/agent/program/methods.go rename to x-pack/elastic-agent/pkg/agent/program/methods.go index ce774144d86a..c47fca5928f0 100644 --- a/x-pack/agent/pkg/agent/program/methods.go +++ b/x-pack/elastic-agent/pkg/agent/program/methods.go @@ -7,8 +7,8 @@ package program import ( "fmt" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/transpiler" - "github.com/elastic/beats/v7/x-pack/agent/pkg/boolexp" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/transpiler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/boolexp" ) type env struct { diff --git a/x-pack/agent/pkg/agent/program/program.go b/x-pack/elastic-agent/pkg/agent/program/program.go similarity index 96% rename from x-pack/agent/pkg/agent/program/program.go rename to x-pack/elastic-agent/pkg/agent/program/program.go index 344a54e743a4..f9fd50983d74 100644 --- a/x-pack/agent/pkg/agent/program/program.go +++ b/x-pack/elastic-agent/pkg/agent/program/program.go @@ -8,9 +8,9 @@ import ( "fmt" "strings" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/transpiler" - "github.com/elastic/beats/v7/x-pack/agent/pkg/boolexp" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/transpiler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/boolexp" ) // Program represents a program that must be started or must run. @@ -102,7 +102,7 @@ func detectPrograms(singleConfig *transpiler.AST) ([]Program, error) { } -// KnownProgramNames returns a list of runnable programs by the agent. +// KnownProgramNames returns a list of runnable programs by the elastic-agent. func KnownProgramNames() []string { names := make([]string, len(Supported)) for idx, program := range Supported { diff --git a/x-pack/agent/pkg/agent/program/program_test.go b/x-pack/elastic-agent/pkg/agent/program/program_test.go similarity index 97% rename from x-pack/agent/pkg/agent/program/program_test.go rename to x-pack/elastic-agent/pkg/agent/program/program_test.go index af5e61751bb4..85d471c65834 100644 --- a/x-pack/agent/pkg/agent/program/program_test.go +++ b/x-pack/elastic-agent/pkg/agent/program/program_test.go @@ -16,10 +16,10 @@ import ( "github.com/stretchr/testify/require" yaml "gopkg.in/yaml.v2" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/application/filters" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/internal/yamltest" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/transpiler" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/application/filters" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/internal/yamltest" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/transpiler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) func TestGroupBy(t *testing.T) { diff --git a/x-pack/agent/pkg/agent/program/spec.go b/x-pack/elastic-agent/pkg/agent/program/spec.go similarity index 94% rename from x-pack/agent/pkg/agent/program/spec.go rename to x-pack/elastic-agent/pkg/agent/program/spec.go index c9cfe9a7d0ba..492b6a58ce5a 100644 --- a/x-pack/agent/pkg/agent/program/spec.go +++ b/x-pack/elastic-agent/pkg/agent/program/spec.go @@ -13,8 +13,8 @@ import ( "gopkg.in/yaml.v2" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/transpiler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/transpiler" ) // ErrMissingWhen is returned when no boolean expression is defined for a program. diff --git a/x-pack/agent/pkg/agent/program/spec_test.go b/x-pack/elastic-agent/pkg/agent/program/spec_test.go similarity index 97% rename from x-pack/agent/pkg/agent/program/spec_test.go rename to x-pack/elastic-agent/pkg/agent/program/spec_test.go index fd3db0374b23..cc95b627fa2e 100644 --- a/x-pack/agent/pkg/agent/program/spec_test.go +++ b/x-pack/elastic-agent/pkg/agent/program/spec_test.go @@ -16,7 +16,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/yaml.v2" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/transpiler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/transpiler" ) func TestSerialization(t *testing.T) { diff --git a/x-pack/agent/pkg/agent/program/supported.go b/x-pack/elastic-agent/pkg/agent/program/supported.go similarity index 97% rename from x-pack/agent/pkg/agent/program/supported.go rename to x-pack/elastic-agent/pkg/agent/program/supported.go index 8b90b451ba40..4044105b6ccb 100644 --- a/x-pack/agent/pkg/agent/program/supported.go +++ b/x-pack/elastic-agent/pkg/agent/program/supported.go @@ -9,7 +9,7 @@ package program import ( "strings" - "github.com/elastic/beats/v7/x-pack/agent/pkg/packer" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/packer" ) var Supported []Spec diff --git a/x-pack/agent/pkg/agent/program/testdata/audit_config-auditbeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/audit_config-auditbeat.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/audit_config-auditbeat.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/audit_config-auditbeat.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/audit_config.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/audit_config.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/audit_config.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/audit_config.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/constraints_config-filebeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/constraints_config-filebeat.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/constraints_config-filebeat.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/constraints_config-filebeat.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/constraints_config.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/constraints_config.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/constraints_config.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/constraints_config.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/enabled_false.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_false.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/enabled_false.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/enabled_false.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/enabled_output_false.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_output_false.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/enabled_output_false.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/enabled_output_false.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/enabled_output_true-filebeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_output_true-filebeat.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/enabled_output_true-filebeat.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/enabled_output_true-filebeat.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/enabled_output_true.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_output_true.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/enabled_output_true.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/enabled_output_true.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/enabled_true-filebeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_true-filebeat.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/enabled_true-filebeat.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/enabled_true-filebeat.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/enabled_true.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_true.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/enabled_true.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/enabled_true.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/journal_config-journalbeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/journal_config-journalbeat.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/journal_config-journalbeat.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/journal_config-journalbeat.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/journal_config.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/journal_config.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/journal_config.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/journal_config.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/monitor_config-heartbeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/monitor_config-heartbeat.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/monitor_config-heartbeat.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/monitor_config-heartbeat.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/monitor_config.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/monitor_config.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/monitor_config.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/monitor_config.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/single_config-filebeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-filebeat.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/single_config-filebeat.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/single_config-filebeat.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/single_config-metricbeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-metricbeat.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/single_config-metricbeat.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/single_config-metricbeat.yml diff --git a/x-pack/agent/pkg/agent/program/testdata/single_config.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config.yml similarity index 100% rename from x-pack/agent/pkg/agent/program/testdata/single_config.yml rename to x-pack/elastic-agent/pkg/agent/program/testdata/single_config.yml diff --git a/x-pack/agent/pkg/agent/stateresolver/resolve.go b/x-pack/elastic-agent/pkg/agent/stateresolver/resolve.go similarity index 95% rename from x-pack/agent/pkg/agent/stateresolver/resolve.go rename to x-pack/elastic-agent/pkg/agent/stateresolver/resolve.go index d9781bbd6d3d..b4d194c40b14 100644 --- a/x-pack/agent/pkg/agent/stateresolver/resolve.go +++ b/x-pack/elastic-agent/pkg/agent/stateresolver/resolve.go @@ -9,9 +9,9 @@ import ( "strings" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/configrequest" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" - "github.com/elastic/beats/v7/x-pack/agent/pkg/release" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/configrequest" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release" ) //go:generate stringer -type=stateChange -linecomment=true diff --git a/x-pack/agent/pkg/agent/stateresolver/resolve_test.go b/x-pack/elastic-agent/pkg/agent/stateresolver/resolve_test.go similarity index 96% rename from x-pack/agent/pkg/agent/stateresolver/resolve_test.go rename to x-pack/elastic-agent/pkg/agent/stateresolver/resolve_test.go index 5ae81e80f1d2..1d576833e306 100644 --- a/x-pack/agent/pkg/agent/stateresolver/resolve_test.go +++ b/x-pack/elastic-agent/pkg/agent/stateresolver/resolve_test.go @@ -11,10 +11,10 @@ import ( "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/configrequest" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/transpiler" - "github.com/elastic/beats/v7/x-pack/agent/pkg/release" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/configrequest" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/transpiler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release" ) func TestResolver(t *testing.T) { diff --git a/x-pack/agent/pkg/agent/stateresolver/statechange_string.go b/x-pack/elastic-agent/pkg/agent/stateresolver/statechange_string.go similarity index 100% rename from x-pack/agent/pkg/agent/stateresolver/statechange_string.go rename to x-pack/elastic-agent/pkg/agent/stateresolver/statechange_string.go diff --git a/x-pack/agent/pkg/agent/stateresolver/stateresolver.go b/x-pack/elastic-agent/pkg/agent/stateresolver/stateresolver.go similarity index 88% rename from x-pack/agent/pkg/agent/stateresolver/stateresolver.go rename to x-pack/elastic-agent/pkg/agent/stateresolver/stateresolver.go index bcc686b83806..e5b2d82e287d 100644 --- a/x-pack/agent/pkg/agent/stateresolver/stateresolver.go +++ b/x-pack/elastic-agent/pkg/agent/stateresolver/stateresolver.go @@ -7,9 +7,9 @@ package stateresolver import ( "sync" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/configrequest" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - uid "github.com/elastic/beats/v7/x-pack/agent/pkg/id" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/configrequest" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + uid "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/id" ) // Acker allow to ack the should state from a converge operation. diff --git a/x-pack/agent/pkg/agent/stateresolver/stateresolver_test.go b/x-pack/elastic-agent/pkg/agent/stateresolver/stateresolver_test.go similarity index 91% rename from x-pack/agent/pkg/agent/stateresolver/stateresolver_test.go rename to x-pack/elastic-agent/pkg/agent/stateresolver/stateresolver_test.go index 629e477f85e9..df6335f0668d 100644 --- a/x-pack/agent/pkg/agent/stateresolver/stateresolver_test.go +++ b/x-pack/elastic-agent/pkg/agent/stateresolver/stateresolver_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) func TestStateResolverAcking(t *testing.T) { diff --git a/x-pack/agent/pkg/agent/storage/storage.go b/x-pack/elastic-agent/pkg/agent/storage/storage.go similarity index 98% rename from x-pack/agent/pkg/agent/storage/storage.go rename to x-pack/elastic-agent/pkg/agent/storage/storage.go index 1e910b4ddec6..d2a6505ba7e7 100644 --- a/x-pack/agent/pkg/agent/storage/storage.go +++ b/x-pack/elastic-agent/pkg/agent/storage/storage.go @@ -13,8 +13,8 @@ import ( "time" "github.com/elastic/beats/v7/libbeat/common/file" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/crypto" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/crypto" ) const perms = 0600 diff --git a/x-pack/agent/pkg/agent/storage/storage_test.go b/x-pack/elastic-agent/pkg/agent/storage/storage_test.go similarity index 100% rename from x-pack/agent/pkg/agent/storage/storage_test.go rename to x-pack/elastic-agent/pkg/agent/storage/storage_test.go diff --git a/x-pack/agent/pkg/agent/transpiler/ast.go b/x-pack/elastic-agent/pkg/agent/transpiler/ast.go similarity index 100% rename from x-pack/agent/pkg/agent/transpiler/ast.go rename to x-pack/elastic-agent/pkg/agent/transpiler/ast.go diff --git a/x-pack/agent/pkg/agent/transpiler/ast_test.go b/x-pack/elastic-agent/pkg/agent/transpiler/ast_test.go similarity index 100% rename from x-pack/agent/pkg/agent/transpiler/ast_test.go rename to x-pack/elastic-agent/pkg/agent/transpiler/ast_test.go diff --git a/x-pack/agent/pkg/agent/transpiler/map_visitor.go b/x-pack/elastic-agent/pkg/agent/transpiler/map_visitor.go similarity index 100% rename from x-pack/agent/pkg/agent/transpiler/map_visitor.go rename to x-pack/elastic-agent/pkg/agent/transpiler/map_visitor.go diff --git a/x-pack/agent/pkg/agent/transpiler/rules.go b/x-pack/elastic-agent/pkg/agent/transpiler/rules.go similarity index 99% rename from x-pack/agent/pkg/agent/transpiler/rules.go rename to x-pack/elastic-agent/pkg/agent/transpiler/rules.go index 1473c02c3d16..50eddecf3ab6 100644 --- a/x-pack/agent/pkg/agent/transpiler/rules.go +++ b/x-pack/elastic-agent/pkg/agent/transpiler/rules.go @@ -11,7 +11,7 @@ import ( "gopkg.in/yaml.v2" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" ) // RuleList is a container that allow the same tree to be executed on multiple defined Rule. diff --git a/x-pack/agent/pkg/agent/transpiler/rules_test.go b/x-pack/elastic-agent/pkg/agent/transpiler/rules_test.go similarity index 99% rename from x-pack/agent/pkg/agent/transpiler/rules_test.go rename to x-pack/elastic-agent/pkg/agent/transpiler/rules_test.go index 5a83c4b85781..36463cfabc05 100644 --- a/x-pack/agent/pkg/agent/transpiler/rules_test.go +++ b/x-pack/elastic-agent/pkg/agent/transpiler/rules_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/yaml.v2" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/internal/yamltest" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/internal/yamltest" ) func TestRules(t *testing.T) { diff --git a/x-pack/agent/pkg/agent/transpiler/steps.go b/x-pack/elastic-agent/pkg/agent/transpiler/steps.go similarity index 100% rename from x-pack/agent/pkg/agent/transpiler/steps.go rename to x-pack/elastic-agent/pkg/agent/transpiler/steps.go diff --git a/x-pack/agent/pkg/agent/transpiler/steps_test.go b/x-pack/elastic-agent/pkg/agent/transpiler/steps_test.go similarity index 100% rename from x-pack/agent/pkg/agent/transpiler/steps_test.go rename to x-pack/elastic-agent/pkg/agent/transpiler/steps_test.go diff --git a/x-pack/agent/pkg/agent/transpiler/visitor.go b/x-pack/elastic-agent/pkg/agent/transpiler/visitor.go similarity index 100% rename from x-pack/agent/pkg/agent/transpiler/visitor.go rename to x-pack/elastic-agent/pkg/agent/transpiler/visitor.go diff --git a/x-pack/agent/pkg/agent/warn/warn.go b/x-pack/elastic-agent/pkg/agent/warn/warn.go similarity index 90% rename from x-pack/agent/pkg/agent/warn/warn.go rename to x-pack/elastic-agent/pkg/agent/warn/warn.go index ddbbc20132c6..d9667f6f2846 100644 --- a/x-pack/agent/pkg/agent/warn/warn.go +++ b/x-pack/elastic-agent/pkg/agent/warn/warn.go @@ -8,7 +8,7 @@ import ( "fmt" "io" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) const message = "The Elastic Agent is currently in Alpha and should not be used in production" diff --git a/x-pack/agent/pkg/artifact/artifact.go b/x-pack/elastic-agent/pkg/artifact/artifact.go similarity index 95% rename from x-pack/agent/pkg/artifact/artifact.go rename to x-pack/elastic-agent/pkg/artifact/artifact.go index 1315497dc37b..72c9ad06a2a6 100644 --- a/x-pack/agent/pkg/artifact/artifact.go +++ b/x-pack/elastic-agent/pkg/artifact/artifact.go @@ -8,7 +8,7 @@ import ( "fmt" "path/filepath" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" ) var packageArchMap = map[string]string{ diff --git a/x-pack/agent/pkg/artifact/config.go b/x-pack/elastic-agent/pkg/artifact/config.go similarity index 91% rename from x-pack/agent/pkg/artifact/config.go rename to x-pack/elastic-agent/pkg/artifact/config.go index 363cb50c499b..406677cb8aa1 100644 --- a/x-pack/agent/pkg/artifact/config.go +++ b/x-pack/elastic-agent/pkg/artifact/config.go @@ -28,17 +28,17 @@ type Config struct { Timeout time.Duration `json:"timeout" config:"timeout"` // PgpFile: filepath to a public key used for verifying downloaded artifacts - // if not file is present agent will try to load public key from elastic.co website. + // if not file is present elastic-agent will try to load public key from elastic.co website. PgpFile string `json:"pgpfile" config:"pgpfile"` // InstallPath: path to the directory containing installed packages InstallPath string `yaml:"installPath" config:"install_path"` - // DropPath: path where agent can find installation files for download. + // DropPath: path where elastic-agent can find installation files for download. // Difference between this and TargetDirectory is that when fetching packages (from web or fs) they are stored in TargetDirectory // DropPath specifies where Filesystem downloader can find packages which will then be placed in TargetDirectory. This can be // local or network disk. - // If not provided FileSystem Downloader will fallback to /beats subfolder of agent directory. + // If not provided FileSystem Downloader will fallback to /beats subfolder of elastic-agent directory. DropPath string `yaml:"dropPath" config:"drop_path"` } diff --git a/x-pack/agent/pkg/artifact/download/composed/downloader.go b/x-pack/elastic-agent/pkg/artifact/download/composed/downloader.go similarity index 94% rename from x-pack/agent/pkg/artifact/download/composed/downloader.go rename to x-pack/elastic-agent/pkg/artifact/download/composed/downloader.go index b8132a689b0b..c87608612691 100644 --- a/x-pack/agent/pkg/artifact/download/composed/downloader.go +++ b/x-pack/elastic-agent/pkg/artifact/download/composed/downloader.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/go-multierror" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download" ) // Downloader is a downloader with a predefined set of downloaders. diff --git a/x-pack/agent/pkg/artifact/download/composed/downloader_test.go b/x-pack/elastic-agent/pkg/artifact/download/composed/downloader_test.go similarity index 96% rename from x-pack/agent/pkg/artifact/download/composed/downloader_test.go rename to x-pack/elastic-agent/pkg/artifact/download/composed/downloader_test.go index 472d8689ef34..9f720fae2354 100644 --- a/x-pack/agent/pkg/artifact/download/composed/downloader_test.go +++ b/x-pack/elastic-agent/pkg/artifact/download/composed/downloader_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download" ) type FailingDownloader struct { diff --git a/x-pack/agent/pkg/artifact/download/composed/verifier.go b/x-pack/elastic-agent/pkg/artifact/download/composed/verifier.go similarity index 94% rename from x-pack/agent/pkg/artifact/download/composed/verifier.go rename to x-pack/elastic-agent/pkg/artifact/download/composed/verifier.go index 3c7bb5d81f3c..33397a87e1ed 100644 --- a/x-pack/agent/pkg/artifact/download/composed/verifier.go +++ b/x-pack/elastic-agent/pkg/artifact/download/composed/verifier.go @@ -7,7 +7,7 @@ package composed import ( "github.com/hashicorp/go-multierror" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download" ) // Verifier is a verifier with a predefined set of verifiers. diff --git a/x-pack/agent/pkg/artifact/download/downloader.go b/x-pack/elastic-agent/pkg/artifact/download/downloader.go similarity index 100% rename from x-pack/agent/pkg/artifact/download/downloader.go rename to x-pack/elastic-agent/pkg/artifact/download/downloader.go diff --git a/x-pack/agent/pkg/artifact/download/fs/downloader.go b/x-pack/elastic-agent/pkg/artifact/download/fs/downloader.go similarity index 95% rename from x-pack/agent/pkg/artifact/download/fs/downloader.go rename to x-pack/elastic-agent/pkg/artifact/download/fs/downloader.go index c17ae5dc0e36..490f0b77478b 100644 --- a/x-pack/agent/pkg/artifact/download/fs/downloader.go +++ b/x-pack/elastic-agent/pkg/artifact/download/fs/downloader.go @@ -11,8 +11,8 @@ import ( "os" "path/filepath" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" ) const ( diff --git a/x-pack/agent/pkg/artifact/download/fs/verifier.go b/x-pack/elastic-agent/pkg/artifact/download/fs/verifier.go similarity index 95% rename from x-pack/agent/pkg/artifact/download/fs/verifier.go rename to x-pack/elastic-agent/pkg/artifact/download/fs/verifier.go index c8f22b363288..1c06dc4b0331 100644 --- a/x-pack/agent/pkg/artifact/download/fs/verifier.go +++ b/x-pack/elastic-agent/pkg/artifact/download/fs/verifier.go @@ -13,8 +13,8 @@ import ( "golang.org/x/crypto/openpgp" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" ) const ( diff --git a/x-pack/agent/pkg/artifact/download/http/downloader.go b/x-pack/elastic-agent/pkg/artifact/download/http/downloader.go similarity index 93% rename from x-pack/agent/pkg/artifact/download/http/downloader.go rename to x-pack/elastic-agent/pkg/artifact/download/http/downloader.go index ad569fbdf7aa..7429f3fc137a 100644 --- a/x-pack/agent/pkg/artifact/download/http/downloader.go +++ b/x-pack/elastic-agent/pkg/artifact/download/http/downloader.go @@ -14,9 +14,9 @@ import ( "path" "strings" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" - "github.com/elastic/beats/v7/x-pack/agent/pkg/release" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release" ) const ( @@ -24,7 +24,7 @@ const ( ) var headers = map[string]string{ - "User-Agent": fmt.Sprintf("Beat agent v%s", release.Version()), + "User-Agent": fmt.Sprintf("Beat elastic-agent v%s", release.Version()), } // Downloader is a downloader able to fetch artifacts from elastic.co web page. diff --git a/x-pack/agent/pkg/artifact/download/http/elastic_test.go b/x-pack/elastic-agent/pkg/artifact/download/http/elastic_test.go similarity index 98% rename from x-pack/agent/pkg/artifact/download/http/elastic_test.go rename to x-pack/elastic-agent/pkg/artifact/download/http/elastic_test.go index f13226b1923d..ba0f1cffbda1 100644 --- a/x-pack/agent/pkg/artifact/download/http/elastic_test.go +++ b/x-pack/elastic-agent/pkg/artifact/download/http/elastic_test.go @@ -16,7 +16,7 @@ import ( "testing" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" ) const ( diff --git a/x-pack/agent/pkg/artifact/download/http/headers_rtt.go b/x-pack/elastic-agent/pkg/artifact/download/http/headers_rtt.go similarity index 100% rename from x-pack/agent/pkg/artifact/download/http/headers_rtt.go rename to x-pack/elastic-agent/pkg/artifact/download/http/headers_rtt.go diff --git a/x-pack/agent/pkg/artifact/download/http/headers_rtt_test.go b/x-pack/elastic-agent/pkg/artifact/download/http/headers_rtt_test.go similarity index 83% rename from x-pack/agent/pkg/artifact/download/http/headers_rtt_test.go rename to x-pack/elastic-agent/pkg/artifact/download/http/headers_rtt_test.go index 31041296da69..06675b6f4660 100644 --- a/x-pack/agent/pkg/artifact/download/http/headers_rtt_test.go +++ b/x-pack/elastic-agent/pkg/artifact/download/http/headers_rtt_test.go @@ -14,13 +14,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/release" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release" ) func TestAddingHeaders(t *testing.T) { msg := []byte("OK") server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - assert.Equal(t, fmt.Sprintf("Beat agent v%s", release.Version()), req.Header.Get("User-Agent")) + assert.Equal(t, fmt.Sprintf("Beat elastic-agent v%s", release.Version()), req.Header.Get("User-Agent")) w.Write(msg) })) defer server.Close() diff --git a/x-pack/agent/pkg/artifact/download/http/verifier.go b/x-pack/elastic-agent/pkg/artifact/download/http/verifier.go similarity index 97% rename from x-pack/agent/pkg/artifact/download/http/verifier.go rename to x-pack/elastic-agent/pkg/artifact/download/http/verifier.go index dc5395d4e971..f1f6475c1b67 100644 --- a/x-pack/agent/pkg/artifact/download/http/verifier.go +++ b/x-pack/elastic-agent/pkg/artifact/download/http/verifier.go @@ -16,8 +16,8 @@ import ( "golang.org/x/crypto/openpgp" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" ) const ( diff --git a/x-pack/agent/pkg/artifact/download/localremote/downloader.go b/x-pack/elastic-agent/pkg/artifact/download/localremote/downloader.go similarity index 60% rename from x-pack/agent/pkg/artifact/download/localremote/downloader.go rename to x-pack/elastic-agent/pkg/artifact/download/localremote/downloader.go index 7faf6a500dd5..8757cb2abbce 100644 --- a/x-pack/agent/pkg/artifact/download/localremote/downloader.go +++ b/x-pack/elastic-agent/pkg/artifact/download/localremote/downloader.go @@ -5,11 +5,11 @@ package localremote import ( - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download/composed" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download/fs" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download/http" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download/composed" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download/fs" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download/http" ) // NewDownloader creates a downloader which first checks local directory diff --git a/x-pack/agent/pkg/artifact/download/localremote/verifier.go b/x-pack/elastic-agent/pkg/artifact/download/localremote/verifier.go similarity index 65% rename from x-pack/agent/pkg/artifact/download/localremote/verifier.go rename to x-pack/elastic-agent/pkg/artifact/download/localremote/verifier.go index c4570aee2ee1..08cb61cb7c3e 100644 --- a/x-pack/agent/pkg/artifact/download/localremote/verifier.go +++ b/x-pack/elastic-agent/pkg/artifact/download/localremote/verifier.go @@ -5,11 +5,11 @@ package localremote import ( - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download/composed" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download/fs" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/download/http" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download/composed" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download/fs" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/download/http" ) // NewVerifier creates a downloader which first checks local directory diff --git a/x-pack/agent/pkg/artifact/download/verifier.go b/x-pack/elastic-agent/pkg/artifact/download/verifier.go similarity index 100% rename from x-pack/agent/pkg/artifact/download/verifier.go rename to x-pack/elastic-agent/pkg/artifact/download/verifier.go diff --git a/x-pack/agent/pkg/artifact/install/hooks/hooks_installer.go b/x-pack/elastic-agent/pkg/artifact/install/hooks/hooks_installer.go similarity index 94% rename from x-pack/agent/pkg/artifact/install/hooks/hooks_installer.go rename to x-pack/elastic-agent/pkg/artifact/install/hooks/hooks_installer.go index 8dd4c8c057f2..fd2f4e4bfdbf 100644 --- a/x-pack/agent/pkg/artifact/install/hooks/hooks_installer.go +++ b/x-pack/elastic-agent/pkg/artifact/install/hooks/hooks_installer.go @@ -7,7 +7,7 @@ package hooks import ( "strings" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" ) type embeddedInstaller interface { diff --git a/x-pack/agent/pkg/artifact/install/installer.go b/x-pack/elastic-agent/pkg/artifact/install/installer.go similarity index 80% rename from x-pack/agent/pkg/artifact/install/installer.go rename to x-pack/elastic-agent/pkg/artifact/install/installer.go index 0ba1a07aca6e..4856468ac83a 100644 --- a/x-pack/agent/pkg/artifact/install/installer.go +++ b/x-pack/elastic-agent/pkg/artifact/install/installer.go @@ -8,10 +8,10 @@ import ( "errors" "runtime" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/install/hooks" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/install/tar" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact/install/zip" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/install/hooks" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/install/tar" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact/install/zip" ) var ( diff --git a/x-pack/agent/pkg/artifact/install/tar/tar_installer.go b/x-pack/elastic-agent/pkg/artifact/install/tar/tar_installer.go similarity index 96% rename from x-pack/agent/pkg/artifact/install/tar/tar_installer.go rename to x-pack/elastic-agent/pkg/artifact/install/tar/tar_installer.go index 1b5e28a23ee1..52d49f627f5b 100644 --- a/x-pack/agent/pkg/artifact/install/tar/tar_installer.go +++ b/x-pack/elastic-agent/pkg/artifact/install/tar/tar_installer.go @@ -13,8 +13,8 @@ import ( "path/filepath" "strings" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" ) // Installer or tar packages diff --git a/x-pack/agent/pkg/artifact/install/zip/zip_installer.go b/x-pack/elastic-agent/pkg/artifact/install/zip/zip_installer.go similarity index 95% rename from x-pack/agent/pkg/artifact/install/zip/zip_installer.go rename to x-pack/elastic-agent/pkg/artifact/install/zip/zip_installer.go index f71b1e6f71a9..5293e49f0169 100644 --- a/x-pack/agent/pkg/artifact/install/zip/zip_installer.go +++ b/x-pack/elastic-agent/pkg/artifact/install/zip/zip_installer.go @@ -11,8 +11,8 @@ import ( "os/exec" "path/filepath" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" ) const ( diff --git a/x-pack/agent/pkg/basecmd/cmd.go b/x-pack/elastic-agent/pkg/basecmd/cmd.go similarity index 80% rename from x-pack/agent/pkg/basecmd/cmd.go rename to x-pack/elastic-agent/pkg/basecmd/cmd.go index cfe3631e5bf5..9b957916fb1a 100644 --- a/x-pack/agent/pkg/basecmd/cmd.go +++ b/x-pack/elastic-agent/pkg/basecmd/cmd.go @@ -7,8 +7,8 @@ package basecmd import ( "github.com/spf13/cobra" - "github.com/elastic/beats/v7/x-pack/agent/pkg/basecmd/version" - "github.com/elastic/beats/v7/x-pack/agent/pkg/cli" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/basecmd/version" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/cli" ) // NewDefaultCommandsWithArgs returns a list of default commands to executes. diff --git a/x-pack/agent/pkg/basecmd/cmd_test.go b/x-pack/elastic-agent/pkg/basecmd/cmd_test.go similarity index 87% rename from x-pack/agent/pkg/basecmd/cmd_test.go rename to x-pack/elastic-agent/pkg/basecmd/cmd_test.go index accc4bc976ee..7dbdc51f8f22 100644 --- a/x-pack/agent/pkg/basecmd/cmd_test.go +++ b/x-pack/elastic-agent/pkg/basecmd/cmd_test.go @@ -7,7 +7,7 @@ package basecmd import ( "testing" - "github.com/elastic/beats/v7/x-pack/agent/pkg/cli" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/cli" ) func TestBaseCmd(t *testing.T) { diff --git a/x-pack/agent/pkg/basecmd/version/cmd.go b/x-pack/elastic-agent/pkg/basecmd/version/cmd.go similarity index 81% rename from x-pack/agent/pkg/basecmd/version/cmd.go rename to x-pack/elastic-agent/pkg/basecmd/version/cmd.go index b2de26fd1d44..0bf25438e807 100644 --- a/x-pack/agent/pkg/basecmd/version/cmd.go +++ b/x-pack/elastic-agent/pkg/basecmd/version/cmd.go @@ -9,15 +9,15 @@ import ( "github.com/spf13/cobra" - "github.com/elastic/beats/v7/x-pack/agent/pkg/cli" - "github.com/elastic/beats/v7/x-pack/agent/pkg/release" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/cli" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release" ) // NewCommandWithArgs returns a new version command. func NewCommandWithArgs(streams *cli.IOStreams) *cobra.Command { return &cobra.Command{ Use: "version", - Short: "Display the version of the agent.", + Short: "Display the version of the elastic-agent.", Run: func(_ *cobra.Command, _ []string) { version := release.Version() if release.Snapshot() { diff --git a/x-pack/agent/pkg/basecmd/version/cmd_test.go b/x-pack/elastic-agent/pkg/basecmd/version/cmd_test.go similarity index 91% rename from x-pack/agent/pkg/basecmd/version/cmd_test.go rename to x-pack/elastic-agent/pkg/basecmd/version/cmd_test.go index 0395e604b429..111d174608f3 100644 --- a/x-pack/agent/pkg/basecmd/version/cmd_test.go +++ b/x-pack/elastic-agent/pkg/basecmd/version/cmd_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/elastic/beats/v7/x-pack/agent/pkg/cli" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/cli" ) func TestCmd(t *testing.T) { diff --git a/x-pack/agent/pkg/boolexp/Boolexp.g4 b/x-pack/elastic-agent/pkg/boolexp/Boolexp.g4 similarity index 100% rename from x-pack/agent/pkg/boolexp/Boolexp.g4 rename to x-pack/elastic-agent/pkg/boolexp/Boolexp.g4 diff --git a/x-pack/agent/pkg/boolexp/boolexp.go b/x-pack/elastic-agent/pkg/boolexp/boolexp.go similarity index 100% rename from x-pack/agent/pkg/boolexp/boolexp.go rename to x-pack/elastic-agent/pkg/boolexp/boolexp.go diff --git a/x-pack/agent/pkg/boolexp/boolexp_test.go b/x-pack/elastic-agent/pkg/boolexp/boolexp_test.go similarity index 99% rename from x-pack/agent/pkg/boolexp/boolexp_test.go rename to x-pack/elastic-agent/pkg/boolexp/boolexp_test.go index 4e61f44ab470..44faa8e2bb0e 100644 --- a/x-pack/agent/pkg/boolexp/boolexp_test.go +++ b/x-pack/elastic-agent/pkg/boolexp/boolexp_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/boolexp/parser" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/boolexp/parser" ) var showDebug = lookupEnvOrDefault("DEBUG", "0") diff --git a/x-pack/agent/pkg/boolexp/compare.go b/x-pack/elastic-agent/pkg/boolexp/compare.go similarity index 100% rename from x-pack/agent/pkg/boolexp/compare.go rename to x-pack/elastic-agent/pkg/boolexp/compare.go diff --git a/x-pack/agent/pkg/boolexp/expression.go b/x-pack/elastic-agent/pkg/boolexp/expression.go similarity index 96% rename from x-pack/agent/pkg/boolexp/expression.go rename to x-pack/elastic-agent/pkg/boolexp/expression.go index c7c5f12a1645..69d30603d5cf 100644 --- a/x-pack/agent/pkg/boolexp/expression.go +++ b/x-pack/elastic-agent/pkg/boolexp/expression.go @@ -10,7 +10,7 @@ import ( "github.com/antlr/antlr4/runtime/Go/antlr" - "github.com/elastic/beats/v7/x-pack/agent/pkg/boolexp/parser" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/boolexp/parser" ) // VarStore is the interface to implements when you want the expression engine to be able to fetch diff --git a/x-pack/agent/pkg/boolexp/methods.go b/x-pack/elastic-agent/pkg/boolexp/methods.go similarity index 100% rename from x-pack/agent/pkg/boolexp/methods.go rename to x-pack/elastic-agent/pkg/boolexp/methods.go diff --git a/x-pack/agent/pkg/boolexp/parser/Boolexp.interp b/x-pack/elastic-agent/pkg/boolexp/parser/Boolexp.interp similarity index 100% rename from x-pack/agent/pkg/boolexp/parser/Boolexp.interp rename to x-pack/elastic-agent/pkg/boolexp/parser/Boolexp.interp diff --git a/x-pack/agent/pkg/boolexp/parser/Boolexp.tokens b/x-pack/elastic-agent/pkg/boolexp/parser/Boolexp.tokens similarity index 100% rename from x-pack/agent/pkg/boolexp/parser/Boolexp.tokens rename to x-pack/elastic-agent/pkg/boolexp/parser/Boolexp.tokens diff --git a/x-pack/agent/pkg/boolexp/parser/BoolexpLexer.interp b/x-pack/elastic-agent/pkg/boolexp/parser/BoolexpLexer.interp similarity index 100% rename from x-pack/agent/pkg/boolexp/parser/BoolexpLexer.interp rename to x-pack/elastic-agent/pkg/boolexp/parser/BoolexpLexer.interp diff --git a/x-pack/agent/pkg/boolexp/parser/BoolexpLexer.tokens b/x-pack/elastic-agent/pkg/boolexp/parser/BoolexpLexer.tokens similarity index 100% rename from x-pack/agent/pkg/boolexp/parser/BoolexpLexer.tokens rename to x-pack/elastic-agent/pkg/boolexp/parser/BoolexpLexer.tokens diff --git a/x-pack/agent/pkg/boolexp/parser/boolexp_base_listener.go b/x-pack/elastic-agent/pkg/boolexp/parser/boolexp_base_listener.go similarity index 100% rename from x-pack/agent/pkg/boolexp/parser/boolexp_base_listener.go rename to x-pack/elastic-agent/pkg/boolexp/parser/boolexp_base_listener.go diff --git a/x-pack/agent/pkg/boolexp/parser/boolexp_base_visitor.go b/x-pack/elastic-agent/pkg/boolexp/parser/boolexp_base_visitor.go similarity index 100% rename from x-pack/agent/pkg/boolexp/parser/boolexp_base_visitor.go rename to x-pack/elastic-agent/pkg/boolexp/parser/boolexp_base_visitor.go diff --git a/x-pack/agent/pkg/boolexp/parser/boolexp_lexer.go b/x-pack/elastic-agent/pkg/boolexp/parser/boolexp_lexer.go similarity index 100% rename from x-pack/agent/pkg/boolexp/parser/boolexp_lexer.go rename to x-pack/elastic-agent/pkg/boolexp/parser/boolexp_lexer.go diff --git a/x-pack/agent/pkg/boolexp/parser/boolexp_listener.go b/x-pack/elastic-agent/pkg/boolexp/parser/boolexp_listener.go similarity index 100% rename from x-pack/agent/pkg/boolexp/parser/boolexp_listener.go rename to x-pack/elastic-agent/pkg/boolexp/parser/boolexp_listener.go diff --git a/x-pack/agent/pkg/boolexp/parser/boolexp_parser.go b/x-pack/elastic-agent/pkg/boolexp/parser/boolexp_parser.go similarity index 100% rename from x-pack/agent/pkg/boolexp/parser/boolexp_parser.go rename to x-pack/elastic-agent/pkg/boolexp/parser/boolexp_parser.go diff --git a/x-pack/agent/pkg/boolexp/parser/boolexp_visitor.go b/x-pack/elastic-agent/pkg/boolexp/parser/boolexp_visitor.go similarity index 100% rename from x-pack/agent/pkg/boolexp/parser/boolexp_visitor.go rename to x-pack/elastic-agent/pkg/boolexp/parser/boolexp_visitor.go diff --git a/x-pack/agent/pkg/boolexp/visitor.go b/x-pack/elastic-agent/pkg/boolexp/visitor.go similarity index 98% rename from x-pack/agent/pkg/boolexp/visitor.go rename to x-pack/elastic-agent/pkg/boolexp/visitor.go index 1f640986ac48..40264a4e6e1d 100644 --- a/x-pack/agent/pkg/boolexp/visitor.go +++ b/x-pack/elastic-agent/pkg/boolexp/visitor.go @@ -11,7 +11,7 @@ import ( "github.com/antlr/antlr4/runtime/Go/antlr" - "github.com/elastic/beats/v7/x-pack/agent/pkg/boolexp/parser" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/boolexp/parser" ) // Errors diff --git a/x-pack/agent/pkg/cli/flags.go b/x-pack/elastic-agent/pkg/cli/flags.go similarity index 100% rename from x-pack/agent/pkg/cli/flags.go rename to x-pack/elastic-agent/pkg/cli/flags.go diff --git a/x-pack/agent/pkg/cli/flags_test.go b/x-pack/elastic-agent/pkg/cli/flags_test.go similarity index 100% rename from x-pack/agent/pkg/cli/flags_test.go rename to x-pack/elastic-agent/pkg/cli/flags_test.go diff --git a/x-pack/agent/pkg/cli/streams.go b/x-pack/elastic-agent/pkg/cli/streams.go similarity index 100% rename from x-pack/agent/pkg/cli/streams.go rename to x-pack/elastic-agent/pkg/cli/streams.go diff --git a/x-pack/agent/pkg/config/config.go b/x-pack/elastic-agent/pkg/config/config.go similarity index 100% rename from x-pack/agent/pkg/config/config.go rename to x-pack/elastic-agent/pkg/config/config.go diff --git a/x-pack/agent/pkg/config/config_test.go b/x-pack/elastic-agent/pkg/config/config_test.go similarity index 100% rename from x-pack/agent/pkg/config/config_test.go rename to x-pack/elastic-agent/pkg/config/config_test.go diff --git a/x-pack/agent/pkg/core/logger/logger.go b/x-pack/elastic-agent/pkg/core/logger/logger.go similarity index 94% rename from x-pack/agent/pkg/core/logger/logger.go rename to x-pack/elastic-agent/pkg/core/logger/logger.go index 3d6889a35428..3f23feb782e8 100644 --- a/x-pack/agent/pkg/core/logger/logger.go +++ b/x-pack/elastic-agent/pkg/core/logger/logger.go @@ -10,7 +10,7 @@ import ( "github.com/urso/ecslog/backend/appender" "github.com/urso/ecslog/backend/layout" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" ) // Logger alias ecslog.Logger with Logger. diff --git a/x-pack/agent/pkg/core/logger/logger_test.go b/x-pack/elastic-agent/pkg/core/logger/logger_test.go similarity index 100% rename from x-pack/agent/pkg/core/logger/logger_test.go rename to x-pack/elastic-agent/pkg/core/logger/logger_test.go diff --git a/x-pack/agent/pkg/core/plugin/app/app.go b/x-pack/elastic-agent/pkg/core/plugin/app/app.go similarity index 85% rename from x-pack/agent/pkg/core/plugin/app/app.go rename to x-pack/elastic-agent/pkg/core/plugin/app/app.go index e8acb42895fd..1889eed51826 100644 --- a/x-pack/agent/pkg/core/plugin/app/app.go +++ b/x-pack/elastic-agent/pkg/core/plugin/app/app.go @@ -12,16 +12,16 @@ import ( "sync" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/operation/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app/monitoring" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/process" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/retry" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/state" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/remoteconfig" - "github.com/elastic/beats/v7/x-pack/agent/pkg/tokenbucket" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app/monitoring" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/process" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/retry" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/state" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/remoteconfig" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/tokenbucket" ) var ( @@ -36,7 +36,7 @@ var ( // ReportFailureFunc is a callback func used to report async failures due to crashes. type ReportFailureFunc func(context.Context, string, error) -// Application encapsulates a concrete application ran by agent e.g Beat. +// Application encapsulates a concrete application ran by elastic-agent e.g Beat. type Application struct { id string name string diff --git a/x-pack/agent/pkg/core/plugin/app/client.go b/x-pack/elastic-agent/pkg/core/plugin/app/client.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/app/client.go rename to x-pack/elastic-agent/pkg/core/plugin/app/client.go diff --git a/x-pack/agent/pkg/core/plugin/app/configure.go b/x-pack/elastic-agent/pkg/core/plugin/app/configure.go similarity index 87% rename from x-pack/agent/pkg/core/plugin/app/configure.go rename to x-pack/elastic-agent/pkg/core/plugin/app/configure.go index f75a01d6dd23..3feb3020c9b3 100644 --- a/x-pack/agent/pkg/core/plugin/app/configure.go +++ b/x-pack/elastic-agent/pkg/core/plugin/app/configure.go @@ -12,10 +12,10 @@ import ( "gopkg.in/yaml.v2" "github.com/elastic/beats/v7/libbeat/common/backoff" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/retry" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/state" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/remoteconfig" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/retry" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/state" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/remoteconfig" ) const ( diff --git a/x-pack/agent/pkg/core/plugin/app/descriptor.go b/x-pack/elastic-agent/pkg/core/plugin/app/descriptor.go similarity index 96% rename from x-pack/agent/pkg/core/plugin/app/descriptor.go rename to x-pack/elastic-agent/pkg/core/plugin/app/descriptor.go index 1b4072e39ebd..3dc5f0e00d3e 100644 --- a/x-pack/agent/pkg/core/plugin/app/descriptor.go +++ b/x-pack/elastic-agent/pkg/core/plugin/app/descriptor.go @@ -9,8 +9,8 @@ import ( "path/filepath" "strings" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/program" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/program" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" ) // Descriptor defines a program which needs to be run. diff --git a/x-pack/agent/pkg/core/plugin/app/execution_context.go b/x-pack/elastic-agent/pkg/core/plugin/app/execution_context.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/app/execution_context.go rename to x-pack/elastic-agent/pkg/core/plugin/app/execution_context.go diff --git a/x-pack/agent/pkg/core/plugin/app/monitoring/beats/beats_monitor.go b/x-pack/elastic-agent/pkg/core/plugin/app/monitoring/beats/beats_monitor.go similarity index 98% rename from x-pack/agent/pkg/core/plugin/app/monitoring/beats/beats_monitor.go rename to x-pack/elastic-agent/pkg/core/plugin/app/monitoring/beats/beats_monitor.go index d749fbc02d32..eda80bf1ffe2 100644 --- a/x-pack/agent/pkg/core/plugin/app/monitoring/beats/beats_monitor.go +++ b/x-pack/elastic-agent/pkg/core/plugin/app/monitoring/beats/beats_monitor.go @@ -11,7 +11,7 @@ import ( "strings" "unicode" - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" ) const httpPlusPrefix = "http+" diff --git a/x-pack/agent/pkg/core/plugin/app/monitoring/beats/drop_test.go b/x-pack/elastic-agent/pkg/core/plugin/app/monitoring/beats/drop_test.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/app/monitoring/beats/drop_test.go rename to x-pack/elastic-agent/pkg/core/plugin/app/monitoring/beats/drop_test.go diff --git a/x-pack/agent/pkg/core/plugin/app/monitoring/beats/monitoring.go b/x-pack/elastic-agent/pkg/core/plugin/app/monitoring/beats/monitoring.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/app/monitoring/beats/monitoring.go rename to x-pack/elastic-agent/pkg/core/plugin/app/monitoring/beats/monitoring.go diff --git a/x-pack/agent/pkg/core/plugin/app/monitoring/config.go b/x-pack/elastic-agent/pkg/core/plugin/app/monitoring/config.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/app/monitoring/config.go rename to x-pack/elastic-agent/pkg/core/plugin/app/monitoring/config.go diff --git a/x-pack/agent/pkg/core/plugin/app/monitoring/monitor.go b/x-pack/elastic-agent/pkg/core/plugin/app/monitoring/monitor.go similarity index 79% rename from x-pack/agent/pkg/core/plugin/app/monitoring/monitor.go rename to x-pack/elastic-agent/pkg/core/plugin/app/monitoring/monitor.go index ed820cd0ebe3..dd4744de8ee4 100644 --- a/x-pack/agent/pkg/core/plugin/app/monitoring/monitor.go +++ b/x-pack/elastic-agent/pkg/core/plugin/app/monitoring/monitor.go @@ -5,9 +5,9 @@ package monitoring import ( - "github.com/elastic/beats/v7/x-pack/agent/pkg/artifact" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app/monitoring/beats" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/app/monitoring/noop" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app/monitoring/beats" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/app/monitoring/noop" ) // Monitor is a monitoring interface providing information about the way diff --git a/x-pack/agent/pkg/core/plugin/app/monitoring/noop/noop_monitor.go b/x-pack/elastic-agent/pkg/core/plugin/app/monitoring/noop/noop_monitor.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/app/monitoring/noop/noop_monitor.go rename to x-pack/elastic-agent/pkg/core/plugin/app/monitoring/noop/noop_monitor.go diff --git a/x-pack/agent/pkg/core/plugin/app/process_cred.go b/x-pack/elastic-agent/pkg/core/plugin/app/process_cred.go similarity index 95% rename from x-pack/agent/pkg/core/plugin/app/process_cred.go rename to x-pack/elastic-agent/pkg/core/plugin/app/process_cred.go index 2b288b634d84..aaae763209d3 100644 --- a/x-pack/agent/pkg/core/plugin/app/process_cred.go +++ b/x-pack/elastic-agent/pkg/core/plugin/app/process_cred.go @@ -11,7 +11,7 @@ import ( "os/user" "strconv" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" ) func getUserGroup(spec ProcessSpec) (int, int, error) { diff --git a/x-pack/agent/pkg/core/plugin/app/process_cred_other.go b/x-pack/elastic-agent/pkg/core/plugin/app/process_cred_other.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/app/process_cred_other.go rename to x-pack/elastic-agent/pkg/core/plugin/app/process_cred_other.go diff --git a/x-pack/agent/pkg/core/plugin/app/spec.go b/x-pack/elastic-agent/pkg/core/plugin/app/spec.go similarity index 78% rename from x-pack/agent/pkg/core/plugin/app/spec.go rename to x-pack/elastic-agent/pkg/core/plugin/app/spec.go index 1dbd56ae612d..1fc43e71ca29 100644 --- a/x-pack/agent/pkg/core/plugin/app/spec.go +++ b/x-pack/elastic-agent/pkg/core/plugin/app/spec.go @@ -9,9 +9,9 @@ import ( ) const ( - // ConfigurableGrpc is a flag telling agent that program has capability of Grpc server with a Config endpoint + // ConfigurableGrpc is a flag telling elastic-agent that program has capability of Grpc server with a Config endpoint ConfigurableGrpc = "grpc" - // ConfigurableFile is a flag telling agent that program has capability of being configured by accepting `-c filepath` + // ConfigurableFile is a flag telling elastic-agent that program has capability of being configured by accepting `-c filepath` // argument with a configuration file provided ConfigurableFile = "file" ) @@ -39,5 +39,5 @@ type ProcessSpec struct { User user.User Group user.Group - // TODO: mapping transformation rules for configuration between agent.yml and to the beats. + // TODO: mapping transformation rules for configuration between elastic-agent.yml and to the beats. } diff --git a/x-pack/agent/pkg/core/plugin/app/start.go b/x-pack/elastic-agent/pkg/core/plugin/app/start.go similarity index 94% rename from x-pack/agent/pkg/core/plugin/app/start.go rename to x-pack/elastic-agent/pkg/core/plugin/app/start.go index 818024e50dd3..a95aee7515a6 100644 --- a/x-pack/agent/pkg/core/plugin/app/start.go +++ b/x-pack/elastic-agent/pkg/core/plugin/app/start.go @@ -15,12 +15,12 @@ import ( "gopkg.in/yaml.v2" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/authority" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/process" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/state" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/remoteconfig" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/remoteconfig/grpc" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/authority" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/process" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/state" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/remoteconfig" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/remoteconfig/grpc" ) const ( @@ -29,7 +29,7 @@ const ( configFilePermissions = 0644 // writable only by owner ) -// ConfiguratorClient is the client connecting agent and a process +// ConfiguratorClient is the client connecting elastic-agent and a process type stateClient interface { Status(ctx context.Context) (string, error) Close() error diff --git a/x-pack/agent/pkg/core/plugin/app/tag.go b/x-pack/elastic-agent/pkg/core/plugin/app/tag.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/app/tag.go rename to x-pack/elastic-agent/pkg/core/plugin/app/tag.go diff --git a/x-pack/agent/pkg/core/plugin/app/watch_posix.go b/x-pack/elastic-agent/pkg/core/plugin/app/watch_posix.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/app/watch_posix.go rename to x-pack/elastic-agent/pkg/core/plugin/app/watch_posix.go diff --git a/x-pack/agent/pkg/core/plugin/app/watch_windows.go b/x-pack/elastic-agent/pkg/core/plugin/app/watch_windows.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/app/watch_windows.go rename to x-pack/elastic-agent/pkg/core/plugin/app/watch_windows.go diff --git a/x-pack/agent/pkg/core/plugin/authority/ca.go b/x-pack/elastic-agent/pkg/core/plugin/authority/ca.go similarity index 98% rename from x-pack/agent/pkg/core/plugin/authority/ca.go rename to x-pack/elastic-agent/pkg/core/plugin/authority/ca.go index f57c3ae2a49e..1e477d7808b1 100644 --- a/x-pack/agent/pkg/core/plugin/authority/ca.go +++ b/x-pack/elastic-agent/pkg/core/plugin/authority/ca.go @@ -17,7 +17,7 @@ import ( "math/big" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" ) // CertificateAuthority is an abstraction for common certificate authority diff --git a/x-pack/agent/pkg/core/plugin/process/cmd.go b/x-pack/elastic-agent/pkg/core/plugin/process/cmd.go similarity index 89% rename from x-pack/agent/pkg/core/plugin/process/cmd.go rename to x-pack/elastic-agent/pkg/core/plugin/process/cmd.go index dad8fa39ee30..98d3abe30e83 100644 --- a/x-pack/agent/pkg/core/plugin/process/cmd.go +++ b/x-pack/elastic-agent/pkg/core/plugin/process/cmd.go @@ -11,7 +11,7 @@ import ( "os" "os/exec" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) func getCmd(logger *logger.Logger, path string, env []string, uid, gid int, arg ...string) *exec.Cmd { diff --git a/x-pack/agent/pkg/core/plugin/process/cmd_cred.go b/x-pack/elastic-agent/pkg/core/plugin/process/cmd_cred.go similarity index 93% rename from x-pack/agent/pkg/core/plugin/process/cmd_cred.go rename to x-pack/elastic-agent/pkg/core/plugin/process/cmd_cred.go index 054cbe290ae5..ae254e998979 100644 --- a/x-pack/agent/pkg/core/plugin/process/cmd_cred.go +++ b/x-pack/elastic-agent/pkg/core/plugin/process/cmd_cred.go @@ -12,7 +12,7 @@ import ( "path/filepath" "syscall" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) func getCmd(logger *logger.Logger, path string, env []string, uid, gid int, arg ...string) *exec.Cmd { diff --git a/x-pack/agent/pkg/core/plugin/process/config.go b/x-pack/elastic-agent/pkg/core/plugin/process/config.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/process/config.go rename to x-pack/elastic-agent/pkg/core/plugin/process/config.go diff --git a/x-pack/agent/pkg/core/plugin/process/process.go b/x-pack/elastic-agent/pkg/core/plugin/process/process.go similarity index 97% rename from x-pack/agent/pkg/core/plugin/process/process.go rename to x-pack/elastic-agent/pkg/core/plugin/process/process.go index a612e4a83527..3ce192ced44f 100644 --- a/x-pack/agent/pkg/core/plugin/process/process.go +++ b/x-pack/elastic-agent/pkg/core/plugin/process/process.go @@ -19,8 +19,8 @@ import ( "gopkg.in/yaml.v2" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) const ( diff --git a/x-pack/agent/pkg/core/plugin/retry/config.go b/x-pack/elastic-agent/pkg/core/plugin/retry/config.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/retry/config.go rename to x-pack/elastic-agent/pkg/core/plugin/retry/config.go diff --git a/x-pack/agent/pkg/core/plugin/retry/error.go b/x-pack/elastic-agent/pkg/core/plugin/retry/error.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/retry/error.go rename to x-pack/elastic-agent/pkg/core/plugin/retry/error.go diff --git a/x-pack/agent/pkg/core/plugin/retry/retrystrategy.go b/x-pack/elastic-agent/pkg/core/plugin/retry/retrystrategy.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/retry/retrystrategy.go rename to x-pack/elastic-agent/pkg/core/plugin/retry/retrystrategy.go diff --git a/x-pack/agent/pkg/core/plugin/retry/retrystrategy_test.go b/x-pack/elastic-agent/pkg/core/plugin/retry/retrystrategy_test.go similarity index 100% rename from x-pack/agent/pkg/core/plugin/retry/retrystrategy_test.go rename to x-pack/elastic-agent/pkg/core/plugin/retry/retrystrategy_test.go diff --git a/x-pack/agent/pkg/core/plugin/server/server.go b/x-pack/elastic-agent/pkg/core/plugin/server/server.go similarity index 91% rename from x-pack/agent/pkg/core/plugin/server/server.go rename to x-pack/elastic-agent/pkg/core/plugin/server/server.go index cd7eb46e4ae0..7f15c22198d6 100644 --- a/x-pack/agent/pkg/core/plugin/server/server.go +++ b/x-pack/elastic-agent/pkg/core/plugin/server/server.go @@ -17,9 +17,9 @@ import ( "google.golang.org/grpc/credentials" "gopkg.in/yaml.v2" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/process" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/remoteconfig/grpc" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/process" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/remoteconfig/grpc" ) const ( diff --git a/x-pack/agent/pkg/core/plugin/state/state.go b/x-pack/elastic-agent/pkg/core/plugin/state/state.go similarity index 89% rename from x-pack/agent/pkg/core/plugin/state/state.go rename to x-pack/elastic-agent/pkg/core/plugin/state/state.go index 210517e35a8a..0c6b35dbc913 100644 --- a/x-pack/agent/pkg/core/plugin/state/state.go +++ b/x-pack/elastic-agent/pkg/core/plugin/state/state.go @@ -4,7 +4,7 @@ package state -import "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/process" +import "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/process" // Status describes the current status of the application process. type Status int diff --git a/x-pack/agent/pkg/core/remoteconfig/config.go b/x-pack/elastic-agent/pkg/core/remoteconfig/config.go similarity index 100% rename from x-pack/agent/pkg/core/remoteconfig/config.go rename to x-pack/elastic-agent/pkg/core/remoteconfig/config.go diff --git a/x-pack/agent/pkg/core/remoteconfig/grpc/configclient.go b/x-pack/elastic-agent/pkg/core/remoteconfig/grpc/configclient.go similarity index 97% rename from x-pack/agent/pkg/core/remoteconfig/grpc/configclient.go rename to x-pack/elastic-agent/pkg/core/remoteconfig/grpc/configclient.go index d211643ef428..1ca7ba6b33e2 100644 --- a/x-pack/agent/pkg/core/remoteconfig/grpc/configclient.go +++ b/x-pack/elastic-agent/pkg/core/remoteconfig/grpc/configclient.go @@ -13,7 +13,7 @@ import ( rpc "google.golang.org/grpc" "github.com/elastic/beats/v7/libbeat/common/backoff" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/remoteconfig" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/remoteconfig" ) var ( diff --git a/x-pack/agent/pkg/core/remoteconfig/grpc/connection_provider.go b/x-pack/elastic-agent/pkg/core/remoteconfig/grpc/connection_provider.go similarity index 96% rename from x-pack/agent/pkg/core/remoteconfig/grpc/connection_provider.go rename to x-pack/elastic-agent/pkg/core/remoteconfig/grpc/connection_provider.go index 19bf9fa9a88d..f6bc612507d5 100644 --- a/x-pack/agent/pkg/core/remoteconfig/grpc/connection_provider.go +++ b/x-pack/elastic-agent/pkg/core/remoteconfig/grpc/connection_provider.go @@ -5,7 +5,7 @@ package grpc import ( - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/remoteconfig" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/remoteconfig" ) var _ remoteconfig.ConnectionProvider = (*ConnectionProvider)(nil) diff --git a/x-pack/agent/pkg/core/remoteconfig/grpc/factory.go b/x-pack/elastic-agent/pkg/core/remoteconfig/grpc/factory.go similarity index 93% rename from x-pack/agent/pkg/core/remoteconfig/grpc/factory.go rename to x-pack/elastic-agent/pkg/core/remoteconfig/grpc/factory.go index 386a2b69ea73..62ddb418be99 100644 --- a/x-pack/agent/pkg/core/remoteconfig/grpc/factory.go +++ b/x-pack/elastic-agent/pkg/core/remoteconfig/grpc/factory.go @@ -13,8 +13,8 @@ import ( rpc "google.golang.org/grpc" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/remoteconfig" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/remoteconfig" ) // NewConnFactory creates a factory used to create connection. Hides implementation details diff --git a/x-pack/agent/pkg/core/remoteconfig/grpc/noop_backoff.go b/x-pack/elastic-agent/pkg/core/remoteconfig/grpc/noop_backoff.go similarity index 100% rename from x-pack/agent/pkg/core/remoteconfig/grpc/noop_backoff.go rename to x-pack/elastic-agent/pkg/core/remoteconfig/grpc/noop_backoff.go diff --git a/x-pack/agent/pkg/core/remoteconfig/grpc/remote_config.pb.go b/x-pack/elastic-agent/pkg/core/remoteconfig/grpc/remote_config.pb.go similarity index 100% rename from x-pack/agent/pkg/core/remoteconfig/grpc/remote_config.pb.go rename to x-pack/elastic-agent/pkg/core/remoteconfig/grpc/remote_config.pb.go diff --git a/x-pack/agent/pkg/crypto/io.go b/x-pack/elastic-agent/pkg/crypto/io.go similarity index 100% rename from x-pack/agent/pkg/crypto/io.go rename to x-pack/elastic-agent/pkg/crypto/io.go diff --git a/x-pack/agent/pkg/crypto/io_test.go b/x-pack/elastic-agent/pkg/crypto/io_test.go similarity index 100% rename from x-pack/agent/pkg/crypto/io_test.go rename to x-pack/elastic-agent/pkg/crypto/io_test.go diff --git a/x-pack/agent/pkg/dir/discover.go b/x-pack/elastic-agent/pkg/dir/discover.go similarity index 92% rename from x-pack/agent/pkg/dir/discover.go rename to x-pack/elastic-agent/pkg/dir/discover.go index 7ef889f23cd2..7859469f2285 100644 --- a/x-pack/agent/pkg/dir/discover.go +++ b/x-pack/elastic-agent/pkg/dir/discover.go @@ -7,7 +7,7 @@ package dir import ( "path/filepath" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" ) // DiscoverFiles takes a slices of wildcards patterns and try to discover all the matching files diff --git a/x-pack/agent/pkg/dir/discover_test.go b/x-pack/elastic-agent/pkg/dir/discover_test.go similarity index 90% rename from x-pack/agent/pkg/dir/discover_test.go rename to x-pack/elastic-agent/pkg/dir/discover_test.go index ad7cb21bf68a..153e94d03046 100644 --- a/x-pack/agent/pkg/dir/discover_test.go +++ b/x-pack/elastic-agent/pkg/dir/discover_test.go @@ -14,6 +14,8 @@ import ( "github.com/stretchr/testify/require" ) +const agentConfigFile = "elastic-agent.yml" + func TestDiscover(t *testing.T) { t.Run("support wildcards patterns", withFiles([]string{"hello", "helllooo"}, func( dst string, @@ -33,19 +35,19 @@ func TestDiscover(t *testing.T) { assert.Equal(t, 1, len(r)) })) - t.Run("support direct file and pattern", withFiles([]string{"hello", "helllooo", "agent.yml"}, func( + t.Run("support direct file and pattern", withFiles([]string{"hello", "helllooo", agentConfigFile}, func( dst string, t *testing.T, ) { r, err := DiscoverFiles( filepath.Join(dst, "hel*"), - filepath.Join(dst, "agent.yml"), + filepath.Join(dst, agentConfigFile), ) require.NoError(t, err) assert.Equal(t, 3, len(r)) })) - t.Run("support direct file and pattern", withFiles([]string{"hello", "helllooo", "agent.yml"}, func( + t.Run("support direct file and pattern", withFiles([]string{"hello", "helllooo", agentConfigFile}, func( dst string, t *testing.T, ) { diff --git a/x-pack/agent/pkg/filewatcher/watcher.go b/x-pack/elastic-agent/pkg/filewatcher/watcher.go similarity index 97% rename from x-pack/agent/pkg/filewatcher/watcher.go rename to x-pack/elastic-agent/pkg/filewatcher/watcher.go index cb64d6f2a60c..32d96436b880 100644 --- a/x-pack/agent/pkg/filewatcher/watcher.go +++ b/x-pack/elastic-agent/pkg/filewatcher/watcher.go @@ -12,8 +12,8 @@ import ( "sort" "sync" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) // Comparer receives a file and the saved information about that file from the previous scan, diff --git a/x-pack/agent/pkg/filewatcher/watcher_test.go b/x-pack/elastic-agent/pkg/filewatcher/watcher_test.go similarity index 100% rename from x-pack/agent/pkg/filewatcher/watcher_test.go rename to x-pack/elastic-agent/pkg/filewatcher/watcher_test.go diff --git a/x-pack/agent/pkg/fleetapi/ack_cmd.go b/x-pack/elastic-agent/pkg/fleetapi/ack_cmd.go similarity index 97% rename from x-pack/agent/pkg/fleetapi/ack_cmd.go rename to x-pack/elastic-agent/pkg/fleetapi/ack_cmd.go index 693fb295a6c7..a1b1a2451140 100644 --- a/x-pack/agent/pkg/fleetapi/ack_cmd.go +++ b/x-pack/elastic-agent/pkg/fleetapi/ack_cmd.go @@ -11,7 +11,7 @@ import ( "fmt" "net/http" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" ) const ackPath = "/api/ingest_manager/fleet/agents/%s/acks" diff --git a/x-pack/agent/pkg/fleetapi/ack_cmd_test.go b/x-pack/elastic-agent/pkg/fleetapi/ack_cmd_test.go similarity index 100% rename from x-pack/agent/pkg/fleetapi/ack_cmd_test.go rename to x-pack/elastic-agent/pkg/fleetapi/ack_cmd_test.go diff --git a/x-pack/agent/pkg/fleetapi/action.go b/x-pack/elastic-agent/pkg/fleetapi/action.go similarity index 97% rename from x-pack/agent/pkg/fleetapi/action.go rename to x-pack/elastic-agent/pkg/fleetapi/action.go index 1009531a4514..bf59bc22e1aa 100644 --- a/x-pack/agent/pkg/fleetapi/action.go +++ b/x-pack/elastic-agent/pkg/fleetapi/action.go @@ -9,7 +9,7 @@ import ( "fmt" "strings" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" ) // Action base interface for all the implemented action from the fleet API. diff --git a/x-pack/agent/pkg/fleetapi/checkin_cmd.go b/x-pack/elastic-agent/pkg/fleetapi/checkin_cmd.go similarity index 97% rename from x-pack/agent/pkg/fleetapi/checkin_cmd.go rename to x-pack/elastic-agent/pkg/fleetapi/checkin_cmd.go index e0994d7a9de1..80ce76d5b55b 100644 --- a/x-pack/agent/pkg/fleetapi/checkin_cmd.go +++ b/x-pack/elastic-agent/pkg/fleetapi/checkin_cmd.go @@ -13,7 +13,7 @@ import ( "net/http" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" ) const checkingPath = "/api/ingest_manager/fleet/agents/%s/checkin" diff --git a/x-pack/agent/pkg/fleetapi/checkin_cmd_test.go b/x-pack/elastic-agent/pkg/fleetapi/checkin_cmd_test.go similarity index 100% rename from x-pack/agent/pkg/fleetapi/checkin_cmd_test.go rename to x-pack/elastic-agent/pkg/fleetapi/checkin_cmd_test.go diff --git a/x-pack/agent/pkg/fleetapi/client.go b/x-pack/elastic-agent/pkg/fleetapi/client.go similarity index 90% rename from x-pack/agent/pkg/fleetapi/client.go rename to x-pack/elastic-agent/pkg/fleetapi/client.go index d756c05c2d42..648620dcab98 100644 --- a/x-pack/agent/pkg/fleetapi/client.go +++ b/x-pack/elastic-agent/pkg/fleetapi/client.go @@ -14,11 +14,11 @@ import ( "net/url" "os" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/kibana" - "github.com/elastic/beats/v7/x-pack/agent/pkg/release" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/kibana" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release" ) type clienter interface { diff --git a/x-pack/agent/pkg/fleetapi/client_test.go b/x-pack/elastic-agent/pkg/fleetapi/client_test.go similarity index 95% rename from x-pack/agent/pkg/fleetapi/client_test.go rename to x-pack/elastic-agent/pkg/fleetapi/client_test.go index e60496b86735..305bbafc1174 100644 --- a/x-pack/agent/pkg/fleetapi/client_test.go +++ b/x-pack/elastic-agent/pkg/fleetapi/client_test.go @@ -16,10 +16,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/kibana" - "github.com/elastic/beats/v7/x-pack/agent/pkg/release" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/kibana" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release" ) func TestHTTPClient(t *testing.T) { diff --git a/x-pack/agent/pkg/fleetapi/custom_type.go b/x-pack/elastic-agent/pkg/fleetapi/custom_type.go similarity index 100% rename from x-pack/agent/pkg/fleetapi/custom_type.go rename to x-pack/elastic-agent/pkg/fleetapi/custom_type.go diff --git a/x-pack/agent/pkg/fleetapi/custom_type_test.go b/x-pack/elastic-agent/pkg/fleetapi/custom_type_test.go similarity index 100% rename from x-pack/agent/pkg/fleetapi/custom_type_test.go rename to x-pack/elastic-agent/pkg/fleetapi/custom_type_test.go diff --git a/x-pack/agent/pkg/fleetapi/enroll_cmd.go b/x-pack/elastic-agent/pkg/fleetapi/enroll_cmd.go similarity index 93% rename from x-pack/agent/pkg/fleetapi/enroll_cmd.go rename to x-pack/elastic-agent/pkg/fleetapi/enroll_cmd.go index 45ffde76c767..c7410baa0e7b 100644 --- a/x-pack/agent/pkg/fleetapi/enroll_cmd.go +++ b/x-pack/elastic-agent/pkg/fleetapi/enroll_cmd.go @@ -14,10 +14,10 @@ import ( "github.com/hashicorp/go-multierror" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" ) -// EnrollType is the type of enrollment to do with the agent. +// EnrollType is the type of enrollment to do with the elastic-agent. type EnrollType string const ( @@ -64,7 +64,7 @@ func (p EnrollType) MarshalJSON() ([]byte, error) { return json.Marshal(v) } -// EnrollRequest is the data required to enroll the agent into Fleet. +// EnrollRequest is the data required to enroll the elastic-agent into Fleet. // // Example: // POST /api/ingest_manager/fleet/agents/enroll @@ -82,7 +82,7 @@ type EnrollRequest struct { Metadata Metadata `json:"metadata"` } -// Metadata is a all the metadata send or received from the agent. +// Metadata is a all the metadata send or received from the elastic-agent. type Metadata struct { Local map[string]interface{} `json:"local"` UserProvided map[string]interface{} `json:"user_provided"` @@ -159,7 +159,7 @@ func (e *EnrollResponse) Validate() error { return err } -// EnrollCmd is the command to be executed to enroll an agent into Fleet. +// EnrollCmd is the command to be executed to enroll an elastic-agent into Fleet. type EnrollCmd struct { client clienter } diff --git a/x-pack/agent/pkg/fleetapi/enroll_cmd_test.go b/x-pack/elastic-agent/pkg/fleetapi/enroll_cmd_test.go similarity index 96% rename from x-pack/agent/pkg/fleetapi/enroll_cmd_test.go rename to x-pack/elastic-agent/pkg/fleetapi/enroll_cmd_test.go index ef46d8c89e0b..c4f79c7cb382 100644 --- a/x-pack/agent/pkg/fleetapi/enroll_cmd_test.go +++ b/x-pack/elastic-agent/pkg/fleetapi/enroll_cmd_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/kibana" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/kibana" ) func TestEnroll(t *testing.T) { diff --git a/x-pack/agent/pkg/fleetapi/helper_test.go b/x-pack/elastic-agent/pkg/fleetapi/helper_test.go similarity index 91% rename from x-pack/agent/pkg/fleetapi/helper_test.go rename to x-pack/elastic-agent/pkg/fleetapi/helper_test.go index 3c5c5bbd4b80..89b9e913a478 100644 --- a/x-pack/agent/pkg/fleetapi/helper_test.go +++ b/x-pack/elastic-agent/pkg/fleetapi/helper_test.go @@ -13,8 +13,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/kibana" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/kibana" ) func authHandler(handler http.HandlerFunc, apiKey string) http.HandlerFunc { diff --git a/x-pack/agent/pkg/fleetapi/round_trippers.go b/x-pack/elastic-agent/pkg/fleetapi/round_trippers.go similarity index 97% rename from x-pack/agent/pkg/fleetapi/round_trippers.go rename to x-pack/elastic-agent/pkg/fleetapi/round_trippers.go index de46b42426ed..d163272e50d7 100644 --- a/x-pack/agent/pkg/fleetapi/round_trippers.go +++ b/x-pack/elastic-agent/pkg/fleetapi/round_trippers.go @@ -8,7 +8,7 @@ import ( "errors" "net/http" - "github.com/elastic/beats/v7/x-pack/agent/pkg/kibana" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/kibana" ) // ErrInvalidAPIKey is returned when authentication fail to fleet. diff --git a/x-pack/agent/pkg/id/generate.go b/x-pack/elastic-agent/pkg/id/generate.go similarity index 100% rename from x-pack/agent/pkg/id/generate.go rename to x-pack/elastic-agent/pkg/id/generate.go diff --git a/x-pack/agent/pkg/id/generate_test.go b/x-pack/elastic-agent/pkg/id/generate_test.go similarity index 100% rename from x-pack/agent/pkg/id/generate_test.go rename to x-pack/elastic-agent/pkg/id/generate_test.go diff --git a/x-pack/agent/pkg/kibana/client.go b/x-pack/elastic-agent/pkg/kibana/client.go similarity index 97% rename from x-pack/agent/pkg/kibana/client.go rename to x-pack/elastic-agent/pkg/kibana/client.go index e8d588edb5b8..9e7b7dfcd0d6 100644 --- a/x-pack/agent/pkg/kibana/client.go +++ b/x-pack/elastic-agent/pkg/kibana/client.go @@ -17,8 +17,8 @@ import ( "github.com/elastic/beats/v7/libbeat/common" "github.com/elastic/beats/v7/libbeat/common/transport" "github.com/elastic/beats/v7/libbeat/common/transport/tlscommon" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) const kibanaPort = 5601 diff --git a/x-pack/agent/pkg/kibana/client_test.go b/x-pack/elastic-agent/pkg/kibana/client_test.go similarity index 98% rename from x-pack/agent/pkg/kibana/client_test.go rename to x-pack/elastic-agent/pkg/kibana/client_test.go index 51d29f29813f..c750c889d819 100644 --- a/x-pack/agent/pkg/kibana/client_test.go +++ b/x-pack/elastic-agent/pkg/kibana/client_test.go @@ -18,8 +18,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/x-pack/agent/pkg/config" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) func noopWrapper(rt http.RoundTripper) (http.RoundTripper, error) { diff --git a/x-pack/agent/pkg/kibana/config.go b/x-pack/elastic-agent/pkg/kibana/config.go similarity index 100% rename from x-pack/agent/pkg/kibana/config.go rename to x-pack/elastic-agent/pkg/kibana/config.go diff --git a/x-pack/agent/pkg/kibana/round_trippers.go b/x-pack/elastic-agent/pkg/kibana/round_trippers.go similarity index 100% rename from x-pack/agent/pkg/kibana/round_trippers.go rename to x-pack/elastic-agent/pkg/kibana/round_trippers.go diff --git a/x-pack/agent/pkg/packer/packer.go b/x-pack/elastic-agent/pkg/packer/packer.go similarity index 97% rename from x-pack/agent/pkg/packer/packer.go rename to x-pack/elastic-agent/pkg/packer/packer.go index 7d62e6a024fe..f6fa241f38d4 100644 --- a/x-pack/agent/pkg/packer/packer.go +++ b/x-pack/elastic-agent/pkg/packer/packer.go @@ -14,7 +14,7 @@ import ( "path/filepath" "strings" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" ) // PackMap represents multiples files packed, the key represent the path of the file and raw bytes of diff --git a/x-pack/agent/pkg/packer/packer_test.go b/x-pack/elastic-agent/pkg/packer/packer_test.go similarity index 100% rename from x-pack/agent/pkg/packer/packer_test.go rename to x-pack/elastic-agent/pkg/packer/packer_test.go diff --git a/x-pack/agent/pkg/release/release_dev.go b/x-pack/elastic-agent/pkg/release/release_dev.go similarity index 100% rename from x-pack/agent/pkg/release/release_dev.go rename to x-pack/elastic-agent/pkg/release/release_dev.go diff --git a/x-pack/agent/pkg/release/version.go b/x-pack/elastic-agent/pkg/release/version.go similarity index 95% rename from x-pack/agent/pkg/release/version.go rename to x-pack/elastic-agent/pkg/release/version.go index 946e608c31e0..fdb19bdf4f9f 100644 --- a/x-pack/agent/pkg/release/version.go +++ b/x-pack/elastic-agent/pkg/release/version.go @@ -9,7 +9,7 @@ import ( "time" ) -// version is the current version of the agent. +// version is the current version of the elastic-agent. var version = "8.0.0" // buildHash is the hash of the current build. diff --git a/x-pack/agent/pkg/release/version_test.go b/x-pack/elastic-agent/pkg/release/version_test.go similarity index 100% rename from x-pack/agent/pkg/release/version_test.go rename to x-pack/elastic-agent/pkg/release/version_test.go diff --git a/x-pack/agent/pkg/reporter/backend.go b/x-pack/elastic-agent/pkg/reporter/backend.go similarity index 100% rename from x-pack/agent/pkg/reporter/backend.go rename to x-pack/elastic-agent/pkg/reporter/backend.go diff --git a/x-pack/agent/pkg/reporter/event.go b/x-pack/elastic-agent/pkg/reporter/event.go similarity index 100% rename from x-pack/agent/pkg/reporter/event.go rename to x-pack/elastic-agent/pkg/reporter/event.go diff --git a/x-pack/agent/pkg/reporter/fleet/config.go b/x-pack/elastic-agent/pkg/reporter/fleet/config.go similarity index 100% rename from x-pack/agent/pkg/reporter/fleet/config.go rename to x-pack/elastic-agent/pkg/reporter/fleet/config.go diff --git a/x-pack/agent/pkg/reporter/fleet/reporter.go b/x-pack/elastic-agent/pkg/reporter/fleet/reporter.go similarity index 95% rename from x-pack/agent/pkg/reporter/fleet/reporter.go rename to x-pack/elastic-agent/pkg/reporter/fleet/reporter.go index 7f8799b93c3f..b4144a4da08b 100644 --- a/x-pack/agent/pkg/reporter/fleet/reporter.go +++ b/x-pack/elastic-agent/pkg/reporter/fleet/reporter.go @@ -9,9 +9,9 @@ import ( "sync" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" - "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter" ) const ( diff --git a/x-pack/agent/pkg/reporter/fleet/reporter_test.go b/x-pack/elastic-agent/pkg/reporter/fleet/reporter_test.go similarity index 97% rename from x-pack/agent/pkg/reporter/fleet/reporter_test.go rename to x-pack/elastic-agent/pkg/reporter/fleet/reporter_test.go index 61ed46c1169c..d3a2d902a63f 100644 --- a/x-pack/agent/pkg/reporter/fleet/reporter_test.go +++ b/x-pack/elastic-agent/pkg/reporter/fleet/reporter_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" - "github.com/elastic/beats/v7/x-pack/agent/pkg/fleetapi" - "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/fleetapi" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter" ) func TestEventsHaveAgentID(t *testing.T) { diff --git a/x-pack/agent/pkg/reporter/log/config.go b/x-pack/elastic-agent/pkg/reporter/log/config.go similarity index 100% rename from x-pack/agent/pkg/reporter/log/config.go rename to x-pack/elastic-agent/pkg/reporter/log/config.go diff --git a/x-pack/agent/pkg/reporter/log/format.go b/x-pack/elastic-agent/pkg/reporter/log/format.go similarity index 100% rename from x-pack/agent/pkg/reporter/log/format.go rename to x-pack/elastic-agent/pkg/reporter/log/format.go diff --git a/x-pack/agent/pkg/reporter/log/reporter.go b/x-pack/elastic-agent/pkg/reporter/log/reporter.go similarity index 96% rename from x-pack/agent/pkg/reporter/log/reporter.go rename to x-pack/elastic-agent/pkg/reporter/log/reporter.go index 04fc28c394b2..c57e46bd718d 100644 --- a/x-pack/agent/pkg/reporter/log/reporter.go +++ b/x-pack/elastic-agent/pkg/reporter/log/reporter.go @@ -9,7 +9,7 @@ import ( "encoding/json" "fmt" - "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter" ) type logger interface { diff --git a/x-pack/agent/pkg/reporter/log/reporter_test.go b/x-pack/elastic-agent/pkg/reporter/log/reporter_test.go similarity index 97% rename from x-pack/agent/pkg/reporter/log/reporter_test.go rename to x-pack/elastic-agent/pkg/reporter/log/reporter_test.go index a551809f0f7a..cf361e1395ed 100644 --- a/x-pack/agent/pkg/reporter/log/reporter_test.go +++ b/x-pack/elastic-agent/pkg/reporter/log/reporter_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter" ) type testCase struct { diff --git a/x-pack/agent/pkg/reporter/noop/reporter.go b/x-pack/elastic-agent/pkg/reporter/noop/reporter.go similarity index 92% rename from x-pack/agent/pkg/reporter/noop/reporter.go rename to x-pack/elastic-agent/pkg/reporter/noop/reporter.go index 6412c9ff1625..01e10fb41848 100644 --- a/x-pack/agent/pkg/reporter/noop/reporter.go +++ b/x-pack/elastic-agent/pkg/reporter/noop/reporter.go @@ -7,7 +7,7 @@ package noop import ( "context" - "github.com/elastic/beats/v7/x-pack/agent/pkg/reporter" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter" ) // Reporter is a reporter without any effects, serves just as a showcase for further implementations. diff --git a/x-pack/agent/pkg/reporter/reporter.go b/x-pack/elastic-agent/pkg/reporter/reporter.go similarity index 96% rename from x-pack/agent/pkg/reporter/reporter.go rename to x-pack/elastic-agent/pkg/reporter/reporter.go index 74bea56a7608..d10cb5ece051 100644 --- a/x-pack/agent/pkg/reporter/reporter.go +++ b/x-pack/elastic-agent/pkg/reporter/reporter.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/go-multierror" - "github.com/elastic/beats/v7/x-pack/agent/pkg/agent/errors" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/logger" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" ) const ( diff --git a/x-pack/agent/pkg/reporter/reporter_test.go b/x-pack/elastic-agent/pkg/reporter/reporter_test.go similarity index 100% rename from x-pack/agent/pkg/reporter/reporter_test.go rename to x-pack/elastic-agent/pkg/reporter/reporter_test.go diff --git a/x-pack/agent/pkg/scheduler/scheduler.go b/x-pack/elastic-agent/pkg/scheduler/scheduler.go similarity index 100% rename from x-pack/agent/pkg/scheduler/scheduler.go rename to x-pack/elastic-agent/pkg/scheduler/scheduler.go diff --git a/x-pack/agent/pkg/scheduler/scheduler_test.go b/x-pack/elastic-agent/pkg/scheduler/scheduler_test.go similarity index 100% rename from x-pack/agent/pkg/scheduler/scheduler_test.go rename to x-pack/elastic-agent/pkg/scheduler/scheduler_test.go diff --git a/x-pack/agent/pkg/sorted/set.go b/x-pack/elastic-agent/pkg/sorted/set.go similarity index 100% rename from x-pack/agent/pkg/sorted/set.go rename to x-pack/elastic-agent/pkg/sorted/set.go diff --git a/x-pack/agent/pkg/sorted/set_test.go b/x-pack/elastic-agent/pkg/sorted/set_test.go similarity index 100% rename from x-pack/agent/pkg/sorted/set_test.go rename to x-pack/elastic-agent/pkg/sorted/set_test.go diff --git a/x-pack/agent/pkg/tokenbucket/token_bucket.go b/x-pack/elastic-agent/pkg/tokenbucket/token_bucket.go similarity index 96% rename from x-pack/agent/pkg/tokenbucket/token_bucket.go rename to x-pack/elastic-agent/pkg/tokenbucket/token_bucket.go index 2caba44ddb2b..681fffdc470c 100644 --- a/x-pack/agent/pkg/tokenbucket/token_bucket.go +++ b/x-pack/elastic-agent/pkg/tokenbucket/token_bucket.go @@ -8,7 +8,7 @@ import ( "fmt" "time" - "github.com/elastic/beats/v7/x-pack/agent/pkg/scheduler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/scheduler" ) // Bucket is a Token Bucket for rate limiting diff --git a/x-pack/agent/pkg/tokenbucket/token_bucket_test.go b/x-pack/elastic-agent/pkg/tokenbucket/token_bucket_test.go similarity index 97% rename from x-pack/agent/pkg/tokenbucket/token_bucket_test.go rename to x-pack/elastic-agent/pkg/tokenbucket/token_bucket_test.go index f1ad6c452a06..8c87d9460471 100644 --- a/x-pack/agent/pkg/tokenbucket/token_bucket_test.go +++ b/x-pack/elastic-agent/pkg/tokenbucket/token_bucket_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/elastic/beats/v7/x-pack/agent/pkg/scheduler" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/scheduler" ) func TestTokenBucket(t *testing.T) { diff --git a/x-pack/agent/proto/remote_config.proto b/x-pack/elastic-agent/proto/remote_config.proto similarity index 100% rename from x-pack/agent/proto/remote_config.proto rename to x-pack/elastic-agent/proto/remote_config.proto diff --git a/x-pack/agent/spec/auditbeat.yml.disabled b/x-pack/elastic-agent/spec/auditbeat.yml.disabled similarity index 100% rename from x-pack/agent/spec/auditbeat.yml.disabled rename to x-pack/elastic-agent/spec/auditbeat.yml.disabled diff --git a/x-pack/agent/spec/filebeat.yml b/x-pack/elastic-agent/spec/filebeat.yml similarity index 100% rename from x-pack/agent/spec/filebeat.yml rename to x-pack/elastic-agent/spec/filebeat.yml diff --git a/x-pack/agent/spec/heartbeat.yml.disabled b/x-pack/elastic-agent/spec/heartbeat.yml.disabled similarity index 100% rename from x-pack/agent/spec/heartbeat.yml.disabled rename to x-pack/elastic-agent/spec/heartbeat.yml.disabled diff --git a/x-pack/agent/spec/journalbeat.yml.disabled b/x-pack/elastic-agent/spec/journalbeat.yml.disabled similarity index 100% rename from x-pack/agent/spec/journalbeat.yml.disabled rename to x-pack/elastic-agent/spec/journalbeat.yml.disabled diff --git a/x-pack/agent/spec/metricbeat.yml b/x-pack/elastic-agent/spec/metricbeat.yml similarity index 100% rename from x-pack/agent/spec/metricbeat.yml rename to x-pack/elastic-agent/spec/metricbeat.yml diff --git a/x-pack/libbeat/management/fleet/config_server.go b/x-pack/libbeat/management/fleet/config_server.go index 9373e453d916..5a74d50c981f 100644 --- a/x-pack/libbeat/management/fleet/config_server.go +++ b/x-pack/libbeat/management/fleet/config_server.go @@ -11,7 +11,7 @@ import ( "time" "github.com/elastic/beats/v7/libbeat/common" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/remoteconfig/grpc" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/remoteconfig/grpc" ) const ( diff --git a/x-pack/libbeat/management/fleet/manager.go b/x-pack/libbeat/management/fleet/manager.go index 2f878206e6c6..483b697eda38 100644 --- a/x-pack/libbeat/management/fleet/manager.go +++ b/x-pack/libbeat/management/fleet/manager.go @@ -18,7 +18,7 @@ import ( "github.com/elastic/beats/v7/libbeat/common/reload" "github.com/elastic/beats/v7/libbeat/logp" "github.com/elastic/beats/v7/libbeat/management" - "github.com/elastic/beats/v7/x-pack/agent/pkg/core/plugin/server" + "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/plugin/server" "github.com/elastic/beats/v7/x-pack/libbeat/management/api" xmanagement "github.com/elastic/beats/v7/x-pack/libbeat/management"