Skip to content

Commit

Permalink
Merge pull request #18043 from vrothberg/fix-18041
Browse files Browse the repository at this point in the history
test updates to help debug #18041
  • Loading branch information
openshift-merge-robot authored Apr 6, 2023
2 parents 4880f63 + cb7b8fb commit b39cdff
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion pkg/api/handlers/compat/images_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,6 @@ func extractTarFile(r *http.Request) (string, error) {

// Content-Length not used as too many existing API clients didn't honor it
_, err = io.Copy(tarBall, r.Body)
r.Body.Close()
if err != nil {
return "", fmt.Errorf("failed Request: Unable to copy tar file from request body %s", r.RequestURI)
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/api/handlers/libpod/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ func KubePlay(w http.ResponseWriter, r *http.Request) {
options.Start = types.NewOptionalBool(query.Start)
}
report, err := containerEngine.PlayKube(r.Context(), r.Body, options)
_ = r.Body.Close()
if err != nil {
utils.Error(w, http.StatusInternalServerError, fmt.Errorf("playing YAML file: %w", err))
return
Expand All @@ -132,7 +131,6 @@ func KubePlayDown(w http.ResponseWriter, r *http.Request) {

containerEngine := abi.ContainerEngine{Libpod: runtime}
report, err := containerEngine.PlayKubeDown(r.Context(), r.Body, entities.PlayKubeDownOptions{Force: query.Force})
_ = r.Body.Close()
if err != nil {
utils.Error(w, http.StatusInternalServerError, fmt.Errorf("tearing down YAML file: %w", err))
return
Expand Down
8 changes: 2 additions & 6 deletions test/apiv2/80-kube.at
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ t POST libpod/kube/play $YAML 200 \
.Pods[0].Containers[0]~[0-9a-f]\\{64\\}

t DELETE libpod/kube/play $YAML 200 \
.Pods[0].ID~null \
.Pods[0].ContainerErrors=null \
.Pods[0].Containers[0]~null
.StopReport[0].Id~[0-9a-f]\\{64\\} \
.RmReport[0].Id~[0-9a-f]\\{64\\}

# Make sure that play-kube works

Expand All @@ -61,9 +60,6 @@ t POST libpod/play/kube $YAML 200 \
.Pods[0].Containers[0]~[0-9a-f]\\{64\\}

t DELETE libpod/play/kube $YAML 200 \
.Pods[0].ID~null \
.Pods[0].ContainerErrors=null \
.Pods[0].Containers[0]~null \
.StopReport[0].Id~[0-9a-f]\\{64\\} \
.RmReport[0].Id~[0-9a-f]\\{64\\}

Expand Down

0 comments on commit b39cdff

Please sign in to comment.