compose/internal/e2e/testdata/TestPreStartHookExtraHosts/compose.yaml
Nicolas De Loof 8c67b155ea refactor(e2e): move the e2e framework and tests out of pkg/
The e2e framework (framework.go, scenario.go, checks.go, assert.go) and
the e2e tests lived under pkg/e2e, so the framework was published as part
of the public /v5 API although it is only test support code. Move it to
internal/e2e.

This is a pure move: the files keep their content, only the references to
the old path (Makefile, .golangci.yml, codecov.yml, .gitignore, AGENTS.md
and SCENARIO.md) are updated. internal/e2e is at the same depth as
pkg/e2e, so the relative paths to bin/, relay/ and testdata keep working.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2026-11-16 15:21:04 +01:00

21 lines
793 B
YAML

services:
app:
image: alpine
init: true
command: sleep infinity
extra_hosts:
- "inherited-host:192.0.2.10"
- "shared-host:192.0.2.11"
pre_start:
# no extra_hosts declared: the service's entries are inherited
- command: sh -c 'grep inherited-host /etc/hosts'
# declared extra_hosts complete the inherited ones; entries for the
# same hostname accumulate, exactly like the compose file merge rules
- command: >
sh -c 'grep declared-host /etc/hosts &&
grep inherited-host /etc/hosts &&
grep "192.0.2.99.*shared-host" /etc/hosts &&
grep "192.0.2.11.*shared-host" /etc/hosts'
extra_hosts:
- "declared-host:192.0.2.20"
- "shared-host:192.0.2.99"