mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-31 13:50:01 +00:00 
			
		
		
		
	godep restore pushd $GOPATH/src/github.com/appc/spec git co master popd go get go4.org/errorutil rm -rf Godeps godep save ./... git add vendor git add -f $(git ls-files --other vendor/) git co -- Godeps/LICENSES Godeps/.license_file_state Godeps/OWNERS
		
			
				
	
	
		
			19 lines
		
	
	
		
			556 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			556 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package client
 | |
| 
 | |
| import (
 | |
| 	"github.com/docker/engine-api/types"
 | |
| 	"github.com/docker/engine-api/types/network"
 | |
| 	"golang.org/x/net/context"
 | |
| )
 | |
| 
 | |
| // NetworkConnect connects a container to an existent network in the docker host.
 | |
| func (cli *Client) NetworkConnect(ctx context.Context, networkID, containerID string, config *network.EndpointSettings) error {
 | |
| 	nc := types.NetworkConnect{
 | |
| 		Container:      containerID,
 | |
| 		EndpointConfig: config,
 | |
| 	}
 | |
| 	resp, err := cli.post(ctx, "/networks/"+networkID+"/connect", nil, nc, nil)
 | |
| 	ensureReaderClosed(resp)
 | |
| 	return err
 | |
| }
 |