Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

API should validate unit names #867

Merged
merged 1 commit into from
Sep 9, 2014

Conversation

jonboulle
Copy link
Contributor

systemd is opinionated about what constitutes a valid unit name. fleet should validate this at unit-creation time to prevent issues like #845 and #793.

@jonboulle
Copy link
Contributor

Open to suggestions about where some of these pieces should sit in the codebase - dedicated constants/requirements file perhaps?

@@ -103,12 +104,58 @@ func (ur *unitsResource) set(rw http.ResponseWriter, req *http.Request, item str
ur.update(rw, su.Name, su.DesiredState)
}

const unitNameMax = 256
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one const block, please

@bcwaldon
Copy link
Contributor Author

bcwaldon commented Sep 9, 2014

Thanks for digging into this. Two style nits then LGTM

@jonboulle
Copy link
Contributor

We may want to revisit to rearrange some of this stuff (e.g. this logic should be in the same place as UnitNameInfo), but not sure it's hugely important right now where exactly it lives

jonboulle added a commit that referenced this pull request Sep 9, 2014
@jonboulle jonboulle merged commit d0f98c6 into coreos:master Sep 9, 2014
@jonboulle jonboulle deleted the validate_unit_names branch September 9, 2014 16:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants