Documentation ¶
Index ¶
- Constants
- Variables
- func CombineLabelSelectors(ls ...labels.Selector) labels.Selector
- func DumpJSON(o interface{}) string
- func GetCertDir() string
- func GetCertWriter() string
- func GetContainerEnvVar(container *v1.Container, key string) *v1.EnvVar
- func GetHost() string
- func GetMD5Hash(text string) string
- func GetNamespace() string
- 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 GetPort() int
- func GetSecretName() string
- func GetServiceName() string
- func HttpToAPIError(code int, verb, serverMessage string) *metav1.Status
- func Init() error
- func InitFlags(flagset *flag.FlagSet)
- func IsHashChangedError(err error) bool
- func IsPodActive(p *v1.Pod) bool
- func IsPodReady(pod *v1.Pod) bool
- func IsPodReadyConditionTrue(status v1.PodStatus) bool
- func Key(namespace, name string) string
- func KeyFunc(obj metav1.Object) string
- func LastReplace(s, old, new string) string
- func MergeLabelSelector(selA, selB *metav1.LabelSelector) *metav1.LabelSelector
- func NegateLabelSelector(sel *metav1.LabelSelector) *metav1.LabelSelector
- func NewClientFromManager(mgr manager.Manager, name string) client.Client
- func NewDirectorClientFromManager(mgr manager.Manager, name string) client.Client
- func SlowStartBatch(count int, initialBatchSize int, shortCircuit bool, fn func(int, error) error, ...) (int, error)
- func ValidatedLabelSelectorAsSelector(ps *metav1.LabelSelector) (labels.Selector, error)
- type HashChangedError
Constants ¶
const (
SlowStartInitialBatchSize = 1
)
Variables ¶
Functions ¶
func GetCertDir ¶
func GetCertDir() string
func GetCertWriter ¶
func GetCertWriter() string
func GetMD5Hash ¶
func GetNamespace ¶
func GetNamespace() string
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 GetSecretName ¶
func GetSecretName() string
func GetServiceName ¶
func GetServiceName() string
func HttpToAPIError ¶ added in v0.2.0
HttpToAPIError convert http error to kubernetes api error
func IsHashChangedError ¶
func IsPodActive ¶
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 LastReplace ¶
func MergeLabelSelector ¶
func MergeLabelSelector(selA, selB *metav1.LabelSelector) *metav1.LabelSelector
func NegateLabelSelector ¶
func NegateLabelSelector(sel *metav1.LabelSelector) *metav1.LabelSelector
func NewClientFromManager ¶
func SlowStartBatch ¶
func SlowStartBatch(count int, initialBatchSize int, shortCircuit bool, fn func(int, error) error, maxBatchSize int) (int, error)
SlowStartBatch tries to call the provided function a total of 'count' times, starting slow to check for errors, then speeding up if calls succeed.
It groups the calls into batches, starting with a group of initialBatchSize. Within each batch, it may call the function multiple times concurrently.
If a whole batch succeeds, the next batch may get exponentially larger. If there are any failures in a batch, all remaining batches are skipped after waiting for the current batch to complete.
It returns the number of successful calls to the function.
func ValidatedLabelSelectorAsSelector ¶
func ValidatedLabelSelectorAsSelector(ps *metav1.LabelSelector) (labels.Selector, error)
Types ¶
type HashChangedError ¶
type HashChangedError struct {
// contains filtered or unexported fields
}
func (HashChangedError) Error ¶
func (e HashChangedError) Error() string
func (HashChangedError) String ¶
func (e HashChangedError) String() string