Documentation
¶
Index ¶
- Constants
- func GetPodDomainName(jobName, namespace string, rtype, index string) string
- func IsFinished(phase commonv1.JobConditionType) bool
- func IsInvalidDefinition(status api.BaguaStatus) bool
- type BaguaReconciler
- func (r *BaguaReconciler) AddObject(e event.CreateEvent) bool
- func (r *BaguaReconciler) ControllerName() string
- func (r *BaguaReconciler) DeleteExpectations(job *api.Bagua)
- func (r *BaguaReconciler) DeleteJob(job interface{}) error
- func (r *BaguaReconciler) DeleteObject(e event.DeleteEvent) bool
- func (r *BaguaReconciler) ExpectationsFuncApply(job *api.Bagua, f func(key string) error) error
- func (r *BaguaReconciler) GetAPIGroupVersion() schema.GroupVersion
- func (r *BaguaReconciler) GetAPIGroupVersionKind() schema.GroupVersionKind
- func (r *BaguaReconciler) GetDefaultContainerName() string
- func (r *BaguaReconciler) GetDefaultContainerPortName() string
- func (r *BaguaReconciler) GetGroupNameLabelValue() string
- func (r *BaguaReconciler) GetJobFromAPIClient(namespace, name string) (metav1.Object, error)
- func (r *BaguaReconciler) GetJobFromInformerCache(namespace, name string) (metav1.Object, error)
- func (r *BaguaReconciler) GetPodsForJob(job interface{}) ([]*corev1.Pod, error)
- func (r *BaguaReconciler) GetServicesForJob(job interface{}) ([]*corev1.Service, error)
- func (r *BaguaReconciler) IsMasterRole(replicas map[commonv1.ReplicaType]*commonv1.ReplicaSpec, ...) bool
- func (r *BaguaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *BaguaReconciler) ResetExpectations(job *api.Bagua) error
- func (r *BaguaReconciler) SatisfiedExpectations(job *api.Bagua) bool
- func (r *BaguaReconciler) SetClusterSpec(job interface{}, podTemplate *corev1.PodTemplateSpec, rtype, index string) error
- func (r *BaguaReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *BaguaReconciler) UpdateJobStatus(j interface{}, replicas map[commonv1.ReplicaType]*commonv1.ReplicaSpec, ...) error
- func (r *BaguaReconciler) UpdateJobStatusInApiServer(job interface{}, jobStatus *commonv1.JobStatus) error
Constants ¶
const ( FailedDeleteJobReason = "FailedDeleteJob" SuccessfulDeleteJobReason = "SuccessfulDeleteJob" JobPhaseTransitionReason = "JobPhaseTransition" )
Variables ¶
This section is empty.
Functions ¶
func GetPodDomainName ¶
GetPodDomainName
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 (*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 ¶
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