workload

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2024 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCgroupIDBanned       = errors.New("cgroup id is banned")
	ErrCgroupIDNotContainer = errors.New("cgroup id is not container")
)

Functions

func IsSocketPresent

func IsSocketPresent() bool

func ResolvePod added in v0.1.0

func ResolvePod(
	pid uint64,
	cgroupID uint64,
	pidToShaLRU *lru.Cache[uint64, string],
	bannedCgroupIDs *lru.Cache[uint64, struct{}],
	shaResolver *ShaResolver,
	procPath string,
	log *slog.Logger,
) (string, error)

Types

type ContainerInfo added in v0.1.0

type ContainerInfo struct {
	PodID   string
	PodName string
}

ContainerInfo stores information about a container's associated pod.

type ContainerSha added in v0.1.0

type ContainerSha string

type ShaResolver

type ShaResolver struct {

	// Channel for expired pods
	ExpiredPodChan chan string
	// contains filtered or unexported fields
}

func NewShaResolver

func NewShaResolver(
	logger *slog.Logger,
	expiredPodChan chan string,
) (*ShaResolver, error)

NewShaResolver creates a new ShaResolver instance.

func (*ShaResolver) Close

func (r *ShaResolver) Close()

Close closes the ShaResolver instance.

func (*ShaResolver) Resolve

func (r *ShaResolver) Resolve(inputSha string) (string, error)

Resolve returns the pod name associated with a given container SHA.

func (*ShaResolver) UpdateCache

func (r *ShaResolver) UpdateCache() error

UpdateCache updates the cache with the latest pod and container information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL