puppetlabs / puppetlabs-docker

The Puppet Docker repository
Apache License 2.0
91 stars 311 forks source link

Additional Erroroutput for docker-compose config #1000

Open Tobias-HRZ opened 1 month ago

Tobias-HRZ commented 1 month ago

Describe the Bug

I was working on my docker-compose.yaml and had a dependence issue. But the error-message I received was very cryptic:

"Could not evaluate: undefined method `[]' for false:FalseClass"

I could identify the problem by checking the traces and eventually find the command which produced the problem.

Expected Behavior

The docker-compose file is check via "docker-compose config" in "puppetlabs-docker/lib/puppet/provider/docker_compose/ruby.rb" --> line 30:

compose_output = Puppet::Util::Yaml.safe_load(execute([command(:docker)] + args, combine: false), [Symbol])

If one executes the "docker-compose config"-command directly, one does get a correct error message. So it would be nice, if the "compose_output" is checked for error messages and output them accordingly. This might help people in the future.

Thanks in advance and kind regrads, Tobias

Environment