1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 23:04:41 +00:00

Update vendor

This commit is contained in:
Darren Shepherd
2016-05-31 18:12:52 -07:00
parent 410dfbe0fd
commit a14846152b
1253 changed files with 222820 additions and 15054 deletions

View File

@@ -16,6 +16,13 @@ type ConfigAuthLookup struct {
context *Context
}
// NewConfigAuthLookup creates a new ConfigAuthLookup for a given context
func NewConfigAuthLookup(context *Context) *ConfigAuthLookup {
return &ConfigAuthLookup{
context: context,
}
}
// Lookup uses a Docker config file to lookup authentication information
func (c *ConfigAuthLookup) Lookup(repoInfo *registry.RepositoryInfo) types.AuthConfig {
if c.context.ConfigFile == nil || repoInfo == nil || repoInfo.Index == nil {

View File

@@ -64,7 +64,8 @@ func (d *DaemonBuilder) Build(ctx context.Context, imageName string) error {
outFd, isTerminalOut := term.GetFdInfo(os.Stdout)
response, err := d.Client.ImageBuild(ctx, body, types.ImageBuildOptions{
response, err := d.Client.ImageBuild(ctx, types.ImageBuildOptions{
Context: body,
Tags: []string{imageName},
NoCache: d.NoCache,
Remove: true,

View File

@@ -152,7 +152,8 @@ func (c *Container) Recreate(ctx context.Context, imageName string) (*types.Cont
}
logrus.Debugf("Created replacement container %s", newContainer.ID)
if err := c.client.ContainerRemove(ctx, container.ID, types.ContainerRemoveOptions{
if err := c.client.ContainerRemove(ctx, types.ContainerRemoveOptions{
ContainerID: container.ID,
Force: true,
RemoveVolumes: false,
}); err != nil {
@@ -241,7 +242,8 @@ func (c *Container) Delete(ctx context.Context, removeVolume bool) error {
}
if !info.State.Running {
return c.client.ContainerRemove(ctx, container.ID, types.ContainerRemoveOptions{
return c.client.ContainerRemove(ctx, types.ContainerRemoveOptions{
ContainerID: container.ID,
Force: true,
RemoveVolumes: removeVolume,
})
@@ -291,13 +293,14 @@ func (c *Container) Run(ctx context.Context, imageName string, configOverride *c
}
options := types.ContainerAttachOptions{
Stream: true,
Stdin: configOverride.StdinOpen,
Stdout: configOverride.Tty,
Stderr: configOverride.Tty,
ContainerID: container.ID,
Stream: true,
Stdin: configOverride.StdinOpen,
Stdout: configOverride.Tty,
Stderr: configOverride.Tty,
}
resp, err := c.client.ContainerAttach(ctx, container.ID, options)
resp, err := c.client.ContainerAttach(ctx, options)
if err != nil {
return -1, err
}
@@ -632,12 +635,13 @@ func (c *Container) Log(ctx context.Context, follow bool) error {
l := c.loggerFactory.Create(name)
options := types.ContainerLogsOptions{
ShowStdout: true,
ShowStderr: true,
Follow: follow,
Tail: "all",
ContainerID: c.name,
ShowStdout: true,
ShowStderr: true,
Follow: follow,
Tail: "all",
}
responseBody, err := c.client.ContainerLogs(ctx, c.name, options)
responseBody, err := c.client.ContainerLogs(ctx, options)
if err != nil {
return err
}

View File

@@ -2,7 +2,6 @@ package docker
import (
"github.com/docker/docker/cliconfig"
"github.com/docker/docker/cliconfig/configfile"
"github.com/docker/libcompose/project"
)
@@ -12,7 +11,7 @@ type Context struct {
project.Context
ClientFactory project.ClientFactory
ConfigDir string
ConfigFile *configfile.ConfigFile
ConfigFile *cliconfig.ConfigFile
AuthLookup AuthLookup
}

View File

@@ -19,7 +19,9 @@ import (
)
func removeImage(ctx context.Context, client client.APIClient, image string) error {
_, err := client.ImageRemove(ctx, image, types.ImageRemoveOptions{})
_, err := client.ImageRemove(ctx, types.ImageRemoveOptions{
ImageID: image,
})
return err
}
@@ -43,9 +45,18 @@ func pullImage(ctx context.Context, client client.APIClient, service *Service, i
}
options := types.ImagePullOptions{
ImageID: distributionRef.String(),
Tag: "latest",
RegistryAuth: encodedAuth,
}
responseBody, err := client.ImagePull(ctx, distributionRef.String(), options)
if named, ok := distributionRef.(reference.Named); ok {
options.ImageID = named.FullName()
}
if tagged, ok := distributionRef.(reference.NamedTagged); ok {
options.Tag = tagged.Tag()
}
responseBody, err := client.ImagePull(ctx, options, nil)
if err != nil {
logrus.Errorf("Failed to pull image %s: %v", image, err)
return err

View File

@@ -36,7 +36,7 @@ func NewProject(context *Context, parseOptions *config.ParseOptions) (*project.P
}
if context.AuthLookup == nil {
context.AuthLookup = &ConfigAuthLookup{context}
context.AuthLookup = NewConfigAuthLookup(context)
}
if context.ServiceFactory == nil {

View File

@@ -278,8 +278,9 @@ func (p *Project) removeOrphanContainers() error {
if err := client.ContainerKill(context.Background(), container.ID, "SIGKILL"); err != nil {
return err
}
if err := client.ContainerRemove(context.Background(), container.ID, types.ContainerRemoveOptions{
Force: true,
if err := client.ContainerRemove(context.Background(), types.ContainerRemoveOptions{
ContainerID: container.ID,
Force: true,
}); err != nil {
return err
}