internal/projectloader and pkg/compose each rebuilt a service definition from the containers of a project with the same bootstrap and replica counting. Keep it in internal/projectloader and call it from both.
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Two comments still located waitDependency's runtime fallback in
service_containers.go.
Comments only.
Part of #14081
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Unescape the remaining path in both branches and cover the
ports[].mode reporting path with a dotted service name.
Signed-off-by: huang <13165998033@163.com>
compose-go escapes a literal dot in a path segment as an internal
sentinel, and splitServicePath returned the raw segment. A service named
"my.service" was therefore reported as "my👻service" in warnings.
Unescape the segment with tree.Path(...).String().
Signed-off-by: huang <13165998033@163.com>
LoadProject and Generate (the api.ProjectLoader operations) need two things
from the engine: the Docker API, to read the containers a project is
generated from, and the Docker CLI, which resolves remote Compose files.
They now live in internal/projectloader, along with the unsupported
attributes detection only the loader uses, behind a Backend interface that
composeService implements in a new file of pkg/compose, like internal/inspect.
The tests move with the code; their assertions are unchanged, only the way
the service is built differs.
The canonical container name, which both this package and internal/inspect
need, moves to a tiny internal/naming package instead of being copied a
third time. pkg/compose keeps its own copy until the shared kernel is
extracted.
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>