|
api: Use MachineNonce when opening API as MA
This introduces an extra field in api.Info:
MachineNonce, which needs to be set when
opening/logging in into the API server as
a machine agent (ignored in other cases).
The server ensures the connecting machine
agents won't operate on a wrong or unprovisioned
machine (in the latter case they shouldn't
run anyway and now they stop immediately after
starting).
Added tests for the behavior in apiserver.
It might seem there are a lot of changes,
but that's because it touches one of the
basic types api.Info and how API connections
are established.
These changes will be followed up by another
branch which starts and stops a pinger at
the apiserver automatically when a machine
agent connects successfully, so that we can
get rid of SetAgentAlive eventually.
https://code.launchpad.net/~dimitern/juju-core/072-machineagent-login-nonce/+merge/175791
(do not edit description out of merge proposal)
Total comments: 13
Total comments: 6
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+123 lines, -19 lines) |
Patch |
 |
A |
[revision details]
|
View
|
1
2
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
agent/agent.go
|
View
|
1
2
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
cmd/jujud/agent.go
|
View
|
1
2
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
cmd/jujud/machine_test.go
|
View
|
1
2
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
juju/testing/conn.go
|
View
|
1
2
|
1 chunk |
+14 lines, -3 lines |
0 comments
|
Download
|
 |
M |
state/api/apiclient.go
|
View
|
1
2
|
2 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
 |
M |
state/api/deployer/deployer_test.go
|
View
|
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
state/api/machineagent/state_test.go
|
View
|
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
state/api/machiner/machiner_test.go
|
View
|
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
 |
M |
state/api/params/apierror.go
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
state/api/params/params.go
|
View
|
1
2
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
state/api/state.go
|
View
|
1
2
|
1 chunk |
+5 lines, -3 lines |
0 comments
|
Download
|
 |
M |
state/api/upgrader/upgrader_test.go
|
View
|
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
state/api/watcher/watcher_test.go
|
View
|
1
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
state/apiserver/admin.go
|
View
|
1
2
|
1 chunk |
+11 lines, -2 lines |
0 comments
|
Download
|
 |
M |
state/apiserver/client/api_test.go
|
View
|
1
2
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
state/apiserver/common/errors.go
|
View
|
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
state/apiserver/errors_test.go
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
state/apiserver/login_test.go
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
state/apiserver/pinger_test.go
|
View
|
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
state/apiserver/server_test.go
|
View
|
1
2
|
3 chunks |
+50 lines, -2 lines |
0 comments
|
Download
|
Total messages: 7
|