Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions e2e/_suites/kubernetes-autodiscover/autodiscover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -31,8 +32,6 @@ import (

var beatVersions = map[string]string{}

const defaultBeatVersion = "8.0.0-SNAPSHOT"

var defaultEventsWaitTimeout = 60 * time.Second
var defaultDeployWaitTimeout = 60 * time.Second

Expand Down Expand Up @@ -112,17 +111,17 @@ 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", "")
if useCISnapshots || beatsLocalPath != "" {
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
}
Expand All @@ -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 {
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion internal/deploy/docker_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down