Skip to content

cpus value type in output of config command is not consistent in version 1.27.3  #7774

@gingerhot

Description

@gingerhot

Description of the issue

After I upgrade compose version to 1.27.3, when I run docker-compose -f example.yml config, the cpus value type in limits and reservations is not consistent in the output, the one in the limits is without quote mark as the one in the reservations does:

services:
  redis:
    deploy:
      resources:
        limits:
          cpus: 0.8
          memory: 600M
        reservations:
          cpus: '0.10'
          memory: 300M
    image: redis:alpine
version: '3.8'

is this a bug or just it is designed to be? I test this in 1.26.2 has not this problem.

the example.yml file:

version: "3.8"
services:

  redis:
    image: redis:alpine
    deploy:
      resources:
        limits:
          cpus: '0.80'
          memory: 600M
        reservations:
          cpus: '0.10'
          memory: 300M

Output of docker-compose version

docker-compose version 1.27.3, build 4092ae5d
docker-py version: 4.3.1
CPython version: 3.7.7
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

Output of docker version

Client: Docker Engine - Community
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        48a66213fe
 Built:             Mon Jun 22 15:45:36 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.12
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       48a66213fe
  Built:            Mon Jun 22 15:44:07 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Steps to reproduce the issue

  1. docker-compose -f example.yml config

Observed result

services:
  redis:
    deploy:
      resources:
        limits:
          cpus: 0.8
          memory: 600M
        reservations:
          cpus: '0.10'
          memory: 300M
    image: redis:alpine
version: '3.8'

Expected result

services:
  redis:
    deploy:
      resources:
        limits:
          cpus: '0.8'
          memory: 600M
        reservations:
          cpus: '0.10'
          memory: 300M
    image: redis:alpine
version: '3.8'

Additional information

Ubuntu 18.04.5 LTS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions