Skip to content

Not seeing network traffic #90

Description

@jfarlik

So misleading title slightly so it doesn't get ignored. I am sure It is related to the rootless podman environment I am running it in, just wanted to see if there were any ideas on how to get it to work. I re-wrote the "Figure out which container we are currently running in" section to work with podman. And figured out podman compose options and it is able to manage other containers, but still can't get the network reception working.

DEBUG: group.go:68: 0 received out of 1 packets needed to restart container

Any ideas? and Thanks for making this!

(If anyone is interested rewritten container ID)

// Figure out which container we are currently running in
var thisLazytainer container.Summary

// Support for Podman/Custom names via environment variable
selfName := os.Getenv("SELF_NAME")
if selfName == "" {
	selfName = "lazytainer-proxy"
}

for c := range containers {
	thisContainer := containers[c]

	// 1. Original Logic: Check if ID matches hostname
	if strings.HasPrefix(thisContainer.ID, container_id) {
		thisLazytainer = thisContainer
	} else if strings.HasPrefix(thisContainer.HostConfig.NetworkMode, "container:"+container_id) {
		// 2. Original Logic: Check if NetworkMode matches (for sidecars)
		thisLazytainer = thisContainer
	} else {
		// 3. Podman Fix: Check if container name matches our SELF_NAME
		for _, name := range thisContainer.Names {
			if strings.TrimPrefix(name, "/") == selfName {
				thisLazytainer = thisContainer
				break
			}
		}
	}

	// If we found a match in any of the above, stop looking
	if thisLazytainer.ID != "" {
		break
	}
}

fmt.Printf("DEBUG: Found self! ID: %s\n", thisLazytainer.ID)

// this should never happen
if thisLazytainer.ID == "" {
	panic("Could not determine container ID of lazytainer")
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions