diff options
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r-- | pkg/domain/infra/abi/containers_stat.go | 4 | ||||
-rw-r--r-- | pkg/domain/infra/abi/images.go | 9 | ||||
-rw-r--r-- | pkg/domain/infra/abi/play.go | 1 | ||||
-rw-r--r-- | pkg/domain/infra/abi/secrets.go | 1 | ||||
-rw-r--r-- | pkg/domain/infra/tunnel/containers.go | 3 | ||||
-rw-r--r-- | pkg/domain/infra/tunnel/helpers.go | 2 | ||||
-rw-r--r-- | pkg/domain/infra/tunnel/images.go | 1 | ||||
-rw-r--r-- | pkg/domain/infra/tunnel/secrets.go | 1 |
8 files changed, 5 insertions, 17 deletions
diff --git a/pkg/domain/infra/abi/containers_stat.go b/pkg/domain/infra/abi/containers_stat.go index f3d0799a0..1844f4019 100644 --- a/pkg/domain/infra/abi/containers_stat.go +++ b/pkg/domain/infra/abi/containers_stat.go @@ -35,7 +35,7 @@ func (ic *ContainerEngine) containerStat(container *libpod.Container, containerM // ENOENT let's the API handlers return the correct status code // which is crucial for the remote client. if os.IsNotExist(err) || strings.Contains(statInfoErr.Error(), "o such file or directory") { - statInfoErr = copy.ENOENT + statInfoErr = copy.ErrENOENT } // If statInfo is nil, there's nothing we can do anymore. A // non-nil statInfo may indicate a symlink where we must have @@ -129,7 +129,7 @@ func secureStat(root string, path string) (*buildahCopiah.StatForItem, error) { stat, exists := globStats[0].Results[glob] // only one glob passed, so that's okay if !exists { - return nil, copy.ENOENT + return nil, copy.ErrENOENT } var statErr error diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go index f2d0f2c39..fb01c72b6 100644 --- a/pkg/domain/infra/abi/images.go +++ b/pkg/domain/infra/abi/images.go @@ -40,10 +40,9 @@ func (ir *ImageEngine) Exists(_ context.Context, nameOrID string) (*entities.Boo if err != nil { if errors.Cause(err) == define.ErrMultipleImages { return &entities.BoolReport{Value: true}, nil - } else { - if errors.Cause(err) != define.ErrNoSuchImage { - return nil, err - } + } + if errors.Cause(err) != define.ErrNoSuchImage { + return nil, err } } return &entities.BoolReport{Value: err == nil}, nil @@ -270,7 +269,6 @@ func pull(ctx context.Context, runtime *image.Runtime, rawImage string, options } if _, isTagged := namedRef.(reference.Tagged); isTagged { return nil, errors.New("--all-tags requires a reference without a tag") - } systemContext := image.GetSystemContext("", options.Authfile, false) @@ -503,7 +501,6 @@ func (ir *ImageEngine) Config(_ context.Context) (*config.Config, error) { } func (ir *ImageEngine) Build(ctx context.Context, containerFiles []string, opts entities.BuildOptions) (*entities.BuildReport, error) { - id, _, err := ir.Libpod.Build(ctx, opts.BuildOptions, containerFiles...) if err != nil { return nil, err diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 70c7104f1..35a84106f 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -60,7 +60,6 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, path string, options en default: return nil, errors.Errorf("invalid YAML kind: %q. [Pod|Deployment] are the only supported Kubernetes Kinds", kubeObject.Kind) } - } func (ic *ContainerEngine) playKubeDeployment(ctx context.Context, deploymentYAML *v1apps.Deployment, options entities.PlayKubeOptions) (*entities.PlayKubeReport, error) { diff --git a/pkg/domain/infra/abi/secrets.go b/pkg/domain/infra/abi/secrets.go index b1fe60e01..355971a5b 100644 --- a/pkg/domain/infra/abi/secrets.go +++ b/pkg/domain/infra/abi/secrets.go @@ -65,7 +65,6 @@ func (ic *ContainerEngine) SecretInspect(ctx context.Context, nameOrIDs []string }, } reports = append(reports, report) - } return reports, errs, nil diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index e9c513f8e..c2c282ef9 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -290,7 +290,6 @@ func (ic *ContainerEngine) ContainerCheckpoint(ctx context.Context, namesOrIds [ ctrs = append(ctrs, c) } } - } else { ctrs, err = getContainersByContext(ic.ClientCtx, false, false, namesOrIds) if err != nil { @@ -326,7 +325,6 @@ func (ic *ContainerEngine) ContainerRestore(ctx context.Context, namesOrIds []st ctrs = append(ctrs, c) } } - } else { ctrs, err = getContainersByContext(ic.ClientCtx, false, false, namesOrIds) if err != nil { @@ -570,7 +568,6 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri } // Start the container if it's not running already. if !ctrRunning { - err = containers.Start(ic.ClientCtx, name, new(containers.StartOptions).WithDetachKeys(options.DetachKeys)) if err != nil { if ctr.AutoRemove { diff --git a/pkg/domain/infra/tunnel/helpers.go b/pkg/domain/infra/tunnel/helpers.go index 0a806d860..e40e27596 100644 --- a/pkg/domain/infra/tunnel/helpers.go +++ b/pkg/domain/infra/tunnel/helpers.go @@ -55,7 +55,6 @@ func getContainersByContext(contextWithConnection context.Context, all, ignore b found = true break } - } if !found && !ignore { @@ -107,7 +106,6 @@ func getPodsByContext(contextWithConnection context.Context, all bool, namesOrID found = true break } - } if !found { diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go index daad911cd..c6faaa9bb 100644 --- a/pkg/domain/infra/tunnel/images.go +++ b/pkg/domain/infra/tunnel/images.go @@ -32,7 +32,6 @@ func (ir *ImageEngine) Remove(ctx context.Context, imagesArg []string, opts enti } func (ir *ImageEngine) List(ctx context.Context, opts entities.ImageListOptions) ([]*entities.ImageSummary, error) { - filters := make(map[string][]string, len(opts.Filter)) for _, filter := range opts.Filter { f := strings.Split(filter, "=") diff --git a/pkg/domain/infra/tunnel/secrets.go b/pkg/domain/infra/tunnel/secrets.go index f7c0f7d13..336297528 100644 --- a/pkg/domain/infra/tunnel/secrets.go +++ b/pkg/domain/infra/tunnel/secrets.go @@ -76,7 +76,6 @@ func (ic *ContainerEngine) SecretRm(ctx context.Context, nameOrIDs []string, opt Err: secrets.Remove(ic.ClientCtx, name), ID: secret.ID, }) - } return allRm, nil } |