Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Don't add empty port mappings to the tracker
Browse files Browse the repository at this point in the history
- The empty maps are added for every container that is created that
  doens't have a port mapping, this can spam the logs and make the
  debugging harder.

Signed-off-by: Nino Kodabande <nkodabande@suse.com>
  • Loading branch information
Nino-K committed Apr 24, 2023
1 parent c7c0f9c commit 6213914
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/tracker/porttracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ func NewPortTracker(forwarder *forwarder.VtunnelForwarder, wslAddrs []types.Conn

// Add adds a container ID and port mapping to the tracker.
func (p *PortTracker) Add(containerID string, portMap nat.PortMap) error {
if len(portMap) == 0 {
return nil
}

p.mutex.Lock()
p.portmap[containerID] = portMap
log.Debugf("PortTracker Add status: %+v", p.portmap)
Expand Down

0 comments on commit 6213914

Please sign in to comment.