controllers

package
v0.0.0-...-40f476f Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllContainersHaveReadyCondition

func AllContainersHaveReadyCondition(pod *corev1.Pod) bool

func GetImmediateOwnerReference

func GetImmediateOwnerReference(pod *corev1.Pod) kube.Object

Types

type JobReconciler

type JobReconciler struct {
	Config     etc.Operator
	Client     client.Client
	LogsReader *logs.Reader
	Log        logr.Logger
	Scheme     *runtime.Scheme
	Scanner    scanner.VulnerabilityScanner
	Store      reports.StoreInterface
}

func (*JobReconciler) GetPodControlledBy

func (r *JobReconciler) GetPodControlledBy(ctx context.Context, job *batchv1.Job) (*corev1.Pod, error)

func (*JobReconciler) Reconcile

func (r *JobReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

func (*JobReconciler) SetupWithManager

func (r *JobReconciler) SetupWithManager(mgr ctrl.Manager) error

type PodReconciler

type PodReconciler struct {
	Config  etc.Operator
	Client  client.Client
	Store   reports.StoreInterface
	Scanner scanner.VulnerabilityScanner
	Log     logr.Logger
	Scheme  *runtime.Scheme
}

func (*PodReconciler) Reconcile

func (r *PodReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

Reconcile resolves the actual state of the system against the desired state of the system. The desired state is that there is a vulnerability report associated with the controller managing the given Pod. Since the scanning is asynchronous, the desired state is also when there's a pending scan Job for the underlying workload.

As Kubernetes invokes the Reconcile() function multiple times throughout the lifecycle of a Pod, it is important that the implementation be idempotent to prevent the creation of duplicate scan Jobs or vulnerability reports.

The Reconcile function returns two object which indicate whether or not Kubernetes should requeue the request.

func (*PodReconciler) SetupWithManager

func (r *PodReconciler) SetupWithManager(mgr ctrl.Manager) error

Jump to

Keyboard shortcuts

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