controllers

package
v0.0.0-...-43b513b Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FailedDeleteJobReason     = "FailedDeleteJob"
	SuccessfulDeleteJobReason = "SuccessfulDeleteJob"
	JobPhaseTransitionReason  = "JobPhaseTransition"
)

Variables

This section is empty.

Functions

func GetPodDomainName

func GetPodDomainName(jobName, namespace string, rtype, index string) string

GetPodDomainName

func IsFinished

func IsFinished(phase commonv1.JobConditionType) bool

IsFinished

func IsInvalidDefinition

func IsInvalidDefinition(status api.BaguaStatus) bool

IsInvalidDefinition

Types

type BaguaReconciler

type BaguaReconciler struct {
	common.JobController
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
	Config *config.OperatorConfig
}

BaguaReconciler reconciles a Bagua object

func (*BaguaReconciler) AddObject

func (r *BaguaReconciler) AddObject(e event.CreateEvent) bool

func (*BaguaReconciler) ControllerName

func (r *BaguaReconciler) ControllerName() string

func (*BaguaReconciler) DeleteExpectations

func (r *BaguaReconciler) DeleteExpectations(job *api.Bagua)

func (*BaguaReconciler) DeleteJob

func (r *BaguaReconciler) DeleteJob(job interface{}) error

func (*BaguaReconciler) DeleteObject

func (r *BaguaReconciler) DeleteObject(e event.DeleteEvent) bool

func (*BaguaReconciler) ExpectationsFuncApply

func (r *BaguaReconciler) ExpectationsFuncApply(job *api.Bagua, f func(key string) error) error

func (*BaguaReconciler) GetAPIGroupVersion

func (r *BaguaReconciler) GetAPIGroupVersion() schema.GroupVersion

func (*BaguaReconciler) GetAPIGroupVersionKind

func (r *BaguaReconciler) GetAPIGroupVersionKind() schema.GroupVersionKind

func (*BaguaReconciler) GetDefaultContainerName

func (r *BaguaReconciler) GetDefaultContainerName() string

func (*BaguaReconciler) GetDefaultContainerPortName

func (r *BaguaReconciler) GetDefaultContainerPortName() string

func (*BaguaReconciler) GetGroupNameLabelValue

func (r *BaguaReconciler) GetGroupNameLabelValue() string

func (*BaguaReconciler) GetJobFromAPIClient

func (r *BaguaReconciler) GetJobFromAPIClient(namespace, name string) (metav1.Object, error)

GetJobFromAPIClient

func (*BaguaReconciler) GetJobFromInformerCache

func (r *BaguaReconciler) GetJobFromInformerCache(namespace, name string) (metav1.Object, error)

func (*BaguaReconciler) GetPodsForJob

func (r *BaguaReconciler) GetPodsForJob(job interface{}) ([]*corev1.Pod, error)

GetPodsForJob returns the pods managed by the job. This can be achieved by selecting pods using label key "job-name" i.e. all pods created by the job will come with label "job-name" = <this_job_name>

func (*BaguaReconciler) GetServicesForJob

func (r *BaguaReconciler) GetServicesForJob(job interface{}) ([]*corev1.Service, error)

GetServicesForJob returns the services managed by the job. This can be achieved by selecting services using label key "job-name" i.e. all services created by the job will come with label "job-name" = <this_job_name>

func (*BaguaReconciler) IsMasterRole

func (r *BaguaReconciler) IsMasterRole(replicas map[commonv1.ReplicaType]*commonv1.ReplicaSpec,
	rtype commonv1.ReplicaType, index int) bool

func (*BaguaReconciler) Reconcile

func (r *BaguaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*BaguaReconciler) ResetExpectations

func (r *BaguaReconciler) ResetExpectations(job *api.Bagua) error

func (*BaguaReconciler) SatisfiedExpectations

func (r *BaguaReconciler) SatisfiedExpectations(job *api.Bagua) bool

func (*BaguaReconciler) SetClusterSpec

func (r *BaguaReconciler) SetClusterSpec(job interface{}, podTemplate *corev1.PodTemplateSpec, rtype, index string) error

SetClusterSpec sets the cluster spec for the pod

func (*BaguaReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*BaguaReconciler) UpdateJobStatus

func (r *BaguaReconciler) UpdateJobStatus(j interface{}, replicas map[commonv1.ReplicaType]*commonv1.ReplicaSpec, jobStatus *commonv1.JobStatus) error

UpdateJobStatus: update job status

func (*BaguaReconciler) UpdateJobStatusInApiServer

func (r *BaguaReconciler) UpdateJobStatusInApiServer(job interface{}, jobStatus *commonv1.JobStatus) error

Jump to

Keyboard shortcuts

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