coreos / fleet

fleet ties together systemd and etcd into a distributed init system
Apache License 2.0
2.42k stars 302 forks source link

api: reject templates for particular unit types #1653

Closed dongsupark closed 8 years ago

dongsupark commented 8 years ago

Following unit types don't support templates:

On the other hand, only the following types are allowed for templates:

As it's not that simple to support templates for particular unit types on systemd, reject templates for such units from the fleet side.

Fixes https://github.com/coreos/fleet/issues/1390

jonboulle commented 8 years ago

LGTM after a couple of minor ones

dongsupark commented 8 years ago

@jonboulle Done. Replaced Index() != 1 with Contains(), renamed templateTypes to validTemplateTypes. I'll merge it tomorrow. Thanks.

stevehorsfield commented 8 years ago

This is quite frustrating. As an outsider, it's hard to understand why templates are only supported in some cases.

dongsupark commented 8 years ago

@stevehorsfield Yeah, I feel your pain. As I once mentioned, there's a systemd issue https://github.com/systemd/systemd/issues/2556, which clarifies the underlying issue. It doesn't look trivial to achieve both template support and backward compatibility. TBH I don't have a brilliant idea.

stevehorsfield commented 8 years ago

@dongsupark - Thanks for the pointer. I've commented on that ticket. I have an ugly workaround for my current needs using a service unit to perform the mount. It's far from ideal.