Documentation ¶
Index ¶
- func CheckDaemonSet(ds *appsv1.DaemonSet) error
- func CheckDeployment(dp *appsv1.Deployment) error
- func CheckPod(pod *corev1.Pod) error
- func CheckReplicaSet(rs *appsv1.ReplicaSet) error
- func CheckReplicationController(rc *corev1.ReplicationController) error
- func CheckStatefulSet(sts *appsv1.StatefulSet) error
- func IsObjectReady(ctx context.Context, kubeClient client.Client, obj *unstructured.Unstructured, ...) error
- func IsRecoverableError(err error) bool
- func IsRelevantForDefaultReadinessCheck(groupKind schema.GroupKind) bool
- func WaitForObjectsReady(ctx context.Context, timeout time.Duration, kubeClient client.Client, ...) error
- type CustomReadinessCheck
- type DefaultReadinessCheck
- type ObjectNotReadyError
- type ObjectsToWatchFunc
- type RecoverableError
- type StatusType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDaemonSet ¶
CheckDaemonSet checks whether the given DaemonSet is ready. A DaemonSet is considered ready if its controller observed its current revision and if its desired number of scheduled pods is equal to its updated number of scheduled pods.
func CheckDeployment ¶
func CheckDeployment(dp *appsv1.Deployment) error
CheckDeployment checks whether the given Deployment is ready.
func CheckPod ¶
CheckPod checks whether the given Pod is ready. A Pod is considered ready if it successfully completed or if it has the the PodReady condition set to true.
func CheckReplicaSet ¶
func CheckReplicaSet(rs *appsv1.ReplicaSet) error
CheckReplicaSet checks whether the given ReplicaSet is ready. A ReplicaSet is considered ready if its controller observed its current revision and if the number of updated replicas is equal to the number of replicas.
func CheckReplicationController ¶
func CheckReplicationController(rc *corev1.ReplicationController) error
CheckReplicationController checks whether the given ReplicationController is ready. A ReplicationController is considered ready if its controller observed its current revision and if the number of updated replicas is equal to the number of replicas.
func CheckStatefulSet ¶
func CheckStatefulSet(sts *appsv1.StatefulSet) error
CheckStatefulSet checks whether the given StatefulSet is ready. A StatefulSet is considered ready if its controller observed its current revision, it is not in an update (i.e. UpdateRevision is empty) and if its current replicas are equal to its desired replicas.
func IsObjectReady ¶
func IsObjectReady(ctx context.Context, kubeClient client.Client, obj *unstructured.Unstructured, checkObject checkObjectFunc) error
IsObjectReady gets an updated version of an object and checks if it is ready.
func IsRecoverableError ¶
func WaitForObjectsReady ¶
func WaitForObjectsReady(ctx context.Context, timeout time.Duration, kubeClient client.Client, getObjects ObjectsToWatchFunc, fn checkObjectFunc, interruptionChecker interruption.InterruptionChecker, operation string) error
WaitForObjectsReady waits for objects to be heatlhy and returns an error if all the objects are not ready after the timeout.
Types ¶
type CustomReadinessCheck ¶
type CustomReadinessCheck struct { Client client.Client CurrentOp string Timeout *lsv1alpha1.Duration ManagedResources []lsv1alpha1.TypedObjectReference Configuration health.CustomReadinessCheckConfiguration InterruptionChecker interruption.InterruptionChecker LsClient client.Client DeployItem *lsv1alpha1.DeployItem }
CustomReadinessCheck contains all the data and methods required to kick off a custom readiness check
func (*CustomReadinessCheck) CheckObject ¶
func (c *CustomReadinessCheck) CheckObject(u *unstructured.Unstructured) error
CheckObject checks the readiness of an object and returns an error if the object is considered unready
func (*CustomReadinessCheck) CheckResourcesReady ¶
func (c *CustomReadinessCheck) CheckResourcesReady(ctx context.Context) error
CheckResourcesReady starts a custom readiness check by checking the readiness of the submitted resources
type DefaultReadinessCheck ¶
type DefaultReadinessCheck struct { Context context.Context Client client.Client CurrentOp string Timeout *lsv1alpha1.Duration ManagedResources []lsv1alpha1.TypedObjectReference FailOnMissingObject bool InterruptionChecker interruption.InterruptionChecker }
DefaultReadinessCheck contains all the data and methods required to kick off a default readiness check
func (*DefaultReadinessCheck) CheckObject ¶
func (d *DefaultReadinessCheck) CheckObject(u *unstructured.Unstructured) error
DefaultCheckObject checks if the object is ready and returns an error otherwise. A non-managed object returns nil.
func (*DefaultReadinessCheck) CheckResourcesReady ¶
func (d *DefaultReadinessCheck) CheckResourcesReady() error
CheckResourcesReady implements the default readiness check for Kubernetes manifests
type ObjectNotReadyError ¶
type ObjectNotReadyError struct {
// contains filtered or unexported fields
}
ObjectNotReadyError holds information about an unready object and implements the go error interface. This is a subtype of RecoverableError.
func NewObjectNotReadyError ¶
func NewObjectNotReadyError(u *unstructured.Unstructured, err error) *ObjectNotReadyError
func (*ObjectNotReadyError) Error ¶
func (e *ObjectNotReadyError) Error() string
Error implements the go error interface.
type ObjectsToWatchFunc ¶
type ObjectsToWatchFunc func() ([]*unstructured.Unstructured, error)
type RecoverableError ¶
type RecoverableError struct {
// contains filtered or unexported fields
}
RecoverableError defines an error that occurs during the readiness check, but is recoverable. Means, the error could be sporadic and therefore the readiness check is not interrupted.
func NewRecoverableError ¶
func NewRecoverableError(err error) *RecoverableError
func (*RecoverableError) Error ¶
func (e *RecoverableError) Error() string
Error implements the go error interface.
type StatusType ¶
type StatusType string
StatusType defines the value of a Status.
const ( StatusReady StatusType = "Ready" StatusNotReady StatusType = "NotReady" StatusUnknown StatusType = "Unknown" )