Documentation ¶
Index ¶
- Constants
- func Setup(mgr ctrl.Manager, args controller.Args, l logging.Logger) error
- type HealthStatus
- type Reconciler
- type ReconcilerOption
- type ScopeHealthCondition
- type WorkloadHealthCheckFn
- type WorkloadHealthCondition
- func CheckByHealthCheckTrait(ctx context.Context, c client.Client, wlRef runtimev1alpha1.TypedReference, ...) *WorkloadHealthCondition
- func CheckContainerziedWorkloadHealth(ctx context.Context, c client.Client, ref runtimev1alpha1.TypedReference, ...) *WorkloadHealthCondition
- func CheckDaemonsetHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, ...) *WorkloadHealthCondition
- func CheckDeploymentHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, ...) *WorkloadHealthCondition
- func CheckPodSpecWorkloadHealth(ctx context.Context, c client.Client, ref runtimev1alpha1.TypedReference, ...) *WorkloadHealthCondition
- func CheckStatefulsetHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, ...) *WorkloadHealthCondition
- func CheckUnknownWorkload(ctx context.Context, c client.Client, wlRef runtimev1alpha1.TypedReference, ...) *WorkloadHealthCondition
- type WorloadHealthChecker
Constants ¶
const ( // StatusHealthy represents healthy status. StatusHealthy = v1alpha2.StatusHealthy // StatusUnhealthy represents unhealthy status. StatusUnhealthy = v1alpha2.StatusUnhealthy // StatusUnknown represents unknown status. StatusUnknown = v1alpha2.StatusUnknown )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HealthStatus ¶ added in v0.2.0
type HealthStatus = v1alpha2.HealthStatus
HealthStatus represents health status strings.
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) (ScopeHealthCondition, []*WorkloadHealthCondition)
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.
func WithTraitChecker ¶ added in v0.2.0
func WithTraitChecker(c WorloadHealthChecker) ReconcilerOption
WithTraitChecker adds health checker based on HealthCheckTrait
type ScopeHealthCondition ¶ added in v0.2.0
type ScopeHealthCondition = v1alpha2.ScopeHealthCondition
ScopeHealthCondition holds health condition of a scope
type WorkloadHealthCheckFn ¶ added in v0.1.0
type WorkloadHealthCheckFn func(context.Context, client.Client, runtimev1alpha1.TypedReference, string) *WorkloadHealthCondition
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) *WorkloadHealthCondition
Check the health status of specified resource
type WorkloadHealthCondition ¶ added in v0.2.0
type WorkloadHealthCondition = v1alpha2.WorkloadHealthCondition
WorkloadHealthCondition holds health status of any resource
func CheckByHealthCheckTrait ¶ added in v0.2.0
func CheckByHealthCheckTrait(ctx context.Context, c client.Client, wlRef runtimev1alpha1.TypedReference, ns string) *WorkloadHealthCondition
CheckByHealthCheckTrait checks health condition through HealthCheckTrait.
func CheckContainerziedWorkloadHealth ¶ added in v0.1.0
func CheckContainerziedWorkloadHealth(ctx context.Context, c client.Client, ref runtimev1alpha1.TypedReference, namespace string) *WorkloadHealthCondition
CheckContainerziedWorkloadHealth check health condition of ContainerizedWorkload
func CheckDaemonsetHealth ¶ added in v0.1.0
func CheckDaemonsetHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, namespace string) *WorkloadHealthCondition
CheckDaemonsetHealth checks health condition of DaemonSet
func CheckDeploymentHealth ¶ added in v0.1.0
func CheckDeploymentHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, namespace string) *WorkloadHealthCondition
CheckDeploymentHealth checks health condition of Deployment
func CheckPodSpecWorkloadHealth ¶ added in v0.3.0
func CheckPodSpecWorkloadHealth(ctx context.Context, c client.Client, ref runtimev1alpha1.TypedReference, namespace string) *WorkloadHealthCondition
CheckPodSpecWorkloadHealth check health condition of podspecworkloads.standard.oam.dev
func CheckStatefulsetHealth ¶ added in v0.1.0
func CheckStatefulsetHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, namespace string) *WorkloadHealthCondition
CheckStatefulsetHealth checks health condition of StatefulSet
func CheckUnknownWorkload ¶ added in v0.2.0
func CheckUnknownWorkload(ctx context.Context, c client.Client, wlRef runtimev1alpha1.TypedReference, ns string) *WorkloadHealthCondition
CheckUnknownWorkload handles unknown type workloads.
type WorloadHealthChecker ¶ added in v0.1.0
type WorloadHealthChecker interface {
Check(context.Context, client.Client, runtimev1alpha1.TypedReference, string) *WorkloadHealthCondition
}
A WorloadHealthChecker checks health status of specified resource and saves status into an HealthCondition object.