Documentation
¶
Index ¶
Constants ¶
View Source
const EventTypeCreate = "create"
View Source
const EventTypeDelete = "delete"
View Source
const EventTypeUpdate = "update"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NamespaceEventHandler ¶
type NamespaceEventHandler interface {
// NamespaceEvent delivers create and update; on delete, nsLabels is nil.
NamespaceEvent(name string, nsLabels map[string]string, evType string)
}
NamespaceEventHandler receives namespace labels from the pod watcher's namespace informer. It exists for handlers that match a policy's namespaceSelector but hold no pod state, so they cannot read the labels off a pod event.
type PodEventHandler ¶
type PodEventHandler interface {
// PodEvent delivers create and update. Deletes arrive via PodDeleted.
//
// nsLabels is the label set of the pod's namespace, read by the watcher so
// a policy's namespaceSelector can be matched without every handler
// holding its own namespace cache.
PodEvent(pod corev1.Pod, nsLabels map[string]string, cgInfos []*containers.ContainerCgroupInfo, podEventType string) error
// PodDeleted announces that the pod with the given UID is gone. Only the
// UID is delivered: the object itself may no longer exist anywhere, and
// handing out a synthesized pod would invite reads of fields that are
// silently empty on the delete path only.
PodDeleted(uid string) error
}
PodEventHandler receives the pod stream from the pod watcher. Handlers that only care about policies implement RuntimePolicyEventHandler instead.
type RuntimePolicyEventHandler ¶
type RuntimePolicyEventHandler interface {
RuntimePolicyEvent(rp *compiler.EvaluationResult, rpEventType string) error
}
RuntimePolicyEventHandler receives the RuntimePolicy stream from the policy informer.
Click to show internal directories.
Click to hide internal directories.