Skip to content

docker_stack - Remove obsolete Docker Compose version check in docker_stack provider #1052

@OverStyleFR

Description

@OverStyleFR

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

  1. Create a docker-compose.yml file that does not contain the version mention at the top of the file.
  2. Attempt to deploy a stack using this YAML file via the Puppet docker module.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions