-
Notifications
You must be signed in to change notification settings - Fork 129
Fix possible nil in extended docker-compose.yml configuration #319
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
Conversation
Hey @misak113, |
An example of not working configuration is here:
services:
app1:
image: alpine
command: ["sleep", "1000"]
extends:
file: parent.yml
service: app1
services:
app1:
# app1: {} The following command: docker-compose up -d Is failing with error:
If you add empty object It can be fixed with my fix here or either the more suitable error message like following:
The other option to fix this: return nil, fmt.Errorf("cannot extend service %q in %s: service has to be object", name, filename) |
LGTM, but for opensource contributions we require all commit to be signed-off |
5aab1ae
to
6bc67ca
Compare
in practice, the missing service name in extended configuration means that nothing is extended current state was that the docker-compose command fails with following error: panic: interface conversion: interface {} is nil, not map[string]interface {} goroutine 1 [running]: github.com/compose-spec/compose-go/loader.loadServiceWithExtends({0xc0007c4230, 0x50}, {0xc000502880, 0x7}, 0xc0005fc720?, {0xc0007c4230, 0x40}, 0xc0004d22d0?, 0xc000480390, 0xc0007cb1f8) github.com/compose-spec/compose-go@v1.6.0/loader/loader.go:511 +0x6ab Signed-off-by: Michael Zabka <zabka.michael+scarlett@gmail.com>
6bc67ca
to
8c5f96a
Compare
in practice, the missing service name in extended configuration means that nothing is extended
current state was that the docker-compose command fails with following error: