implement normalization as a yaml transformation#589
Merged
jhrotko merged 2 commits intocompose-spec:mainfrom Feb 27, 2024
Merged
implement normalization as a yaml transformation#589jhrotko merged 2 commits intocompose-spec:mainfrom
jhrotko merged 2 commits intocompose-spec:mainfrom
Conversation
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
jhrotko
approved these changes
Feb 22, 2024
glours
approved these changes
Feb 23, 2024
Collaborator
glours
left a comment
There was a problem hiding this comment.
LGTM
Just few nits to fix
loader/loader.go
Outdated
Comment on lines
+304
to
+305
| // LoadModelWithContext reads a ConfigDetails and returns a fully loaded configuration as a yaml dictionary | ||
| func loadModelWithContext(ctx context.Context, configDetails types.ConfigDetails, opts *Options) (map[string]any, error) { |
Collaborator
There was a problem hiding this comment.
Suggested change
| // LoadModelWithContext reads a ConfigDetails and returns a fully loaded configuration as a yaml dictionary | |
| func loadModelWithContext(ctx context.Context, configDetails types.ConfigDetails, opts *Options) (map[string]any, error) { | |
| // loadModelWithContext reads a ConfigDetails and returns a fully loaded configuration as a yaml dictionary | |
| func loadModelWithContext(ctx context.Context, configDetails types.ConfigDetails, opts *Options) (map[string]any, error) { |
Collaborator
Author
There was a problem hiding this comment.
I made this one intentionally public, as LoadProjectWithContext for third party directly passing configDetails
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This re-implement "normalization" of the compose model as a plain yaml tree (map[string]any) not relying on compose-go structs conversion. This will make it possible to run the full compose processing (i.e
docker compose config) without using go bindings, and then restore support for--no-interpolateand suchnote: I dropped support for
service.dockerfileandservice.log_driveras those were defined by compose file v1 format, and using those should be rejected by schema validationAlso introduce
LoadModelin addition to the existingLoadProjectso compose-go can be used to partially process a compose file, as illustrated with the included command line: