Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ConditionTypeAlwaysTrue is a special condition type whose status is always "True" ConditionTypeAlwaysTrue = "stormforge.io/always-true" // ConditionTypePodReady is a special condition type whose status is determined by fetching the pods associated // with the target object and checking that they all have a condition type of "Ready" with a status of "True". ConditionTypePodReady = "stormforge.io/pod-ready" // ConditionTypeRolloutStatus is a special condition type whose status is determined using the equivalent of a // `kubectl rollout status` call on the target object. This condition will return "True" when evaluated against // an object whose "update strategy" is not "RollingUpdate"; use the "app ready" check to perform a rollout // status that falls back to a pod readiness check in cases where the rollout status cannot be determined. ConditionTypeRolloutStatus = "stormforge.io/rollout-status" // ConditionTypeAppReady is a special condition type that combines the efficiency of the rollout status check, // the compatibility of the pod ready check. ConditionTypeAppReady = "stormforge.io/app-ready" // ConditionTypeStatus is a special condition type that can be used to check an arbitrary string on the status // of the target object. The name of the status field and the expected value (indicating a ready state) should // be appended to this constant, e.g. `"stormforge.io/status-phase-running"` to check for a running pod. ConditionTypeStatus = "stormforge.io/status-" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReadinessChecker ¶
type ReadinessChecker struct { // Reader is used to fetch information about objects related to the object whose conditions are being checked Reader client.Reader }
ReadinessChecker is used to check the conditions of runtime objects
func (*ReadinessChecker) CheckConditions ¶
func (r *ReadinessChecker) CheckConditions(ctx context.Context, obj *unstructured.Unstructured, conditionTypes []string) (string, bool, error)
CheckConditions checks to see that all of the listed conditions have a status of true on the specified object. Note that in addition to generically checking in the `status.conditions` field, special conditions are also supported. The special conditions are prefixed with "stormforge.io/".
type ReadinessError ¶
type ReadinessError struct { // Reason is a code indicating the reason why a readiness check failed Reason string // Message is a more detailed message indicating the nature of the failure Message string // contains filtered or unexported fields }
ReadinessError is an error that occurs while testing for readiness, it indicates a "hard failure" and is not just an indicator that something is not ready (i.e. it is an unrecoverable state and will never be "ready").
Click to show internal directories.
Click to hide internal directories.