Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce ResolveRelativePaths as a distinct operation vs Normalization #414

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented Jun 2, 2023

Normalization is used both to define implicit resources and to resolve relative paths, so it brings a parameter so apply load option ResolvePaths
this PR introduces and explicit ResolveRelativePaths to manage this option as an explicit load operation
this also allows to avoid duplicating the code when loading service extends and resolving basefile-relative paths

@ndeloof ndeloof force-pushed the relative_paths branch 2 times, most recently from 96d3404 to ea79f1e Compare June 2, 2023 14:24
@milas milas requested review from glours and milas June 2, 2023 18:32
Copy link
Member

@milas milas left a comment

Choose a reason for hiding this comment

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

Looks like a small issue on Windows with escapes 🙄 but LGTM! Waaaay better separation of concerns ✨

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

@ndeloof ndeloof merged commit 8e0e2c3 into compose-spec:master Jun 7, 2023
@ndeloof ndeloof deleted the relative_paths branch June 7, 2023 14:19
@@ -185,6 +185,7 @@ func Load(configDetails types.ConfigDetails, options ...func(*Options)) (*types.
LookupValue: configDetails.LookupEnv,
TypeCastMapping: interpolateTypeCastMapping,
},
ResolvePaths: true,

Choose a reason for hiding this comment

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

@ndeloof this is a change in default behavior right? Before this was false by default.
If I explicitly set it to false through the options argument of the Load function the behavior would be the same as before this change right?

Copy link

Choose a reason for hiding this comment

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

The 'ResolvePaths' make the unit-test fail in the nerdctl :-)
relate : containerd/nerdctl#2338

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@tomfeigin code that has been moved into ResolveRelativePaths used to be inside Normalize which is enabled until you explicitly set SkipNormalization, so this is not a behavior change. Just those two processing aspects have been separated into distinct flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants