diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-02-12 11:30:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-12 11:30:00 -0500 |
commit | 291f59600b7857bbec6f340d3ceec6e2e9ce923f (patch) | |
tree | 401aaa4e56cbe585582fa1124a9cd77a83ae21a9 /pkg/api/handlers/utils | |
parent | 1b284a298c0bde20561321f325d4a7ad00e7bd25 (diff) | |
parent | 78c8a87362ee27ba1d2a62b7c9d73adc313c7d7e (diff) | |
download | podman-291f59600b7857bbec6f340d3ceec6e2e9ce923f.tar.gz podman-291f59600b7857bbec6f340d3ceec6e2e9ce923f.tar.bz2 podman-291f59600b7857bbec6f340d3ceec6e2e9ce923f.zip |
Merge pull request #9331 from Luap99/lint
Enable more golangci-lint linters
Diffstat (limited to 'pkg/api/handlers/utils')
-rw-r--r-- | pkg/api/handlers/utils/containers.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/pkg/api/handlers/utils/containers.go b/pkg/api/handlers/utils/containers.go index 518309a03..ba202cad0 100644 --- a/pkg/api/handlers/utils/containers.go +++ b/pkg/api/handlers/utils/containers.go @@ -130,10 +130,9 @@ func WaitContainerLibpod(w http.ResponseWriter, r *http.Request) { if errors.Cause(err) == define.ErrNoSuchCtr { ContainerNotFound(w, name, err) return - } else { - InternalServerError(w, err) - return } + InternalServerError(w, err) + return } WriteResponse(w, http.StatusOK, strconv.Itoa(int(exitCode))) } @@ -141,7 +140,6 @@ func WaitContainerLibpod(w http.ResponseWriter, r *http.Request) { type containerWaitFn func(conditions ...define.ContainerStatus) (int32, error) func createContainerWaitFn(ctx context.Context, containerName string, interval time.Duration) containerWaitFn { - runtime := ctx.Value("runtime").(*libpod.Runtime) var containerEngine entities.ContainerEngine = &abi.ContainerEngine{Libpod: runtime} @@ -170,7 +168,6 @@ func isValidDockerCondition(cond string) bool { } func waitDockerCondition(ctx context.Context, containerName string, interval time.Duration, dockerCondition string) (int32, error) { - containerWait := createContainerWaitFn(ctx, containerName, interval) var err error @@ -200,9 +197,8 @@ func waitRemoved(ctrWait containerWaitFn) (int32, error) { code, err := ctrWait(define.ContainerStateUnknown) if err != nil && errors.Cause(err) == define.ErrNoSuchCtr { return code, nil - } else { - return code, err } + return code, err } func waitNextExit(ctrWait containerWaitFn) (int32, error) { |