snap.yaml app command doesn't allow "=", ":"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Confirmed
|
Medium
|
Unassigned |
Bug Description
For example, with a statically compiled go program such as vault installed to $SNAP/bin/vault, the following yaml is not allowed by snapd:
```
apps:
vault:
command: bin/vault server --config=
daemon: simple
environment:
VAULT_CONFIG: "$SNAP_
VAULT_ADDR: "https:/
VAULT_UI: "true"
plugs:
- network
- network-bind
```
The following message is returned from snapcraft:
error: cannot validate snap "edgexfoundry": invalid definition of application "vault": app description field 'command' contains illegal "bin/vault server --config=
I think that "=" should be added to the list of allowed symbols and that the message could be worded better, something like
invalid definition of application "vault": app description field 'command' is illegal with "bin/vault server --config=
or if it has the ability to highlight exactly what is wrong about the field:
invalid definition of application "vault": app description field 'command' "bin/vault server --config=
or something else because as it is, it doesn't say exactly what is illegal about the specification and it took me a while to see that the "=" is not allowed (which I also think it should be as specifying the value of an option with an "=" is a common thing to do
(also note that yes this is using snapcraft, but I am specifying `adapter: none` in the snapcraft.yaml because it's a statically compiled go program so I don't need the snapcraft wrappers for this)
Changed in snapd: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in snapd: | |
importance: | High → Medium |
status: | Triaged → Confirmed |
Additionally, in this same vein it would be very useful to be able to specify arguments with ":" in them, i.e. to specify the address to connect to for another app in the same snap, we need to do this:
``` config/ device- random -profile res --registry $CONSUL_ADDR //localhost: 8500"
command: bin/device-random -confdir $SNAP_DATA/
environment:
CONSUL_ADDR: "consul:
```
Where ideally we would just be able to do:
``` config/ device- random -profile res --registry= consul: //localhost: 8500
command: bin/device-random -confdir $SNAP_DATA/
```