Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

748 B
Raw Blame
// Package netutil contains display-only network metadata helpers.
package netutil

import "strings"

// IsSecondaryInterfaceName recognises common local-container/overlay names.
// It is only an address-ordering hint: it proves neither a physical NIC nor a
// default route. Do not use it to discard interfaces or change machine identity.
// Management bridges, bonds, VLANs and tunnels are deliberately not excluded.
func IsSecondaryInterfaceName(name string) bool {
	name = strings.ToLower(strings.TrimSpace(name))
	if name == "" || name == "lo" {
		return true
	}
	for _, prefix := range []string{"docker", "podman", "veth", "br-", "cni", "flannel", "virbr", "zt"} {
		if strings.HasPrefix(name, prefix) {
			return true
		}
	}
	return false
}