Skip to content

Commit

Permalink
hyperstart: Don't special-case destroypod
Browse files Browse the repository at this point in the history
We're supposed to be able to receive an ack message after a destroypod.
The fact that we didn't was caused by our use of hyperstart as a daemon
(vs an init process) and some bugs introduced by that.

With those fixed, we have the destroypod ack message back.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
  • Loading branch information
Damien Lespiau committed Dec 2, 2016
1 parent 7d84e34 commit c305477
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
4 changes: 0 additions & 4 deletions hyperstart/hyperstart.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,6 @@ func (h *Hyperstart) SendCtlMessage(cmd string, data []byte) (*hyper.DecodedMess
return nil, err
}

if code == hyper.INIT_DESTROYPOD {
return nil, nil
}

// Wait for answer
resp, err := h.expectReadingCmd(hyper.INIT_ACK)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion hyperstart/hyperstart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ func testSendCtlMessage(t *testing.T, cmd string) {
t.Fatal()
}

if cmd != DestroyPod && msg.Code != hyper.INIT_ACK {
if msg.Code != hyper.INIT_ACK {
t.Fatal()
}
}
Expand Down
4 changes: 1 addition & 3 deletions hyperstart/mock/hyperstart.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,7 @@ func (h *Hyperstart) handleCtl() {
// hyperstart to fail and test the reaction of proxy/clients
h.logf("ctl: <-- command %s executed successfully\n", cmdName)

if cmdName != DestroyPod {
h.SendMessage(hyper.INIT_ACK, nil)
}
h.SendMessage(hyper.INIT_ACK, nil)

}

Expand Down

0 comments on commit c305477

Please sign in to comment.