Versions in this module Expand all Collapse all v0 v0.5.7 Aug 22, 2023 Changes in this version + const NodeCollectorName + const TrivyAutoCreated + const TrivyCollectorName + const TrivyResourceKind + const TrivyResourceName + var ErrTimeout = errors.New("runner received timeout") + func ComputeHash(obj interface{}) string + func GetActiveDeadlineSeconds(d time.Duration) *int64 + func GetJob(opts ...JobOption) (*batchv1.Job, error) + func GetTerminatedContainersStatusesByPod(pod *corev1.Pod) map[string]*corev1.ContainerStateTerminated + func IsPodControlledByJobNotFound(err error) bool + type Collector interface + AppendLabels func(opts ...CollectorOption) + Apply func(ctx context.Context, nodeName string) (*batchv1.Job, error) + ApplyAndCollect func(ctx context.Context, nodeName string) (string, error) + Cleanup func(ctx context.Context) + func NewCollector(cluster k8s.Cluster, opts ...CollectorOption) Collector + type CollectorOption func(*jobCollector) + func WithContainerSecurityContext(securityContext *corev1.SecurityContext) CollectorOption + func WithImageRef(imageRef string) CollectorOption + func WithJobAnnotation(annotation map[string]string) CollectorOption + func WithJobLabels(labels map[string]string) CollectorOption + func WithJobNamespace(namespace string) CollectorOption + func WithJobTemplateName(name string) CollectorOption + func WithJobTolerations(tolerations []corev1.Toleration) CollectorOption + func WithName(name string) CollectorOption + func WithPodImagePullSecrets(imagePullSecrets []corev1.LocalObjectReference) CollectorOption + func WithPodSpecSecurityContext(podSecurityContext *corev1.PodSecurityContext) CollectorOption + func WithServiceAccount(sa string) CollectorOption + func WithTimetout(timeout time.Duration) CollectorOption + func WithVolumes(volumes []corev1.Volume) CollectorOption + func WithVolumesMount(volumesMount []corev1.VolumeMount) CollectorOption + type JobBuilder struct + type JobOption func(*JobBuilder) + func WithAnnotation(annotations map[string]string) JobOption + func WithContainerVolumeMounts(volumeMounts []corev1.VolumeMount) JobOption + func WithImagePullSecrets(imagePullSecrets []corev1.LocalObjectReference) JobOption + func WithJobName(name string) JobOption + func WithJobServiceAccount(sa string) JobOption + func WithLabels(labels map[string]string) JobOption + func WithNamespace(namespace string) JobOption + func WithNodeCollectorImageRef(imageRef string) JobOption + func WithNodeSelector(nodeSelector string) JobOption + func WithPodVolumes(volumes []corev1.Volume) JobOption + func WithTemplate(template string) JobOption + func WithTolerations(tolerations []corev1.Toleration) JobOption + type LogsReader interface + GetLogsByJobAndContainerName func(ctx context.Context, job *batchv1.Job, containerName string) (io.ReadCloser, error) + GetTerminatedContainersStatusesByJob func(ctx context.Context, job *batchv1.Job) (map[string]*corev1.ContainerStateTerminated, error) + func NewLogsReader(clientset kubernetes.Interface) LogsReader + type ObjectRef struct + Kind string + Name string + Namespace string + type Runnable interface + Run func(ctx context.Context) error + func NewRunnableJob(clientset kubernetes.Interface, job *batchv1.Job) Runnable + type RunnableFunc func(ctx context.Context) error + func (f RunnableFunc) Run(ctx context.Context) error + type Runner interface + Run func(ctx context.Context, task Runnable) error + func New(opts ...RunnerOption) Runner + type RunnerOption func(*runner) + func WithTimeout(timeout time.Duration) RunnerOption