-
Notifications
You must be signed in to change notification settings - Fork 340
Description
Describe the Bug
The docker_stack provider currently assumes or requires the presence of a version top-level element in the provided Docker Compose YAML file. However, according to the official Docker Compose specification, the version attribute is now obsolete and is no longer required (see the [Docker documentation](https://docs.docker.com/reference/compose-file/version-and-name/#version-top-level-element-obsolete)).
Expected Behavior
The module should be able to parse the YAML file and successfully deploy the Docker stack even if the version top-level element is omitted, aligning with current Docker Compose standards.
Steps to Reproduce
- Create a
docker-compose.ymlfile that does not contain theversionmention at the top of the file. - Attempt to deploy a stack using this YAML file via the Puppet docker module.
- Observe the deployment failure or validation error triggered by the missing version.
Environment
- Puppet Module Version: 7.0.0 (also present in
main/v10.4.0) - Platform: Debian 12
Additional Context
The line of code that checks for the Docker Compose version in the YAML file is located [here](https://github.com/puppetlabs/puppetlabs-docker/blob/v10.4.0/lib/puppet/provider/docker_stack/ruby.rb#L32).
Removing or making this check optional would ensure compatibility with modern Docker Compose files.