Skip to content

[Feature] add support for !reset tag on yaml sequences #13793

@oskolist

Description

@oskolist

Description

(i don't know if this should be a feature request or bug report) my suggestion is allow all sequences to be deleted/reset using this syntax:

- !reset                                                                                                                                        
  key1: value1
  key2: value2
  ...

then docker-compose will the find the elements that have key1 set to value1, key2 to value2... and reset them
this way we can have:

services:
  myservice:
    # ...
    ports:
      - name: portmapping1
        target: 8000
        published: "8000"
      - name: portmapping2
        target: 8001
        published: "8001"

and override it using:

services:
  myservice:
    ports:
      - !reset
        name: portmapping2

or

services:
  myservice:
    ports:
      - !reset
        target: 8001

or

services:
  myservice:
    ports:
      - !reset
        published: "8001"

i also created an issue in compose-spec/compose-spec#644

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions