Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7)

Issue 6551044: state: check unit/service name validity

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 6 months ago by fwereade
Modified:
12 years, 6 months ago
Reviewers:
mp+125433
Visibility:
Public.

Description

state: check unit/service name validity I originally intended to just move the regexps, but then I realised that we don't get any of this checking "free" with mongo in the way we did with ZK, and it is probably a good idea to maintain naming restrictions (given that there is at least one place we expect to infer entity kind from name structure (possibly status? possibly set-/get-constraints?)). https://code.launchpad.net/~fwereade/juju-core/almost-trivial-check-valid-names/+merge/125433 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 2

Patch Set 2 : check unit/service name validity #

Total comments: 4

Patch Set 3 : state: check unit/service name validity #

Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -62 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/deploy.go View 1 1 chunk +1 line, -0 lines 0 comments Download
M cmd/jujud/unit.go View 1 1 chunk +1 line, -1 line 0 comments Download
M juju/conn.go View 1 chunk +0 lines, -6 lines 0 comments Download
M juju/conn_test.go View 1 chunk +0 lines, -17 lines 0 comments Download
M state/service.go View 1 1 chunk +3 lines, -0 lines 0 comments Download
M state/service_test.go View 1 1 chunk +17 lines, -3 lines 0 comments Download
M state/state.go View 1 2 5 chunks +25 lines, -0 lines 0 comments Download
M state/state_test.go View 1 4 chunks +57 lines, -35 lines 0 comments Download

Messages

Total messages: 5
fwereade
Please take a look.
12 years, 6 months ago (2012-09-20 09:07:33 UTC) #1
niemeyer
Great catch, thanks. A couple of details: https://codereview.appspot.com/6551044/diff/1/cmd/juju/deploy.go File cmd/juju/deploy.go (right): https://codereview.appspot.com/6551044/diff/1/cmd/juju/deploy.go#newcode97 cmd/juju/deploy.go:97: // TODO ...
12 years, 6 months ago (2012-09-20 09:39:41 UTC) #2
fwereade
Please take a look.
12 years, 6 months ago (2012-09-20 09:52:55 UTC) #3
niemeyer
LGTM with the trivial: https://codereview.appspot.com/6551044/diff/5001/state/state.go File state/state.go (right): https://codereview.appspot.com/6551044/diff/5001/state/state.go#newcode34 state/state.go:34: // IsServiceName returns true if ...
12 years, 6 months ago (2012-09-20 10:35:34 UTC) #4
fwereade
12 years, 6 months ago (2012-09-20 10:41:32 UTC) #5
*** Submitted:

state: check unit/service name validity

I originally intended to just move the regexps, but then I realised that we
don't get any of this checking "free" with mongo in the way we did with ZK,
and it is probably a good idea to maintain naming restrictions (given that
there is at least one place we expect to infer entity kind from name
structure (possibly status? possibly set-/get-constraints?)).

R=niemeyer
CC=
https://codereview.appspot.com/6551044

https://codereview.appspot.com/6551044/diff/5001/state/state.go
File state/state.go (right):

https://codereview.appspot.com/6551044/diff/5001/state/state.go#newcode34
state/state.go:34: // IsServiceName returns true if name is a valid service
name.
On 2012/09/20 10:35:34, niemeyer wrote:
> s/true if/whether/ (both are of course right.. it's just upstream Go
convention)

Done.

https://codereview.appspot.com/6551044/diff/5001/state/state.go#newcode39
state/state.go:39: // IsUnitName returns true if name is a valid service name.
On 2012/09/20 10:35:34, niemeyer wrote:
> s/true if/whether/
> s/service/unit/

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b