Skip to content

Commit

Permalink
Merge pull request #574 from nginx-proxy/anthonyraymond/network-mode
Browse files Browse the repository at this point in the history
Add NetworkMode to RuntimeContainer
  • Loading branch information
buchdag authored Dec 10, 2023
2 parents 8dc68b7 + 69b2192 commit 436e98d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ type RuntimeContainer struct {
Gateway string
Name string
Hostname string
NetworkMode string
Image DockerImage
Env map[string]string
Volumes map[string]Volume
Expand Down
1 change: 1 addition & 0 deletions internal/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ func (g *generator) getContainers() ([]*context.RuntimeContainer, error) {
Name: strings.TrimLeft(container.Name, "/"),
Hostname: container.Config.Hostname,
Gateway: container.NetworkSettings.Gateway,
NetworkMode: container.HostConfig.NetworkMode,
Addresses: []context.Address{},
Networks: []context.Network{},
Env: make(map[string]string),
Expand Down
3 changes: 3 additions & 0 deletions internal/generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ func TestGenerateFromEvents(t *testing.T) {
Cmd: []string{"/bin/sh"},
Image: "base:latest",
},
HostConfig: &docker.HostConfig{
NetworkMode: "container:d246e2c9e3d465d96359c942e91de493f6d51a01ba33900d865180d64c34ee91",
},
State: docker.State{
Running: true,
Pid: 400,
Expand Down

0 comments on commit 436e98d

Please sign in to comment.