Skip to content

Commit

Permalink
Fixing test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinandan Prativadi <[email protected]>
  • Loading branch information
abhi committed Oct 13, 2017
1 parent 3ca429a commit 7da1b8f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
8 changes: 6 additions & 2 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -821,11 +821,15 @@ func TestProcPublishUnpublishService(t *testing.T) {
if err != nil {
t.Fatal(err)
}
si, errRsp := procPublishService(c, vars, b)
sv, errRsp := procPublishService(c, vars, b)
if errRsp != &createdResponse {
t.Fatalf("Unexpected failure: %v", errRsp)
}
sid := i2s(si)
ep, ok := sv.(endpointInfo)
if !ok {
panic(fmt.Sprintf("Failed for %v", sv))
}
sid := ep.ID

vars[urlEpID] = ""
_, errRsp = procUnpublishService(c, vars, nil)
Expand Down
2 changes: 1 addition & 1 deletion api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ type serviceDelete struct {
Force bool `json:"force"`
}

// endpointInfo contants the endpoint info for https response message on endpoint creation
// endpointInfo represents the endpoint info for https response message on endpoint creation
type endpointInfo struct {
ID string `json:"id"`
Address net.IPNet `json:"address"`
Expand Down
4 changes: 2 additions & 2 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ var mockContainerID = "2a3456789"
var mockSandboxID = "2b3456789"

func setupMockHTTPCallback() {
var list []networkResource
nw := networkResource{Name: mockNwName, ID: mockNwID}
var list []NetworkResource
nw := NetworkResource{Name: mockNwName, ID: mockNwID}
mockNwJSON, _ = json.Marshal(nw)
list = append(list, nw)
mockNwListJSON, _ = json.Marshal(list)
Expand Down
5 changes: 2 additions & 3 deletions client/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/docker/docker/opts"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/libnetwork"
flag "github.com/docker/libnetwork/client/mflag"
"github.com/docker/libnetwork/netutils"
)
Expand Down Expand Up @@ -180,13 +179,13 @@ func (cli *NetworkCli) CmdServicePublish(chain string, args ...string) error {
return err
}

var ep libnetwork.Endpoint
var ep EndpointInfo
err = json.Unmarshal(obj, &ep)
if err != nil {
return err
}

fmt.Fprintf(cli.out, "%s\n", ep.ID())
fmt.Fprintf(cli.out, "%s\n", ep.ID)
return nil
}

Expand Down
Binary file removed install/cniserver
Binary file not shown.

0 comments on commit 7da1b8f

Please sign in to comment.