extendedjob

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvKubeAz is set by available zone name
	EnvKubeAz = "KUBE_AZ"
	// EnvBoshAz is set by available zone name
	EnvBoshAz = "BOSH_AZ"
	// EnvReplicas describes the number of replicas in the ExtendedStatefulSet
	EnvReplicas = "REPLICAS"
	// EnvCfOperatorAz is set by available zone name
	EnvCfOperatorAz = "CF_OPERATOR_AZ"
	// EnvCFOperatorAZIndex is set by available zone index
	EnvCFOperatorAZIndex = "AZ_INDEX"
	// EnvPodOrdinal is the pod's index
	EnvPodOrdinal = "POD_ORDINAL"
	// EnvCFONamespace is the namespace in which cf-operator runs
	EnvCFONamespace = "CF_OPERATOR_NAMESPACE"
)

Variables

View Source
var (
	// LabelEjobPod is the label present on every jobpod of exjob.
	LabelEjobPod = fmt.Sprintf("%s/ejob-name", apis.GroupName)
)

Functions

func AddErrand

func AddErrand(ctx context.Context, config *config.Config, mgr manager.Manager) error

AddErrand creates a new ExtendedJob controller to start errands, when their trigger strategy matches 'now' or 'once', or their configuration changed.

func AddJob

func AddJob(ctx context.Context, config *config.Config, mgr manager.Manager) error

AddJob creates a new Job controller to collect the output from jobs, persist that output as a secret and delete the k8s job afterwards.

func NewErrandReconciler

func NewErrandReconciler(
	ctx context.Context,
	config *config.Config,
	mgr manager.Manager,
	f setOwnerReferenceFunc,
	store vss.VersionedSecretStore,
) reconcile.Reconciler

NewErrandReconciler returns a new reconciler for errand jobs.

func NewJobReconciler

func NewJobReconciler(ctx context.Context, config *config.Config, mgr manager.Manager) (reconcile.Reconciler, error)

NewJobReconciler returns a new Reconciler

func PersistOutput added in v0.4.2

func PersistOutput(namespace string) error

PersistOutput converts the output files of each container in the pod related to an ejob into a kubernetes secret.

Types

type ErrandReconciler

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

ErrandReconciler implements the Reconciler interface.

func (*ErrandReconciler) Reconcile

func (r *ErrandReconciler) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile starts jobs for extended jobs of the type errand with Run being set to 'now' manually.

type JobCreator added in v0.4.0

type JobCreator interface {
	Create(ctx context.Context, eJob ejv1.ExtendedJob, namespace string) (retry bool, err error)
}

JobCreator is the interface that wraps the basic Create method.

func NewJobCreator added in v0.4.0

func NewJobCreator(client crc.Client, scheme *runtime.Scheme, f setOwnerReferenceFunc, store vss.VersionedSecretStore) JobCreator

NewJobCreator returns a new job creator

type ReconcileJob

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

ReconcileJob reconciles an Job object

func (*ReconcileJob) Reconcile

func (r *ReconcileJob) Reconcile(request reconcile.Request) (reconcile.Result, error)

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.

Source Files

  • errand_controller.go
  • errand_reconciler.go
  • job_controller.go
  • job_create_secret.go
  • job_creator.go
  • job_reconciler.go

Jump to

Keyboard shortcuts

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