diff --git a/e2e/_suites/kubernetes-autodiscover/autodiscover_test.go b/e2e/_suites/kubernetes-autodiscover/autodiscover_test.go index 4e1d33c838..b27318a14b 100644 --- a/e2e/_suites/kubernetes-autodiscover/autodiscover_test.go +++ b/e2e/_suites/kubernetes-autodiscover/autodiscover_test.go @@ -23,6 +23,7 @@ import ( log "github.com/sirupsen/logrus" "github.com/elastic/e2e-testing/cli/config" + "github.com/elastic/e2e-testing/internal/common" "github.com/elastic/e2e-testing/internal/deploy" "github.com/elastic/e2e-testing/internal/kubernetes" "github.com/elastic/e2e-testing/internal/shell" @@ -31,8 +32,6 @@ import ( var beatVersions = map[string]string{} -const defaultBeatVersion = "7.x-SNAPSHOT" - var defaultEventsWaitTimeout = 60 * time.Second var defaultDeployWaitTimeout = 60 * time.Second @@ -112,7 +111,7 @@ func (m *podsManager) configureDockerImage(podName string) error { return nil } - beatVersion := shell.GetEnv("BEAT_VERSION", defaultBeatVersion) + beatVersion := common.BeatVersion + "-amd64" useCISnapshots := shell.GetEnvBool("BEATS_USE_CI_SNAPSHOTS") beatsLocalPath := shell.GetEnv("BEATS_LOCAL_PATH", "") @@ -120,9 +119,9 @@ func (m *podsManager) configureDockerImage(podName string) error { log.Debugf("Configuring Docker image for %s", podName) // this method will detect if the GITHUB_CHECK_SHA1 variable is set - artifactName := utils.BuildArtifactName(podName, beatVersion, defaultBeatVersion, "linux", "amd64", "tar.gz", true) + artifactName := utils.BuildArtifactName(podName, common.BeatVersion, common.BeatVersionBase, "linux", "amd64", "tar.gz", true) - imagePath, err := utils.FetchBeatsBinary(artifactName, podName, beatVersion, defaultBeatVersion, utils.TimeoutFactor, true) + imagePath, err := utils.FetchBeatsBinary(artifactName, podName, common.BeatVersion, common.BeatVersionBase, utils.TimeoutFactor, true) if err != nil { return err } @@ -133,11 +132,9 @@ func (m *podsManager) configureDockerImage(podName string) error { return err } - beatVersion = beatVersion + "-amd64" - // tag the image with the proper docker tag, including platform err = deploy.TagImage( - "docker.elastic.co/beats/"+podName+":"+defaultBeatVersion, + "docker.elastic.co/beats/"+podName+":"+common.BeatVersionBase, "docker.elastic.co/observability-ci/"+podName+":"+beatVersion, ) if err != nil { @@ -463,6 +460,8 @@ func InitializeTestSuite(ctx *godog.TestSuiteContext) { // init logger config.Init() + common.InitVersions() + defaultEventsWaitTimeout = defaultEventsWaitTimeout * time.Duration(utils.TimeoutFactor) defaultDeployWaitTimeout = defaultDeployWaitTimeout * time.Duration(utils.TimeoutFactor) diff --git a/internal/deploy/docker_client.go b/internal/deploy/docker_client.go index 88704adc2d..d4e16b3c21 100644 --- a/internal/deploy/docker_client.go +++ b/internal/deploy/docker_client.go @@ -386,7 +386,7 @@ func LoadImage(imagePath string) error { func TagImage(src string, target string) error { dockerClient := getDockerClient() - maxTimeout := 15 * time.Second + maxTimeout := 5 * time.Second * time.Duration(utils.TimeoutFactor) exp := utils.GetExponentialBackOff(maxTimeout) retryCount := 0