From 888beeedd0681332d4371a2a6b08070c380e0fb3 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Wed, 12 Feb 2020 09:01:50 +0100 Subject: [PATCH] Metricbeat fix imports in magefile (#16214) * fix magefile * try pip upgrade * fix failed test for Enroll --- .travis.yml | 3 ++- x-pack/agent/pkg/agent/application/enroll_cmd_test.go | 4 ++-- x-pack/agent/pkg/reporter/fleet/config.go | 4 ++-- x-pack/metricbeat/magefile.go | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6fc41f916e0d..0ebc30918405 100644 --- a/.travis.yml +++ b/.travis.yml @@ -238,6 +238,7 @@ addons: before_install: - python --version + # - sudo pip install -U pip - umask 022 - chmod -R go-w $GOPATH/src/github.com/elastic/beats # Docker-compose installation @@ -245,7 +246,7 @@ before_install: - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin - - if [ $TRAVIS_OS_NAME = osx ]; then pip install virtualenv; fi + - if [ $TRAVIS_OS_NAME = osx ]; then pip install virtualenv==16.7.9; fi # Skips installations step diff --git a/x-pack/agent/pkg/agent/application/enroll_cmd_test.go b/x-pack/agent/pkg/agent/application/enroll_cmd_test.go index c8c2ff0d07ca..09ad7cdbca64 100644 --- a/x-pack/agent/pkg/agent/application/enroll_cmd_test.go +++ b/x-pack/agent/pkg/agent/application/enroll_cmd_test.go @@ -96,7 +96,7 @@ func TestEnroll(t *testing.T) { }, )) - t.Run("succesfully enroll with TLS and save access api key in the store", withTLSServer( + t.Run("successfully enroll with TLS and save access api key in the store", withTLSServer( func(t *testing.T) *http.ServeMux { mux := http.NewServeMux() mux.HandleFunc("/api/fleet/agents/enroll", func(w http.ResponseWriter, r *http.Request) { @@ -156,7 +156,7 @@ func TestEnroll(t *testing.T) { }, )) - t.Run("succesfully enroll without TLS and save access api key in the store", withServer( + t.Run("successfully enroll without TLS and save access api key in the store", withServer( func(t *testing.T) *http.ServeMux { mux := http.NewServeMux() mux.HandleFunc("/api/fleet/agents/enroll", func(w http.ResponseWriter, r *http.Request) { diff --git a/x-pack/agent/pkg/reporter/fleet/config.go b/x-pack/agent/pkg/reporter/fleet/config.go index c088b3abf4d4..c1538f626b46 100644 --- a/x-pack/agent/pkg/reporter/fleet/config.go +++ b/x-pack/agent/pkg/reporter/fleet/config.go @@ -6,8 +6,8 @@ package fleet // ManagementConfig is a configuration describing fleet connected parts type ManagementConfig struct { - Threshold int `config:"threshold" validate:"min=1"` - ReportingCheckFrequency int `config:"check_frequency_sec" validate:"min=1"` + Threshold int `yaml:"threshold" config:"threshold" validate:"min=1"` + ReportingCheckFrequency int `yaml:"check_frequency_sec" config:"check_frequency_sec" validate:"min=1"` } // DefaultFleetManagementConfig initiates FleetManagementConfig with default values diff --git a/x-pack/metricbeat/magefile.go b/x-pack/metricbeat/magefile.go index 29d77379906a..34d5b3279aaa 100644 --- a/x-pack/metricbeat/magefile.go +++ b/x-pack/metricbeat/magefile.go @@ -9,6 +9,7 @@ package main import ( "context" "fmt" + "os" "time" "github.com/magefile/mage/mg"