-
Notifications
You must be signed in to change notification settings - Fork 481
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
compose go v1.13.4 #1753
compose go v1.13.4 #1753
Conversation
a8a6ceb
to
9c61ed3
Compare
Signed-off-by: Nick Sieger <nick@nicksieger.com>
9c61ed3
to
956a1be
Compare
cfg, err := loader.Load(compose.ConfigDetails{ | ||
ConfigFiles: cfgs, | ||
Environment: envs, | ||
}, func(options *loader.Options) { | ||
options.SetProjectName("bake", false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no defaults anymore for the project name? I was thinking it was the name of the working directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compose-go was raising a "project name must not be empty" error without this. Looks like the logic changed in compose-spec/compose-go#374. Might have been inadvertent, I'll check with Milas on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a mix of "low" and "high" level loader stuff in compose-go
for programmatic vs CLI usage but the separation is not clean 😔
I think we should rename and export this as something like WithDefaultProjectNameStrategy
: https://github.com/compose-spec/compose-go/blob/ef6c1671ed3f3844b58f61c9f4c8e5e9cd94b5f4/cli/options.go#L447-L460
Right now that's what the ProjectFromOptions
method is using, but it's not accessible if you're using loader.Load
directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, good to know. There's nothing that I'm aware of in buildx that's dependent on the latest compose-go, so does it work to file an issue and/or start a PR over there and close this in favor of a new compose-go upgrade PR later on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, is there any possible workaround we could do for this temporarily? I'd like to take the latest compose version in buildx v0.11 (aimed for this week or soon after), but also would be nice to make sure we take a tagged version from compose-go
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crazy-max @milas @nicksieger: is taking this change as-is with "bake"
as the project name acceptable for the time being? If so, we can merge this and move on with the v0.11 milestone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I proposed the workaround by writing the code, so it's an implicit 👍 from me. I don't think the project name is ever really exposed when baking a compose file, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@milas @nicksieger it would be nice to take this for v0.11 of buildx if we could, any objections?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also want to add support for the new compose features at the same time?
- Add
additional_contexts
tobuild
service config compose-spec/compose-go#354 - introduce
dockerfile_inline
compose-spec/compose-go#365 - I think that's it?
They should slot neatly into compose.go
, with tests in compose_test.go
:
Lines 86 to 103 in 43a07f3
t := &Target{ | |
Name: targetName, | |
Context: contextPathP, | |
Dockerfile: dockerfilePathP, | |
Tags: s.Build.Tags, | |
Labels: labels, | |
Args: flatten(s.Build.Args.Resolve(func(val string) (string, bool) { | |
if val, ok := s.Environment[val]; ok && val != nil { | |
return *val, true | |
} | |
val, ok := cfg.Environment[val] | |
return val, ok | |
})), | |
CacheFrom: s.Build.CacheFrom, | |
CacheTo: s.Build.CacheTo, | |
NetworkMode: &s.Build.Network, | |
Secrets: secrets, | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, maybe they could go in a separate PR after we decide how to handle the project name default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I'd be happy with that.
cfg, err := loader.Load(compose.ConfigDetails{ | ||
ConfigFiles: cfgs, | ||
Environment: envs, | ||
}, func(options *loader.Options) { | ||
options.SetProjectName("bake", false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, is there any possible workaround we could do for this temporarily? I'd like to take the latest compose version in buildx v0.11 (aimed for this week or soon after), but also would be nice to make sure we take a tagged version from compose-go
.
No description provided.