Conversation
4e79288
to
ae0645d
Compare
@@ -252,7 +252,7 @@ func runDaemon(args *docopt.Args) { | |||
|
|||
// Check if we are the leader so that we can use the cluster functions directly | |||
sampiCluster := sampi.NewCluster(sampi.NewState()) | |||
sampiAPI := sampi.NewHTTPAPI(sampiCluster) | |||
sampiAPI := &sampi.HttpAPI{sampiCluster} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vet will complain about the missing field name
ae0645d
to
aff42ee
Compare
@@ -54,11 +54,11 @@ func (h *Host) streamEvents(id string, w http.ResponseWriter) error { | |||
return nil | |||
} | |||
|
|||
type httpAPI struct { | |||
type hostAPI struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or actually -- maybe jobAPI
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good
LGTM, pending that rename |
We could also get rid of sampi.NewCluster. This will need to be changed then: Line 254 in 35e9d7b
|
Ah actually, I'd change |
232cab7
to
2600e5d
Compare
var jobStream stream.Stream | ||
sh.BeforeExit(func() { | ||
if jobStream != nil { | ||
jobStream.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like unnecessary cleanup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said in the commit, I found it easier to follow with the jobStream
logic being all in one section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, closing the stream on exit doesn't really do much, the fds will be reaped by the kernel at exit anyway.
Also, rename hostAPI to jobAPI (this seems to accurately describe all functions in the current group, and makes way for more features we'll be adding to the host shortly). Signed-off-by: Eric Myhre <eric@flynn.io>
Signed-off-by: Eric Myhre <eric@flynn.io>
Since the manifest format has changed, h.Metadata will now always be nil (we're creating a new blank host object after all). ID can also be directly set, this was different in the past as we did some pointer trickery. Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
1ea1b16
to
be89227
Compare
This will be dropped on the floor by the OS when the process terminates anyway; no special action is required. Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
be89227
to
847273a
Compare
6c6e265
to
de64a20
Compare
LGTM, though a few commit messages need a |
Since stream objects are now generic, we can make a more generic client method for them. Note that since the method doesn't provide a way to specify headers, StreamJobEvents on the controller cannot be simplified (yet). Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
This gets rid of more references to rpcplus; leaving discoverd the last component to still reference it. Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
Since we're no longer opening a permanently open socket to the host, there is no cleanup needed. The current method just called httpclient's Close() method, which will no-op (it only closes the dialer if dialClose is set, which is nil in this particular client). Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
7063e0a
to
1883e60
Compare
One tiny change suggested by @archseer; and a rename that will make sense as the volumes API comes in next to this.