watcher

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingInstanceIDAnnotation = errors.New("object is missing Instance ID annotation")
	ErrMissingWLIDAnnotation       = errors.New("object is missing the WLID annotation")
)
View Source
var (
	ErrUnsupportedObject = errors.New("unsupported object type")
	ErrUnknownImageHash  = errors.New("unknown image hash")
)

Functions

func NewImageHashWLIDsMap

func NewImageHashWLIDsMap() *imageHashWLIDMap

NewImageHashWLIDsMap returns a new Image Hash to WLID map

func NewImageHashWLIDsMapFrom

func NewImageHashWLIDsMapFrom(startingValues map[string][]string) *imageHashWLIDMap

NewImageHashWLIDsMapFrom returns a new Image Hash to WLID map populated from a map of starting values

func NewWLIDSet

func NewWLIDSet(values ...string) wlidSet

NewWLIDSet returns a new empty set of WLIDs

Types

type WatchHandler

type WatchHandler struct {
	// contains filtered or unexported fields
}

func NewWatchHandler

func NewWatchHandler(ctx context.Context, k8sAPI *k8sinterface.KubernetesApi, storageClient kssc.Interface, imageIDsToWLIDsMap map[string][]string, instanceIDs []string) (*WatchHandler, error)

NewWatchHandler creates a new WatchHandler, initializes the maps and returns it

func (*WatchHandler) GetContainerToImageIDForWlid

func (wh *WatchHandler) GetContainerToImageIDForWlid(wlid string) map[string]string

func (*WatchHandler) GetWlidsForImageHash

func (wh *WatchHandler) GetWlidsForImageHash(imageHash string) []string

func (*WatchHandler) GetWlidsToContainerToImageIDMap

func (wh *WatchHandler) GetWlidsToContainerToImageIDMap() WlidsToContainerToImageIDMap

returns wlids map

func (*WatchHandler) HandleSBOMEvents

func (wh *WatchHandler) HandleSBOMEvents(sbomEvents <-chan watch.Event, errorCh chan<- error)

HandleSBOMEvents handles SBOM-related events

Handling events is defined as deleting SBOMs that are not known to the Operator

func (*WatchHandler) HandleSBOMFilteredEvents

func (wh *WatchHandler) HandleSBOMFilteredEvents(sfEvents <-chan watch.Event, producedCommands chan<- *apis.Command, errorCh chan<- error)

func (*WatchHandler) HandleVulnerabilityManifestEvents

func (wh *WatchHandler) HandleVulnerabilityManifestEvents(vmEvents <-chan watch.Event, errorCh chan<- error)

func (*WatchHandler) PodWatch

func (wh *WatchHandler) PodWatch(ctx context.Context, sessionObjChan *chan utils.SessionObj)

watch for pods changes, and trigger scans accordingly

func (*WatchHandler) SBOMFilteredWatch

func (wh *WatchHandler) SBOMFilteredWatch(ctx context.Context, sessionObjChan *chan utils.SessionObj)

SBOMFilteredWatch watches and processes changes on Filtered SBOMs

func (*WatchHandler) SBOMWatch

func (wh *WatchHandler) SBOMWatch(ctx context.Context, sessionObjChan *chan utils.SessionObj)

watch for sbom changes, and trigger scans accordingly

func (*WatchHandler) VulnerabilityManifestWatch

func (wh *WatchHandler) VulnerabilityManifestWatch(ctx context.Context, sessionObjChan *chan utils.SessionObj)

VulnerabilityManifestWatch watches for Vulnerability Manifests and handles them accordingly

type WlidsToContainerToImageIDMap

type WlidsToContainerToImageIDMap map[string]map[string]string

Jump to

Keyboard shortcuts

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