Documentation ¶
Overview ¶
Package model holds model related files
Package model holds model related files ¶
Package model holds model related files ¶
Package model holds model related files
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoImageProvided = errors.New("no image name provided") // ErrNoImageProvided is returned when no image name is provided
)
Functions ¶
func WorkloadSelectorToProto ¶
func WorkloadSelectorToProto(input *WorkloadSelector) *proto.ProfileSelector
WorkloadSelectorToProto incode a WorkloadSelector to its protobuf representation
Types ¶
type CacheEntry ¶
type CacheEntry struct { model.CGroupContext model.ContainerContext sync.RWMutex Deleted *atomic.Bool WorkloadSelector WorkloadSelector PIDs map[uint32]bool }
CacheEntry cgroup resolver cache entry
func NewCacheEntry ¶
func NewCacheEntry(containerID string, cgroupFlags uint64, pids ...uint32) (*CacheEntry, error)
NewCacheEntry returns a new instance of a CacheEntry
func (*CacheEntry) AddPID ¶
func (cgce *CacheEntry) AddPID(pid uint32)
AddPID adds a pid to the list of pids
func (*CacheEntry) GetPIDs ¶
func (cgce *CacheEntry) GetPIDs() []uint32
GetPIDs returns the list of pids for the current workload
func (*CacheEntry) GetWorkloadSelectorCopy ¶
func (cgce *CacheEntry) GetWorkloadSelectorCopy() *WorkloadSelector
GetWorkloadSelectorCopy returns a copy of the workload selector of this cgroup
func (*CacheEntry) NeedsTagsResolution ¶
func (cgce *CacheEntry) NeedsTagsResolution() bool
NeedsTagsResolution returns true if this workload is missing its tags
func (*CacheEntry) RemovePID ¶
func (cgce *CacheEntry) RemovePID(pid uint32)
RemovePID removes the provided pid from the list of pids
func (*CacheEntry) SetTags ¶
func (cgce *CacheEntry) SetTags(tags []string)
SetTags sets the tags for the provided workload
type WorkloadSelector ¶
WorkloadSelector is a selector used to uniquely indentify the image of a workload
func NewWorkloadSelector ¶
func NewWorkloadSelector(image string, tag string) (WorkloadSelector, error)
NewWorkloadSelector returns an initialized instance of a WorkloadSelector
func ProtoToWorkloadSelector ¶
func ProtoToWorkloadSelector(selector *proto.ProfileSelector) WorkloadSelector
ProtoToWorkloadSelector decodes a Selector structure
func (*WorkloadSelector) IsReady ¶
func (ws *WorkloadSelector) IsReady() bool
IsReady returns true if the selector is ready
func (*WorkloadSelector) Match ¶
func (ws *WorkloadSelector) Match(selector WorkloadSelector) bool
Match returns true if the input selector matches the current selector
func (WorkloadSelector) String ¶
func (ws WorkloadSelector) String() string
String returns a string representation of a workload selector
func (WorkloadSelector) ToTags ¶
func (ws WorkloadSelector) ToTags() []string
ToTags returns a string array representation of a workload selector