summaryrefslogtreecommitdiff
path: root/pkg/api/handlers
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-12-04 17:45:58 -0500
committerGitHub <noreply@github.com>2020-12-04 17:45:58 -0500
commit8e83799d5898aacfddabf40fb1512c5168d0b779 (patch)
treeae1658bed544a5a1868e019498caab19e25872e2 /pkg/api/handlers
parent72651dee50b121fdc02b5c4641375eb0871b353f (diff)
parent53c8bc5a5e48f02fb0c1f1a87ec5214fb47f0b93 (diff)
downloadpodman-8e83799d5898aacfddabf40fb1512c5168d0b779.tar.gz
podman-8e83799d5898aacfddabf40fb1512c5168d0b779.tar.bz2
podman-8e83799d5898aacfddabf40fb1512c5168d0b779.zip
Merge pull request #8601 from jwhonce/jira/RUN-1106-networks
Jira RUN-1106 Network handlers updates
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r--pkg/api/handlers/compat/networks.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go
index b4f3aa2f1..fe13971b0 100644
--- a/pkg/api/handlers/compat/networks.go
+++ b/pkg/api/handlers/compat/networks.go
@@ -271,11 +271,16 @@ func CreateNetwork(w http.ResponseWriter, r *http.Request) {
return
}
+ net, err := getNetworkResourceByNameOrID(name, runtime, nil)
+ if err != nil {
+ utils.InternalServerError(w, err)
+ return
+ }
body := struct {
Id string
Warning []string
}{
- Id: name,
+ Id: net.ID,
}
utils.WriteResponse(w, http.StatusCreated, body)
}
@@ -320,7 +325,7 @@ func RemoveNetwork(w http.ResponseWriter, r *http.Request) {
return
}
- utils.WriteResponse(w, http.StatusNoContent, "")
+ utils.WriteResponse(w, http.StatusNoContent, nil)
}
// Connect adds a container to a network