|
In short: every command is implemented as a symlink to a single "proxy"
executable. This proxy communicates with a cmd.server.Server running in the
unit agent process, which uses a nameless SuperCommand to select and run the
command specified by the original proxy's full command line, and
communicates stderr and stdout back to the original process.
This necessitated a change to cmd, such that a new Env interface has been
added, which is responsible for the command's interactions with its
environment; cmd.DefaultEnv implements the original functionality, while
cmd.server.clientEnv implements the abstracted version which communicates
back to the proxy process. Env has ended up needing to be threaded through
much of cmd, but the impact on calling code is minimal.
https://code.launchpad.net/~fwereade/juju/go-unit-commands/+merge/94885
(do not edit description out of merge proposal)
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+877 lines, -88 lines) |
Patch |
|
M |
cmd/command.go
|
View
|
1
2
|
4 chunks |
+74 lines, -25 lines |
0 comments
|
Download
|
|
M |
cmd/juju/bootstrap.go
|
View
|
1
2
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
cmd/juju/bootstrap_test.go
|
View
|
1
2
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
cmd/juju/main.go
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
cmd/jujud/agent.go
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
cmd/jujud/initzk.go
|
View
|
1
2
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
cmd/jujud/initzk_test.go
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
cmd/jujud/machine.go
|
View
|
1
2
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
|
M |
cmd/jujud/main.go
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
cmd/jujud/provisioning.go
|
View
|
1
2
|
2 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
|
M |
cmd/jujud/unit.go
|
View
|
1
2
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
|
M |
cmd/jujud/util_test.go
|
View
|
1
2
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
A |
cmd/proxy/main.go
|
View
|
1
2
|
1 chunk |
+42 lines, -0 lines |
0 comments
|
Download
|
|
A |
cmd/proxy/proxy.go
|
View
|
1
2
|
1 chunk |
+103 lines, -0 lines |
0 comments
|
Download
|
|
A |
cmd/proxy/proxy_test.go
|
View
|
1
2
|
1 chunk |
+136 lines, -0 lines |
0 comments
|
Download
|
|
A |
cmd/server/protocol.go
|
View
|
1
2
|
1 chunk |
+86 lines, -0 lines |
0 comments
|
Download
|
|
A |
cmd/server/protocol_test.go
|
View
|
1
2
|
1 chunk |
+38 lines, -0 lines |
0 comments
|
Download
|
|
A |
cmd/server/server.go
|
View
|
1
2
|
1 chunk |
+149 lines, -0 lines |
0 comments
|
Download
|
|
A |
cmd/server/server_test.go
|
View
|
1
2
|
1 chunk |
+205 lines, -0 lines |
0 comments
|
Download
|
|
M |
cmd/supercommand.go
|
View
|
1
2
|
5 chunks |
+10 lines, -34 lines |
0 comments
|
Download
|
|
M |
cmd/supercommand_test.go
|
View
|
1
2
|
3 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
Total messages: 1
|