Merge lp://staging/~fwereade/juju-core/machine-0-units into lp://staging/~juju/juju-core/trunk
Proposed by
William Reade
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 1200 | ||||
Proposed branch: | lp://staging/~fwereade/juju-core/machine-0-units | ||||
Merge into: | lp://staging/~juju/juju-core/trunk | ||||
Diff against target: |
47 lines (+20/-6) 2 files modified
cmd/jujud/bootstrap.go (+17/-5) cmd/jujud/bootstrap_test.go (+3/-1) |
||||
To merge this branch: | bzr merge lp://staging/~fwereade/juju-core/machine-0-units | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+161344@code.staging.launchpad.net |
Description of the change
jujud: enable JobHostUnits on machine 0
To post a comment you must log in.
Reviewers: mp+161344_ code.launchpad. net,
Message:
Please take a look.
Description:
jujud: enable JobHostUnits on machine 0
https:/ /code.launchpad .net/~fwereade/ juju-core/ machine- 0-units/ +merge/ 161344
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/8953044/
Affected files: bootstrap. go bootstrap_ test.go
A [revision details]
M cmd/jujud/
M cmd/jujud/
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: cmd/jujud/ bootstrap. go bootstrap. go' bootstrap. go 2013-04-10 15:49:40 +0000 bootstrap. go 2013-04-28 20:50:44 +0000 nstraints( c.Constraints) ; err != nil { Current. Series, instanceId, Environ, state.JobServeAPI, Environ, state.JobServeAPI, state.JobHostUnits, e(version. Current. Series, instanceId, jobs...)
=== modified file 'cmd/jujud/
--- cmd/jujud/
+++ cmd/jujud/
@@ -71,11 +71,23 @@
if err := st.SetEnvironCo
return err
}
- // TODO: we need to be able to customize machine jobs, not just hardcode
these.
- m, err := st.InjectMachine(
- version.
- state.JobManage
- )
+ // TODO(fwereade): we need to be able to customize machine jobs,
+ // not just hardcode these values; in particular, JobHostUnits
+ // on a machine, like this one, that is running JobManageEnviron
+ // (not to mention the actual state server itself...) will allow
+ // a malicious or compromised unit to trivially access to the
+ // user's environment credentials. However, given that this point
+ // is currently moot (see Upgrader in this package), the pseudo-
+ // local provider mode (in which everything is deployed with
+ // `--force-machine 0`) offers enough value to enough people that
+ // JobHostUnits is currently always enabled. This will one day
+ // have to change, but it's strictly less important than fixing
+ // Upgrader, and it's a capability we'll always want to have
+ // available for the aforementioned use case.
+ jobs := []state.MachineJob{
+ state.JobManage
+ }
+ m, err := st.InjectMachin
if err != nil {
return err
}
Index: cmd/jujud/ bootstrap_ test.go bootstrap_ test.go' bootstrap_ test.go 2013-04-15 10:28:50 +0000 bootstrap_ test.go 2013-04-28 20:50:44 +0000 MachineJob{ state.JobManage Environ, Environ, state.JobServeAPI, state.JobHostUnits,
=== modified file 'cmd/jujud/
--- cmd/jujud/
+++ cmd/jujud/
@@ -125,7 +125,9 @@
defer st.Close()
m, err := st.Machine("0")
c.Assert(err, IsNil)
- c.Assert(m.Jobs(), DeepEquals, []state.
state.JobServeAPI})
+ c.Assert(m.Jobs(), DeepEquals, []state.MachineJob{
+ state.JobManage
+ })
}
func testOpenState(c *C, info *state.Info, expectErr error) {