Documentation
¶
Index ¶
- func AddErrand(ctx context.Context, config *config.Config, mgr manager.Manager) error
- func AddJob(ctx context.Context, config *config.Config, mgr manager.Manager) error
- func AddOwnership(ctx context.Context, config *config.Config, mgr manager.Manager) error
- func AddTrigger(ctx context.Context, config *config.Config, mgr manager.Manager) error
- func InferPodState(pod corev1.Pod) ejv1.PodState
- func NewErrandReconciler(ctx context.Context, config *config.Config, mgr manager.Manager, ...) reconcile.Reconciler
- func NewJobReconciler(ctx context.Context, config *config.Config, mgr manager.Manager, ...) (reconcile.Reconciler, error)
- func NewOwnershipReconciler(ctx context.Context, config *config.Config, mgr manager.Manager, ...) reconcile.Reconciler
- func NewTriggerReconciler(ctx context.Context, config *config.Config, mgr manager.Manager, query Query, ...) reconcile.Reconciler
- func PodStatusString(pod corev1.Pod) string
- type ErrandReconciler
- type Owner
- type OwnershipReconciler
- type PodLogGetter
- type PodLogGetterImpl
- type Query
- type QueryImpl
- type ReconcileJob
- type TriggerReconciler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddErrand ¶
AddErrand creates a new ExtendedJob controller to start errands when their trigger strategy matches
func AddJob ¶
AddJob creates a new ExtendedJob controller and adds it to the Manager
func AddOwnership ¶
AddOwnership creates a new ExtendedJob controller to update ownership on configs for auto errands.
func AddTrigger ¶
AddTrigger creates a new ExtendedJob controller and adds it to the Manager
func InferPodState ¶
InferPodState determines our pod state
ready (p:Running,c:[Initialized Ready ContainersReady PodScheduled]) created (p:Pending,c:[Initialized Ready ContainersReady PodScheduled]) notready (p:Pending,c:[PodScheduled]) notready (p:Pending,c:[]) deleted (p:Running,c:[Initialized Ready ContainersReady PodScheduled]) deleted (p:Succeeded,c:[Initialized Ready ContainersReady PodScheduled])
func NewErrandReconciler ¶
func NewErrandReconciler( ctx context.Context, config *config.Config, mgr manager.Manager, f setOwnerReferenceFunc, owner Owner, ) reconcile.Reconciler
NewErrandReconciler returns a new reconciler for errand jobs
func NewJobReconciler ¶
func NewJobReconciler(ctx context.Context, config *config.Config, mgr manager.Manager, podLogGetter PodLogGetter) (reconcile.Reconciler, error)
NewJobReconciler returns a new Reconciler
func NewOwnershipReconciler ¶
func NewOwnershipReconciler( ctx context.Context, config *config.Config, mgr manager.Manager, f setOwnerReferenceFunc, owner Owner, ) reconcile.Reconciler
NewOwnershipReconciler returns a new reconciler for errand jobs
Types ¶
type ErrandReconciler ¶
type ErrandReconciler struct {
// contains filtered or unexported fields
}
ErrandReconciler implements the Reconciler interface
type Owner ¶
type Owner interface {
Sync(context.Context, apis.Object, corev1.PodSpec) error
RemoveOwnerReferences(context.Context, apis.Object, []apis.Object) error
ListConfigsOwnedBy(context.Context, apis.Object) ([]apis.Object, error)
}
Owner interface to manage ownership on configs and secrets
type OwnershipReconciler ¶
type OwnershipReconciler struct {
// contains filtered or unexported fields
}
OwnershipReconciler implements the Reconciler interface
func (*OwnershipReconciler) Reconcile ¶
Reconcile keeps track of ownership on all configs, configmaps and secrets, which are used by extended jobs. Only called for CRs, which have UpdateOnConfigChange set to true.
type PodLogGetter ¶
PodLogGetter fetches the logs from a Pod
func NewPodLogGetter ¶
func NewPodLogGetter(client corev1client.CoreV1Interface) PodLogGetter
NewPodLogGetter returns an instance of a PodLogGetterImpl
type PodLogGetterImpl ¶
type PodLogGetterImpl struct {
// contains filtered or unexported fields
}
PodLogGetterImpl implements the PodLogGetter interface
func (*PodLogGetterImpl) Get ¶
func (p *PodLogGetterImpl) Get(namespace, podName, containerName string) ([]byte, error)
Get fetches the logs for the given pod
type Query ¶
type Query interface {
Match(ejv1.ExtendedJob, corev1.Pod) bool
MatchState(ejv1.ExtendedJob, ejv1.PodState) bool
}
Query for events involving pods and filter them
type QueryImpl ¶
type QueryImpl struct {
}
QueryImpl implements the query interface
func (*QueryImpl) Match ¶
Match pod against label whitelist from extended job
type ReconcileJob ¶
type ReconcileJob struct {
// contains filtered or unexported fields
}
ReconcileJob reconciles an Job object
func (*ReconcileJob) Reconcile ¶
Reconcile reads that state of the cluster for a Job object that is owned by an ExtendedJob and makes changes based on the state read and what is in the ExtendedJob.Spec Note: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
type TriggerReconciler ¶
type TriggerReconciler struct {
// contains filtered or unexported fields
}
TriggerReconciler implements the Reconciler interface
Source Files
¶
- errand_controller.go
- errand_reconciler.go
- job_controller.go
- job_reconciler.go
- ownership_controller.go
- ownership_reconciler.go
- pod_log_getter.go
- pod_state.go
- query.go
- trigger_controller.go
- trigger_reconciler.go