Feature add config and action parameter type: set

Bug #1881049 reported by Erik Lönroth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Wishlist
Unassigned

Bug Description

I would like to propose a new config type for juju charms: Set

The set type would allow a charmer to specify a set of allowed values for a config level declared in config.yaml for a given config item. As

fruit: [ 'apple', 'banana', 'citrus' ]
  mode: single-value or multi-value
  non-empty: true or false
  default: [ 'banana', 'citrus' ]

This would allow juju to validate input of config early to simplify parameter validation when config values are a few.

The mode attribute to the set would allow more than one selection.

The non-empty would control the value to be [] or not.

The default would be as expected a predefined list of items already chosen.

This very same feature should be implemented also for juju-action parameters.

This feature would assist alot also to prevent and inform users in situations when juju-actions are run incorrect, as for example in this bug: https://bugs.launchpad.net/juju/+bug/1880846

In the web GUI, the presentational widget for this option/config type would be presented as a drop down or a

Tags: config
Revision history for this message
Pen Gale (pengale) wrote :

This fits with our general long term plans are a config schema. Added appropriate tags, to remind us to loop back.

tags: added: config
Changed in juju:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Erik Lönroth (erik-lonroth) wrote :

Its been a year since I logged this and I want to come back to this since this is the most common question I get from developers which also connects well with: https://bugs.launchpad.net/juju/+bug/1941925

Its about time that juju gets more interesting config types.

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.