Skip to content

Conversation

ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented Jan 19, 2024

closes docker/compose#11377
closes docker/compose#11379

note: custom resource loaders defined by docker/compose will have to implement Dir(path string) returning (absolute) path for file within the remote download cache

@ndeloof ndeloof marked this pull request as draft January 19, 2024 15:05
@ndeloof ndeloof force-pushed the issue_11377 branch 8 times, most recently from 832de94 to 024ebef Compare January 19, 2024 18:12
@ndeloof ndeloof marked this pull request as ready for review January 19, 2024 18:14
Copy link
Collaborator

@glours glours left a comment

Choose a reason for hiding this comment

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

Can we keep the value of opts.ResolvePaths for the extendsOpts?
Its value can be set to false only from config command on Compose

extendsOpts.ResourceLoaders[len(opts.ResourceLoaders)-1] = localResourceLoader{
WorkingDir: localdir,
}
extendsOpts.ResolvePaths = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

This line is the root cause of the docker/compose#11377
It was introduced to remove potential import cycles 714c186

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ResolvePaths MUST be set so that ./env in a compose file that is used by extends: file=./foo/bar/compose.yaml is resolved as ./foo/bar/env and can be used as expected by the caller

Used by extend, PathResolution resolves relative paths from working directory, which is itself relative

Copy link
Collaborator

@glours glours left a comment

Choose a reason for hiding this comment

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

LGTM, I wasn't testing with the fixed version 🤦

@glours glours enabled auto-merge (rebase) January 22, 2024 10:29
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@glours glours merged commit 0e8d665 into compose-spec:main Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants