Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import (
"net"
"path/filepath"
"runtime"
"runtime/debug"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -1052,7 +1053,8 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (S
if containerID == "" {
return nil, types.BadRequestErrorf("invalid container ID")
}

logrus.Debugf("SAANVIIIIII %s", containerID)
debug.PrintStack()
var sb *sandbox
c.Lock()
for _, s := range c.sandboxes {
Expand Down
10 changes: 10 additions & 0 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ func (nnr NetworkNameError) Error() string {
// Forbidden denotes the type of this error
func (nnr NetworkNameError) Forbidden() {}

// PredefinedNetworkError is returned when user tries to create predefined network that already exists.
type PredefinedNetworkError string

func (pnr PredefinedNetworkError) Error() string {
return fmt.Sprintf("operation is not permitted on predefined %s network ", string(pnr))
}

// Forbidden denotes the type of this error
func (pnr PredefinedNetworkError) Forbidden() {}

// UnknownNetworkError is returned when libnetwork could not find in its database
// a network with the same name and id.
type UnknownNetworkError struct {
Expand Down
7 changes: 5 additions & 2 deletions network.go
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,7 @@ func (c *controller) getConfigNetwork(name string) (*network, error) {
}

func (n *network) createLoadBalancerSandbox() error {
var err error
sandboxName := n.name + "-sbox"
sbOptions := []SandboxOption{}
if n.ingress {
Expand Down Expand Up @@ -2090,10 +2091,12 @@ func (n *network) createLoadBalancerSandbox() error {
}
}()

if err := ep.Join(sb, nil); err != nil {
err = ep.Join(sb, nil)
if err != nil {
return err
}
return sb.EnableService()
err = sb.EnableService()
return err
}

func (n *network) deleteLoadBalancerSandbox() {
Expand Down