Documentation ¶
Index ¶
- Constants
- Variables
- func GetPodUnavailableBudgetForPod(kClient client.Client, finders *controllerfinder.ControllerFinder, ...) (*policyv1alpha1.PodUnavailableBudget, error)
- func PodUnavailableBudgetValidatePod(client client.Client, pod *corev1.Pod, control PubControl, operation Operation, ...) (allowed bool, reason string, err error)
- type Operation
- type PubControl
Constants ¶
View Source
const (
MaxUnavailablePodSize = 2000
)
View Source
const (
UpdateOperation = "UPDATE"
)
Variables ¶
View Source
var ConflictRetry = wait.Backoff{ Steps: 4, Duration: 500 * time.Millisecond, Factor: 1.0, Jitter: 0.1, }
Functions ¶
func GetPodUnavailableBudgetForPod ¶
func GetPodUnavailableBudgetForPod(kClient client.Client, finders *controllerfinder.ControllerFinder, pod *corev1.Pod) (*policyv1alpha1.PodUnavailableBudget, error)
func PodUnavailableBudgetValidatePod ¶
func PodUnavailableBudgetValidatePod(client client.Client, pod *corev1.Pod, control PubControl, operation Operation, dryRun bool) (allowed bool, reason string, err error)
parameters: 1. allowed(bool) indicates whether to allow this update operation 2. err(error)
Types ¶
type PubControl ¶
type PubControl interface { // get PodUnavailableBudget GetPodUnavailableBudget() *policyv1alpha1.PodUnavailableBudget // IsPodReady indicates whether pod is fully ready // 1. pod.Status.Phase == v1.PodRunning // 2. pod.condition PodReady == true IsPodReady(pod *corev1.Pod) bool // IsPodStateConsistent indicates whether pod.spec and pod.status are consistent after updating containers IsPodStateConsistent(pod *corev1.Pod) bool // determine if this change to pod might cause unavailability IsPodUnavailableChanged(oldPod, newPod *corev1.Pod) bool }
func NewPubControl ¶
func NewPubControl(pub *policyv1alpha1.PodUnavailableBudget) PubControl
Click to show internal directories.
Click to hide internal directories.