Skip to content

volume creation event output inconsistent with other resources/events #13187

@rrjjvv

Description

@rrjjvv

I didn't want to call this a bug since it doesn't impact functionality, but it's not a feature request and there was no template for enhancement.

For a compose file that uses a non-external volume (the only portion that matters):

services:
  foo:
    image: nginx:alpine
    volumes:
      - bar:/bar
volumes:
  bar:

an up/down yields:

$ docker compose version
Docker Compose version v2.39.1

$ docker compose up -d
[+] Running 3/3
 ✔ Network bar_default  Created                                                                                                                                                                                                    0.0s 
 ✔ Volume "bar_bar"     Created         <-----                                                                                                                                                                                            0.0s 
 ✔ Container bar-foo-1  Started

$ docker compose down -v
[+] Running 3/3
 ✔ Container bar-foo-1  Removed                                                                                                                                                                                                    0.2s 
 ✔ Volume bar_bar       Removed                                                                                                                                                                                                    0.0s 
 ✔ Network bar_default  Removed

Out of all the creation/started states, the volume is the only one that is quoted. The fact that removal of that same resource is unquoted strongly suggests the discrepancy was not intentional nor a technical requirement.

This isn't a new issue (based on the code), and more likely that nobody has noticed or cared enough to report. (Due to an unrelated bug report I've been paying closer attention to the output and why I've noticed.)

I was going to just create a PR for the one letter fix (s/q/s/):

eventName := fmt.Sprintf("Volume %q", volume.Name)

but even with a pristine checkout (without my changes), I get 17 e2e test failures, so decided to err on the side of caution by creating this issue. I'd be happy to create a PR if test failures are 'normal' (and/or help diagnose those failures if they should be passing), but would probably take you longer to respond than to implement the fix yourself...

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