Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Commit bd23e49

Browse files
committed
chore: append "-amd64" label for Docker images (#787)
* chore: append "-amd64" suffix to docker images * chore: append "-amd64" suffix for locally-loaded Docker images * chore: make sure we tag the image after it's loaded * fix: properly load & tag ubi8 images * fix: only add the platform label for local or CI snapshots
1 parent 2cbc83b commit bd23e49

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

e2e/_suites/fleet/installers.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package main
66

77
import (
88
"fmt"
9+
"time"
910

1011
"github.com/elastic/e2e-testing/cli/docker"
1112
"github.com/elastic/e2e-testing/e2e"
@@ -152,11 +153,14 @@ func (i *DockerPackage) Preinstall() error {
152153
return err
153154
}
154155

156+
// wait for tagging to ensure the loaded image is present
157+
e2e.Sleep(3 * time.Second)
158+
155159
// we need to tag the loaded image because its tag relates to the target branch,
156160
// and we want it to use the 'pr-12345' format.
157161
return docker.TagImage(
158162
"docker.elastic.co/beats/"+i.artifact+":"+agentVersionBase,
159-
"docker.elastic.co/observability-ci/"+i.artifact+":"+i.originalVersion,
163+
"docker.elastic.co/observability-ci/"+i.artifact+":"+i.originalVersion+"-amd64",
160164
)
161165
}
162166

e2e/_suites/fleet/services.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ func newDockerInstaller(ubi8 bool, version string) (ElasticAgentInstaller, error
355355
artifactName := artifact
356356
if ubi8 {
357357
artifactName = "elastic-agent-ubi8"
358+
image = "elastic-agent-ubi8"
358359
}
359360

360361
os := "linux"
@@ -383,9 +384,9 @@ func newDockerInstaller(ubi8 bool, version string) (ElasticAgentInstaller, error
383384
return nil
384385
}
385386

386-
installerPackage := NewDockerPackage(binaryName, profile, image, service, binaryPath, ubi8).
387+
installerPackage := NewDockerPackage(binaryName, profile, artifactName, service, binaryPath, ubi8).
387388
WithArch(arch).
388-
WithArtifact(artifact).
389+
WithArtifact(artifactName).
389390
WithOS(os).
390391
WithVersion(version)
391392

e2e/_suites/fleet/stand-alone.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ func (sats *StandAloneTestSuite) contributeSteps(s *godog.ScenarioContext) {
6363
func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployed(image string) error {
6464
log.Trace("Deploying an agent to Fleet")
6565

66+
dockerImageTag := agentVersion
67+
6668
useCISnapshots := shell.GetEnvBool("BEATS_USE_CI_SNAPSHOTS")
6769
beatsLocalPath := shell.GetEnv("BEATS_LOCAL_PATH", "")
6870
if useCISnapshots || beatsLocalPath != "" {
@@ -72,6 +74,8 @@ func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployed(image string) error
7274
dockerInstaller := GetElasticAgentInstaller("docker", image, agentVersion)
7375

7476
dockerInstaller.PreInstallFn()
77+
78+
dockerImageTag += "-amd64"
7579
}
7680

7781
serviceManager := services.NewServiceManager()
@@ -96,7 +100,7 @@ func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployed(image string) error
96100
profileEnv["elasticAgentContainerName"] = containerName
97101
profileEnv["elasticAgentConfigFile"] = sats.AgentConfigFilePath
98102
profileEnv["elasticAgentPlatform"] = "linux/amd64"
99-
profileEnv["elasticAgentTag"] = agentVersion
103+
profileEnv["elasticAgentTag"] = dockerImageTag
100104

101105
err = serviceManager.AddServicesToCompose(context.Background(), FleetProfileName, []string{ElasticAgentServiceName}, profileEnv)
102106
if err != nil {

e2e/_suites/metricbeat/metricbeat_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ func (mts *MetricbeatTestSuite) runMetricbeatService() error {
408408

409409
err = docker.TagImage(
410410
"docker.elastic.co/beats/metricbeat:"+metricbeatVersionBase,
411-
"docker.elastic.co/observability-ci/metricbeat:"+mts.Version,
411+
"docker.elastic.co/observability-ci/metricbeat:"+mts.Version+"-amd64",
412412
)
413413
}
414414

@@ -436,7 +436,7 @@ func (mts *MetricbeatTestSuite) runMetricbeatService() error {
436436
"metricbeatConfigFile": mts.configurationFile,
437437
"metricbeatTag": mts.Version,
438438
"stackVersion": stackVersion,
439-
mts.ServiceName + "Tag": mts.ServiceVersion,
439+
mts.ServiceName + "Tag": mts.ServiceVersion + "-amd64",
440440
"serviceName": mts.ServiceName,
441441
}
442442

0 commit comments

Comments
 (0)