Documentation
¶
Index ¶
- func Setup(mgr ctrl.Manager, args controller.Args, l logging.Logger) error
- type HealthCondition
- func CheckContainerziedWorkloadHealth(ctx context.Context, c client.Client, ref runtimev1alpha1.TypedReference, ...) *HealthCondition
- func CheckDaemonsetHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, ...) *HealthCondition
- func CheckDeploymentHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, ...) *HealthCondition
- func CheckStatefulsetHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, ...) *HealthCondition
- type Reconciler
- type ReconcilerOption
- type WorkloadHealthCheckFn
- type WorloadHealthChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HealthCondition ¶ added in v0.1.0
type HealthCondition struct {
// Target represents resource being diagnosed
Target runtimev1alpha1.TypedReference `json:"target"`
IsHealthy bool `json:"isHealthy"`
// Diagnosis contains diagnosis info as well as error info
Diagnosis string `json:"diagnosis,omitempty"`
// SubConditions represents health status of its child resources, if exist
SubConditions []*HealthCondition `json:"subConditions,omitempty"`
}
HealthCondition holds health status of any resource
func CheckContainerziedWorkloadHealth ¶ added in v0.1.0
func CheckContainerziedWorkloadHealth(ctx context.Context, c client.Client, ref runtimev1alpha1.TypedReference, namespace string) *HealthCondition
CheckContainerziedWorkloadHealth check health status of ContainerizedWorkload
func CheckDaemonsetHealth ¶ added in v0.1.0
func CheckDaemonsetHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, namespace string) *HealthCondition
CheckDaemonsetHealth checks health status of DaemonSet
func CheckDeploymentHealth ¶ added in v0.1.0
func CheckDeploymentHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, namespace string) *HealthCondition
CheckDeploymentHealth checks health status of Deployment
func CheckStatefulsetHealth ¶ added in v0.1.0
func CheckStatefulsetHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, namespace string) *HealthCondition
CheckStatefulsetHealth checks health status of StatefulSet
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
A Reconciler reconciles OAM Scopes by keeping track of the health status of components.
func NewReconciler ¶
func NewReconciler(m ctrl.Manager, o ...ReconcilerOption) *Reconciler
NewReconciler returns a Reconciler that reconciles HealthScope by keeping track of its healthstatus.
func (*Reconciler) GetScopeHealthStatus ¶ added in v0.1.0
func (r *Reconciler) GetScopeHealthStatus(ctx context.Context, healthScope *v1alpha2.HealthScope) HealthCondition
GetScopeHealthStatus get the status of the healthscope based on workload resources.
type ReconcilerOption ¶
type ReconcilerOption func(*Reconciler)
A ReconcilerOption configures a Reconciler.
func WithChecker ¶ added in v0.1.0
func WithChecker(c WorloadHealthChecker) ReconcilerOption
WithChecker adds workload health checker
func WithLogger ¶
func WithLogger(l logging.Logger) ReconcilerOption
WithLogger specifies how the Reconciler should log messages.
func WithRecorder ¶
func WithRecorder(er event.Recorder) ReconcilerOption
WithRecorder specifies how the Reconciler should record events.
type WorkloadHealthCheckFn ¶ added in v0.1.0
type WorkloadHealthCheckFn func(context.Context, client.Client, runtimev1alpha1.TypedReference, string) *HealthCondition
WorkloadHealthCheckFn checks health status of specified resource and saves status into an HealthCondition object.
func (WorkloadHealthCheckFn) Check ¶ added in v0.1.0
func (fn WorkloadHealthCheckFn) Check(ctx context.Context, c client.Client, tr runtimev1alpha1.TypedReference, ns string) *HealthCondition
Check the health status of specified resource
type WorloadHealthChecker ¶ added in v0.1.0
type WorloadHealthChecker interface {
Check(context.Context, client.Client, runtimev1alpha1.TypedReference, string) *HealthCondition
}
A WorloadHealthChecker checks health status of specified resource and saves status into an HealthCondition object.