canonical / pebble

Take control of your internal daemons!
https://canonical-pebble.readthedocs-hosted.com/
GNU General Public License v3.0
143 stars 54 forks source link

Introduce comments to `pebble plan` output for debug. #342

Closed hpidcock closed 6 months ago

hpidcock commented 8 months ago

This is an attempt at adding in debug comments to the output of pebble plan with --debug. Each comment is the label of the layer in which the configuration originated from.

pebble plan --debug output:

$ pebble plan --debug
services:
    srv1:
        summary: first service # first
        override: replace
        command: bash -c 'sleep 1000' # first
        after:
            - srv2 # second
        environment:
            A: a # first
            B: b # second
    srv2:
        summary: second svc # second
        override: replace
        command: bash -c 'sleep 1000' # second

Files:

$ cat 001-first.yaml
services:
  srv1:
    override: replace
    summary: first service
    command: bash -c 'sleep 1000'
    environment:
      A: a
$ cat 002-second.yaml
services:
  srv1:
    override: merge
    environment:
      B: b
    after:
      - srv2
  srv2:
    summary: second svc
    override: replace
    command: bash -c 'sleep 1000'