Documentation ¶
Index ¶
- func CheckDuplicate(list []string) []string
- func DumpJSON(o interface{}) string
- func GetContainer(name string, pod *v1.Pod) *v1.Container
- func GetContainerEnvValue(container *v1.Container, key string) string
- func GetContainerEnvVar(container *v1.Container, key string) *v1.EnvVar
- func GetContainerVolumeMount(container *v1.Container, key string) *v1.VolumeMount
- func GetFastLabelSelector(ps *metav1.LabelSelector) (labels.Selector, error)
- func GetIntOrStrPointer(i intstrutil.IntOrString) *intstrutil.IntOrString
- func GetPodNames(pods []*v1.Pod) sets.String
- func GetPodVolume(pod *v1.Pod, volumeName string) *v1.Volume
- func IsContainerImageEqual(image1, image2 string) bool
- func IsImageDigest(image string) bool
- func IsJSONEqual(o1, o2 interface{}) bool
- func IsPodContainerDigestEqual(containers sets.String, pod *v1.Pod) bool
- func IsRunningAndReady(pod *v1.Pod) bool
- func IsSelectorOverlapping(selector1, selector2 *metav1.LabelSelector) bool
- func MergeEnvVar(original []v1.EnvVar, additional []v1.EnvVar) []v1.EnvVar
- func MergePods(pods1, pods2 []*v1.Pod) []*v1.Pod
- func MergeVolumeMounts(original, additional []v1.VolumeMount) []v1.VolumeMount
- func MergeVolumeMountsInContainer(origin *v1.Container, other v1.Container)
- func MergeVolumes(original []v1.Volume, additional []v1.Volume) []v1.Volume
- func NewClientFromManager(mgr manager.Manager, name string) client.Client
- func ParseImage(image string) (repo, tag, digest string, err error)
- func SlowStartBatch(count int, initialBatchSize int, fn func(index int) error) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDuplicate ¶ added in v0.3.1
CheckDuplicate finds if there are duplicated items in a list.
func GetContainerEnvValue ¶ added in v0.8.0
func GetContainerEnvVar ¶ added in v0.8.0
func GetContainerVolumeMount ¶ added in v0.8.0
func GetContainerVolumeMount(container *v1.Container, key string) *v1.VolumeMount
func GetFastLabelSelector ¶ added in v0.8.0
func GetFastLabelSelector(ps *metav1.LabelSelector) (labels.Selector, error)
func GetIntOrStrPointer ¶ added in v0.7.0
func GetIntOrStrPointer(i intstrutil.IntOrString) *intstrutil.IntOrString
func GetPodNames ¶ added in v0.6.1
GetPodNames returns names of the given Pods array
func IsContainerImageEqual ¶ added in v0.8.0
1. image1, image2 are digest image, compare repo+digest 2. image1, image2 are normal image, compare repo+tag 3. image1, image2 are digest+normal image, don't support compare it, return false
func IsImageDigest ¶ added in v0.8.0
whether image is digest format, for example: docker.io/busybox@sha256:a9286defaba7b3a519d585ba0e37d0b2cbee74ebfe590960b0b1d6a5e97d1e1d
func IsJSONEqual ¶ added in v0.8.0
func IsJSONEqual(o1, o2 interface{}) bool
IsJSONEqual checks if two objects are equal after encoding json
func IsPodContainerDigestEqual ¶ added in v0.8.0
func IsRunningAndReady ¶ added in v0.8.0
func IsSelectorOverlapping ¶ added in v0.8.0
func IsSelectorOverlapping(selector1, selector2 *metav1.LabelSelector) bool
whether selector overlaps, the criteria: if exist one same key has different value and not overlap, then it is judged non-overlap, for examples:
- a=b and a=c
- a in [b,c] and a not in [b,c...]
- a not in [b] and a not exist
- a=b,c=d,e=f and a=x,c=d,e=f
then others is overlap:
- a=b and c=d
func MergeEnvVar ¶ added in v0.8.0
func MergeVolumeMounts ¶ added in v0.8.0
func MergeVolumeMounts(original, additional []v1.VolumeMount) []v1.VolumeMount
func MergeVolumeMountsInContainer ¶ added in v0.8.0
func MergeVolumes ¶ added in v0.8.0
func NewClientFromManager ¶ added in v0.8.0
func ParseImage ¶ added in v0.8.0
parse container images, 1. docker.io/busybox@sha256:a9286defaba7b3a519d585ba0e37d0b2cbee74ebfe590960b0b1d6a5e97d1e1d repo=docker.io/busybox, tag="", digest=sha256:a9286defaba7b3a519d585ba0e37d0b2cbee74ebfe590960b0b1d6a5e97d1e1d 2. docker.io/busybox:latest repo=docker.io/busybox, tag=latest, digest=""
func SlowStartBatch ¶ added in v0.3.0
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 with its index.
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.
Types ¶
This section is empty.