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

chore: append "-amd64" label for Docker images #787

Merged
merged 5 commits into from
Feb 22, 2021
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
6 changes: 5 additions & 1 deletion e2e/_suites/fleet/installers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package main

import (
"fmt"
"time"

"github.com/elastic/e2e-testing/cli/docker"
"github.com/elastic/e2e-testing/e2e"
Expand Down Expand Up @@ -150,11 +151,14 @@ func (i *DockerPackage) Preinstall() error {
return err
}

// wait for tagging to ensure the loaded image is present
e2e.Sleep(3 * time.Second)
Copy link
Contributor Author

@mdelapenya mdelapenya Feb 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen errors on CI with not found images, as load and tag executed in the same second.


// we need to tag the loaded image because its tag relates to the target branch,
// and we want it to use the 'pr-12345' format.
return docker.TagImage(
"docker.elastic.co/beats/"+i.artifact+":"+agentVersionBase,
"docker.elastic.co/observability-ci/"+i.artifact+":"+i.originalVersion,
"docker.elastic.co/observability-ci/"+i.artifact+":"+i.originalVersion+"-amd64",
)
}

Expand Down
5 changes: 3 additions & 2 deletions e2e/_suites/fleet/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ func newDockerInstaller(ubi8 bool, version string) (ElasticAgentInstaller, error
artifactName := artifact
if ubi8 {
artifactName = "elastic-agent-ubi8"
image = "elastic-agent-ubi8"
}

os := "linux"
Expand Down Expand Up @@ -383,9 +384,9 @@ func newDockerInstaller(ubi8 bool, version string) (ElasticAgentInstaller, error
return nil
}

installerPackage := NewDockerPackage(binaryName, profile, image, service, binaryPath, ubi8).
installerPackage := NewDockerPackage(binaryName, profile, artifactName, service, binaryPath, ubi8).
WithArch(arch).
WithArtifact(artifact).
WithArtifact(artifactName).
WithOS(os).
WithVersion(version)

Expand Down
6 changes: 5 additions & 1 deletion e2e/_suites/fleet/stand-alone.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func (sats *StandAloneTestSuite) contributeSteps(s *godog.ScenarioContext) {
func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployed(image string) error {
log.Trace("Deploying an agent to Fleet")

dockerImageTag := agentVersion

useCISnapshots := shell.GetEnvBool("BEATS_USE_CI_SNAPSHOTS")
beatsLocalPath := shell.GetEnv("BEATS_LOCAL_PATH", "")
if useCISnapshots || beatsLocalPath != "" {
Expand All @@ -72,6 +74,8 @@ func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployed(image string) error
dockerInstaller := GetElasticAgentInstaller("docker", image, agentVersion)

dockerInstaller.PreInstallFn()

dockerImageTag += "-amd64"
}

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

err = serviceManager.AddServicesToCompose(context.Background(), FleetProfileName, []string{ElasticAgentServiceName}, profileEnv)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions e2e/_suites/metricbeat/metricbeat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func (mts *MetricbeatTestSuite) runMetricbeatService() error {

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

Expand Down Expand Up @@ -436,7 +436,7 @@ func (mts *MetricbeatTestSuite) runMetricbeatService() error {
"metricbeatConfigFile": mts.configurationFile,
"metricbeatTag": mts.Version,
"stackVersion": stackVersion,
mts.ServiceName + "Tag": mts.ServiceVersion,
mts.ServiceName + "Tag": mts.ServiceVersion + "-amd64",
"serviceName": mts.ServiceName,
}

Expand Down