|
Wire up prechecker
We introduce the concept of a policy
into state: state.State is given a
state.Policy interface when opened,
which is consulted during certain
operations to validate or modify
behaviour.
The Policy interface contains only
one method, Prechecker, which is called
to obtain a Prechecker. The Prechecker,
if non-nil, is used to ensure that an
instance with the specified parameters
can potentially be instantiated.
There is currently only one implementation
of Prechecker, and that is the manual
provider's Environ. The manual provider
thus prevents add-machine without ssh-
placement.
This CL supersedes https://codereview.appspot.com/14032043/
The primary differences are:
- up-to-date with latest codebase
- introduction of Policy, and removal of
raciness/lack of environ config updates
- policy is not set on State in juju.NewConn
methods; prechecking simply will not occur for
old environments
- Environ does not embed Prechecker, and there
is no new EnvironBase struct; this may be
proposed as a follow-up
- there is no container prechecking, as otherwise
we have no lightweight means of deploying charms
that do not require addressability
https://code.launchpad.net/~axwalk/juju-core/wire-up-prechecker-take2/+merge/205700
(do not edit description out of merge proposal)
Total comments: 11
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+382 lines, -224 lines) |
Patch |
 |
A |
[revision details]
|
View
|
1
2
3
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
agent/agent.go
|
View
|
1
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
agent/bootstrap.go
|
View
|
1
2
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
agent/bootstrap_test.go
|
View
|
1
2
|
5 chunks |
+6 lines, -5 lines |
0 comments
|
Download
|
 |
M |
cmd/jujud/agent.go
|
View
|
1
2
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
cmd/jujud/agent_test.go
|
View
|
1
2
|
3 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
cmd/jujud/bootstrap.go
|
View
|
1
2
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
cmd/jujud/bootstrap_test.go
|
View
|
1
2
|
8 chunks |
+8 lines, -7 lines |
0 comments
|
Download
|
 |
M |
cmd/plugins/juju-restore/restore.go
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
environs/errors.go
|
View
|
1
|
1 chunk |
+0 lines, -24 lines |
0 comments
|
Download
|
 |
M |
environs/interface.go
|
View
|
|
2 chunks |
+4 lines, -22 lines |
0 comments
|
Download
|
 |
M |
environs/jujutest/livetests.go
|
View
|
1
|
1 chunk |
+3 lines, -13 lines |
0 comments
|
Download
|
 |
A |
environs/statepolicy.go
|
View
|
1
2
|
1 chunk |
+34 lines, -0 lines |
0 comments
|
Download
|
 |
M |
juju/conn.go
|
View
|
1
2
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
juju/conn_test.go
|
View
|
1
2
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
provider/azure/environ.go
|
View
|
1
|
1 chunk |
+0 lines, -12 lines |
0 comments
|
Download
|
 |
M |
provider/azure/environ_test.go
|
View
|
1
|
1 chunk |
+0 lines, -9 lines |
0 comments
|
Download
|
 |
M |
provider/dummy/environs.go
|
View
|
1
2
|
7 chunks |
+18 lines, -5 lines |
0 comments
|
Download
|
 |
M |
provider/ec2/ec2.go
|
View
|
1
|
1 chunk |
+0 lines, -12 lines |
0 comments
|
Download
|
 |
M |
provider/ec2/local_test.go
|
View
|
1
|
1 chunk |
+0 lines, -11 lines |
0 comments
|
Download
|
 |
M |
provider/local/environ.go
|
View
|
1
|
1 chunk |
+0 lines, -12 lines |
0 comments
|
Download
|
 |
M |
provider/local/environ_test.go
|
View
|
1
|
2 chunks |
+0 lines, -16 lines |
0 comments
|
Download
|
 |
M |
provider/manual/environ.go
|
View
|
1
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
provider/openstack/local_test.go
|
View
|
1
|
1 chunk |
+0 lines, -11 lines |
0 comments
|
Download
|
 |
M |
provider/openstack/provider.go
|
View
|
1
|
1 chunk |
+0 lines, -12 lines |
0 comments
|
Download
|
 |
M |
state/addmachine.go
|
View
|
1
|
2 chunks |
+14 lines, -0 lines |
0 comments
|
Download
|
 |
M |
state/api/agent/machine_test.go
|
View
|
1
2
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
state/apiserver/client/api_test.go
|
View
|
1
2
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
state/compat_test.go
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
state/conn_test.go
|
View
|
1
2
3
|
4 chunks |
+16 lines, -1 line |
0 comments
|
Download
|
 |
M |
state/environ_test.go
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
state/export_test.go
|
View
|
1
|
1 chunk |
+10 lines, -2 lines |
0 comments
|
Download
|
 |
M |
state/initialize_test.go
|
View
|
1
2
|
6 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
 |
M |
state/megawatcher_internal_test.go
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
state/open.go
|
View
|
1
|
5 chunks |
+12 lines, -6 lines |
0 comments
|
Download
|
 |
A |
state/policy.go
|
View
|
1
2
3
|
1 chunk |
+63 lines, -0 lines |
0 comments
|
Download
|
 |
A |
state/prechecker_test.go
|
View
|
1
2
3
|
1 chunk |
+132 lines, -0 lines |
0 comments
|
Download
|
 |
M |
state/settings_test.go
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
state/state.go
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
state/state_test.go
|
View
|
1
2
|
10 chunks |
+10 lines, -10 lines |
0 comments
|
Download
|
 |
M |
state/unit_test.go
|
View
|
1
2
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
worker/provisioner/provisioner_test.go
|
View
|
1
2
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
Total messages: 11
|