Bundle YAML files should use YAML key/value , syntax rather than implement a mini-language in value strings

Bug #1848395 reported by Tim McNamara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

We should ensure that our YAML files are amenable to syntax highlighting and other forms of static analysis. This will minimise the likelihood that typos will propagate into deployments. For example, bundles recycle the command-line constraints syntax for the application constraints key:

The (currently valid) snippet:

  applications:
    <app>:
     constraints: "mem=1G arch=amd64"

Would ideally be expressed as:

  applications:
    <app>:
      constraints:
        arch: amd64
        mem: 1G

This also appears in kubernetes bundles. The placement directive is a set of key/value pairs wedged into a string.

The placement directive here:

  applications:
    <app>:
      placement: "a=b c=d"

Could be:

  applications:
    <app>:
      placement:
        a: b
        c: d

This would not need to be a breaking change. Juju could inspect the type of the value. When it's presented as a string, interpret using the current behaviour.

Revision history for this message
Richard Harding (rharding) wrote :

The one thing to watch out for is making sure that it's easy for users to map what they'd type in the CLI to the bundle here as much of this is still hand tweaked and written. The reason for the current string versions is that it takes what the CLI does for commonality. It would be nice to support both setups to avoid users having to do the lookups themselves.

Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Wishlist → Low
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.