Skip to content

Commit

Permalink
Fix missing closing to Docker socket
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Kassar committed Jul 26, 2018
1 parent 64507b1 commit d44d89f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ func runApp(cmd *cobra.Command, args []string) {
continue
}

if err := d.Close(); err != nil {
log.Error(err)
continue
}

if service {
// Check if IP is already set
i := ip.NewIP(nic, ipaddr.Address, ipaddr.Netmask)
Expand Down
4 changes: 4 additions & 0 deletions pkg/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ func NewDockerClient() (*DockerConfig, error) {
return &DockerConfig{Client: cli}, nil
}

func (c *DockerConfig) Close() error {
return c.Client.Close()
}

func (c *DockerConfig) GetNodeID() error {
info, err := c.Client.Info(context.Background())
if err != nil {
Expand Down

0 comments on commit d44d89f

Please sign in to comment.