Default configuration options for defined snaps in gadget.yaml

Bug #1661515 reported by Darren Wu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Image
Fix Released
Medium
Barry Warsaw

Bug Description

gadget.yaml defines default configuration options for defined snaps, but ubuntu-image does not support it.

The gadget.yaml defines:
defaults:
  # Below is the store id of the wifi-ap snap
  2rGgvyaY0CCzlWuKAPwFtCWrgwkM8lqS:
    automatic-setup.disable: true

ubuntu-image error as:
ubuntu_image.parser.GadgetSpecificationError: Invalid gadget.yaml @ defaults:2rGgvyaY0CCzlWuKAPwFtCWrgwkM8lqS:automatic-setup.disable

The option is described in the official gadget.yaml format at https://github.com/snapcore/snapd/wiki/Gadget-snap

Simon Fels (morphis)
description: updated
Revision history for this message
Barry Warsaw (barry) wrote :

I bet the problem is the dot in `automatic-setup.disable`.

As of 0.11 u-i parses and ignores the defaults: section but the regexp is probably too tight. It only supports a-z0-9 (case insensitive) and also dashes but not dots. The Gadget-snap spec doesn't really specify what's allowed but generally the same restriction as for the volume name is assumed (and volume name allowable characters *are* defined).

Should be an easy fix to allow dots in the defaults section; I'll ask on the snappy list about allowable characters.

Changed in ubuntu-image:
milestone: none → 0.15
assignee: nobody → Barry Warsaw (barry)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Simon Fels (morphis) wrote :

@Barry: Thanks for taking this up! AFAIK the characters we need to allow are all those which are allowed for snap configuration options. Please not that the value for configuration items can be also any valid json data. See https://github.com/snapcore/snapd/blob/master/cmd/snap/cmd_set.go#L65

Barry Warsaw (barry)
Changed in ubuntu-image:
status: Confirmed → In Progress
Revision history for this message
Barry Warsaw (barry) wrote :

@morphis: I think we'll just accept and ignore any values in the defaults section.

Barry Warsaw (barry)
Changed in ubuntu-image:
status: In Progress → Fix Committed
Barry Warsaw (barry)
Changed in ubuntu-image:
status: Fix Committed → Fix Released
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.