Documentation ¶
Index ¶
- Variables
- func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
- func GetZdbForPod(c client.Client, logger logr.Logger, pod *v1.Pod) (*opsv1.ZoneDisruptionBudget, error)
- func IsPodReady(pod *v1.Pod) bool
- func IsPodReadyConditionTrue(status v1.PodStatus) bool
- func IsRunningAndReady(pod *v1.Pod) bool
- func IsTerminating(pod *v1.Pod) bool
- type AlarmStateProvider
- type CloudWatchAPI
- type CloudWatchAlarmStateProvider
- type ControllerAndScale
- type Pair
- type PairList
- type PodControllerFinder
Constants ¶
This section is empty.
Variables ¶
var (
ControllerKindSS = apps.SchemeGroupVersion.WithKind("StatefulSet")
)
Functions ¶
func GetPodCondition ¶
func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.
func GetPodConditionFromList ¶
func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)
GetPodConditionFromList extracts the provided condition from the given list of condition and returns the index of the condition and the condition. Returns -1 and nil if the condition is not present.
func GetPodReadyCondition ¶
func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
GetPodReadyCondition extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.
func GetZdbForPod ¶
func IsPodReady ¶
IsPodReady returns true if a pod is ready; false otherwise.
func IsPodReadyConditionTrue ¶
IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.
func IsRunningAndReady ¶
func IsTerminating ¶
Types ¶
type AlarmStateProvider ¶
type CloudWatchAPI ¶
type CloudWatchAPI interface {
DescribeAlarms(ctx context.Context, params *cloudwatch.DescribeAlarmsInput, optFns ...func(*cloudwatch.Options)) (*cloudwatch.DescribeAlarmsOutput, error)
}
type CloudWatchAlarmStateProvider ¶
type CloudWatchAlarmStateProvider struct {
Client CloudWatchAPI
}
func (*CloudWatchAlarmStateProvider) AlarmState ¶
func (p *CloudWatchAlarmStateProvider) AlarmState(ctx context.Context, alarmName string) (types.StateValue, error)
type ControllerAndScale ¶
ControllerAndScale is used to return (controller, scale) pairs from the controller finder functions.
type PairList ¶
type PairList []Pair
type PodControllerFinder ¶
type PodControllerFinder func(client client.Client, controllerRef *metav1.OwnerReference, namespace string) (*ControllerAndScale, error)
PodControllerFinder is a function type that maps a pod to a list of controllers and their scale.
func Finders ¶
func Finders() []PodControllerFinder
Only StatefulSets are supported for now!! TODO Implement finders of other controler types (e.g Deployment, ReplicaSet)