This repository was archived by the owner on Jan 30, 2020. It is now read-only.
api: reject templates for particular unit types#1653
Merged
dongsupark merged 2 commits intocoreos:masterfrom Aug 9, 2016
Merged
api: reject templates for particular unit types#1653dongsupark merged 2 commits intocoreos:masterfrom
dongsupark merged 2 commits intocoreos:masterfrom
Conversation
api/units.go
Outdated
| if !validUnitTypes.Contains(suffix) { | ||
| return fmt.Errorf("invalid unit type: %q", suffix) | ||
| } | ||
| if strings.Index(name, "@") != -1 && !templateTypes.Contains(suffix) { |
Contributor
|
LGTM after a couple of minor ones |
added 2 commits
August 8, 2016 12:34
Following unit types don't support templates: automount, busname, device, mount, scope, slice, snapshot, swap On the other hand, only the following types are allowed for templates: path, service, socket, target, timer 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 coreos#1390
Describe supported unit types for templates. Also update the existing description about ordinary unit types.
2b60cdb to
97191ae
Compare
Author
|
@jonboulle Done. |
|
This is quite frustrating. As an outsider, it's hard to understand why templates are only supported in some cases. |
Author
|
@stevehorsfield Yeah, I feel your pain. |
|
@dongsupark - Thanks for the pointer. I've commented on that ticket. I have an ugly workaround for my current needs using a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 #1390