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

Commit

Permalink
fix: make docker namespace configurable (#560) (#561)
Browse files Browse the repository at this point in the history
* fix: use observability-ci namespace in snapshots

* fix: forgot to update compose file for the agent

* fix: apply CI snapshots namespace to metricbeat too

* fix: wrong copy paste
# Conflicts:
#	cli/config/compose/services/elastic-agent/docker-compose.yml
#	cli/config/compose/services/metricbeat/docker-compose.yml
  • Loading branch information
mdelapenya committed Jan 7, 2021
1 parent a5e8384 commit 7e7cebe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2.3'
services:
elastic-agent:
image: docker.elastic.co/beats/elastic-agent${elasticAgentDockerImageSuffix}:${elasticAgentTag:-7.x-SNAPSHOT}
image: docker.elastic.co/${elasticAgentDockerNamespace:-beats}/elastic-agent${elasticAgentDockerImageSuffix}:${elasticAgentTag:-7.x-SNAPSHOT}
container_name: ${elasticAgentContainerName}
depends_on:
elasticsearch:
Expand Down
2 changes: 1 addition & 1 deletion cli/config/compose/services/metricbeat/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
]
environment:
- BEAT_STRICT_PERMS=${beatStricPerms:-false}
image: "docker.elastic.co/beats/metricbeat:${metricbeatTag:-7.x-SNAPSHOT}"
image: "docker.elastic.co/${metricbeatDockerNamespace:-beats}/metricbeat:${metricbeatTag:-7.x-SNAPSHOT}"
labels:
co.elastic.logs/module: "${serviceName}"
volumes:
Expand Down
7 changes: 7 additions & 0 deletions e2e/_suites/fleet/stand-alone.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/cucumber/godog"
"github.com/elastic/e2e-testing/cli/docker"
"github.com/elastic/e2e-testing/cli/services"
"github.com/elastic/e2e-testing/cli/shell"
"github.com/elastic/e2e-testing/e2e"
log "github.com/sirupsen/logrus"
)
Expand Down Expand Up @@ -69,6 +70,12 @@ func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployed(image string) error
profileEnv["elasticAgentDockerImageSuffix"] = "-" + image
}

profileEnv["elasticAgentDockerNamespace"] = "beats"
useCISnapshots, _ := shell.GetEnvBool("ELASTIC_AGENT_USE_CI_SNAPSHOTS")
if useCISnapshots {
profileEnv["elasticAgentDockerNamespace"] = "observability-ci"
}

containerName := fmt.Sprintf("%s_%s_%d", FleetProfileName, ElasticAgentServiceName, 1)

configurationFileURL := "https://github.com/raw/elastic/beats/master/x-pack/elastic-agent/elastic-agent.docker.yml"
Expand Down
6 changes: 6 additions & 0 deletions e2e/_suites/metricbeat/metricbeat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ func (mts *MetricbeatTestSuite) runMetricbeatService() error {
"serviceName": mts.ServiceName,
}

env["metricbeatDockerNamespace"] = "beats"
useCISnapshots, _ := shell.GetEnvBool("ELASTIC_AGENT_USE_CI_SNAPSHOTS")
if useCISnapshots {
env["metricbeatDockerNamespace"] = "observability-ci"
}

err := serviceManager.AddServicesToCompose("metricbeat", []string{"metricbeat"}, env)
if err != nil {
log.WithFields(log.Fields{
Expand Down

0 comments on commit 7e7cebe

Please sign in to comment.