Skip to content

Commit

Permalink
Add ip-address to network settings #43 #12
Browse files Browse the repository at this point in the history
  • Loading branch information
joyrex2001 committed Aug 3, 2023
1 parent 422cad7 commit b9631b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions internal/server/routes/docker/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,9 @@ func getContainerInfo(cr *common.ContextRouter, tainr *types.Container, detail b
"Image": tainr.Image,
"Names": getContainerNames(tainr),
"NetworkSettings": gin.H{
"Networks": netdtl,
"Ports": getNetworkSettingsPorts(cr, tainr),
"IPAddress": "127.0.0.1",
"Networks": netdtl,
"Ports": getNetworkSettingsPorts(cr, tainr),
},
"HostConfig": gin.H{
"NetworkMode": "bridge",
Expand Down
7 changes: 4 additions & 3 deletions internal/server/routes/libpod/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func ContainerDelete(cr *common.ContextRouter, c *gin.Context) {
}

// ContainerExists - Check if container exists.
// https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/containers/operation/ContainerInspectLibpod
// https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/containers/operation/ContainerExistsLibpod
// GET "/libpod/containers/:id/exists"
func ContainerExists(cr *common.ContextRouter, c *gin.Context) {
id := c.Param("id")
Expand Down Expand Up @@ -235,8 +235,9 @@ func getContainerInfo(cr *common.ContextRouter, tainr *types.Container, detail b
"Name": tainr.Name,
"Image": tainr.Image,
"NetworkSettings": gin.H{
"Networks": netdtl,
"Ports": getNetworkSettingsPorts(cr, tainr),
"IPAddress": "127.0.0.1",
"Networks": netdtl,
"Ports": getNetworkSettingsPorts(cr, tainr),
},
"HostConfig": gin.H{
"PortBindings": getNetworkSettingsPorts(cr, tainr),
Expand Down

0 comments on commit b9631b9

Please sign in to comment.