Documentation ¶
Index ¶
- func ApplyContainerResource(to core.ResourceRequirements, from core.ResourceRequirements) core.ResourceRequirements
- func ApplyContainerResourceList(to core.ResourceList, from core.ResourceList) core.ResourceList
- func ApplyContainerResourceRequirements(container *core.Container, resources core.ResourceRequirements)
- func ContainerPortId(in []core.ContainerPort, name string) int
- func EnvId(in []core.EnvVar, name string) int
- func ExtractPodAcceptedResourceRequirement(resources core.ResourceRequirements) core.ResourceRequirements
- func ExtractPodInitContainerAcceptedResourceRequirement(resources core.ResourceRequirements) core.ResourceRequirements
- func ExtractStorageResourceRequirement(resources core.ResourceRequirements) core.VolumeResourceRequirements
- func GetAnyContainerByName(containers []core.Container, name string) (core.Container, bool)
- func GetAnyContainerStatusByName(containers []core.ContainerStatus, name string) (core.ContainerStatus, bool)
- func GetContainerByName(p *core.Pod, name string) (core.Container, bool)
- func GetContainerIDByName(containers []core.Container, name string) int
- func GetContainerStatusByName(p *core.Pod, name string) (core.ContainerStatus, bool)
- func GetContainerStatusIDByName(containers []core.ContainerStatus, name string) int
- func GetFailedContainerNames(containers []core.ContainerStatus) []string
- func IsContainerFailed(container *core.ContainerStatus) bool
- func IsResourceRequirementsChanged(wanted, given core.ResourceRequirements) bool
- func Merge(a, b *core.Affinity) *core.Affinity
- func MergeContainerPorts(in []core.ContainerPort, envs ...core.ContainerPort) []core.ContainerPort
- func MergeContainerResource(to core.ResourceRequirements, from core.ResourceRequirements) core.ResourceRequirements
- func MergeContainerResourceList(to core.ResourceList, from core.ResourceList) core.ResourceList
- func MergeEnvFrom(in []core.EnvFromSource, envs ...core.EnvFromSource) []core.EnvFromSource
- func MergeEnvs(in []core.EnvVar, envs ...core.EnvVar) []core.EnvVar
- func MergeLifecycle(a, b *core.Lifecycle) *core.Lifecycle
- func MergeLifecycleHandler(a, b *core.LifecycleHandler) *core.LifecycleHandler
- func MergeNodeAffinity(a, b *core.NodeAffinity) *core.NodeAffinity
- func MergeNodeSelector(a, b *core.NodeSelector) *core.NodeSelector
- func MergeOwnerReferences(refs ...[]meta.OwnerReference) []meta.OwnerReference
- func MergePodAffinity(a, b *core.PodAffinity) *core.PodAffinity
- func MergePodAntiAffinity(a, b *core.PodAntiAffinity) *core.PodAntiAffinity
- func MergeProbes(a, b *core.Probe) *core.Probe
- func MergeVolumeMounts(in []core.VolumeMount, envs ...core.VolumeMount) []core.VolumeMount
- func MergeVolumes(in []core.Volume, envs ...core.Volume) []core.Volume
- func Optional(a *core.Affinity) *core.Affinity
- func OptionalNodeAffinity(a *core.NodeAffinity) *core.NodeAffinity
- func OptionalPodAffinity(a *core.PodAffinity) *core.PodAffinity
- func OptionalPodAntiAffinity(a *core.PodAntiAffinity) *core.PodAntiAffinity
- func PodResourceRequirementsInitContainersAcceptedResourceRequirements() []core.ResourceName
- func PodResourceRequirementsPodAcceptedResourceRequirements() []core.ResourceName
- func SelectLabels(selector *meta.LabelSelector, labels map[string]string) bool
- func UpscaleContainerResourceList(to core.ResourceList, from core.ResourceList) core.ResourceList
- func UpscaleContainerResourceRequirements(container *core.Container, resources core.ResourceRequirements)
- func UpscaleOptionalContainerResourceList(to core.ResourceList, from core.ResourceList) core.ResourceList
- func VerifyAccessRequest(ctx context.Context, client kubernetes.Interface, ...) (*authorization.SelfSubjectAccessReview, error)
- func VerifyAccessRequestStatus(ctx context.Context, client kubernetes.Interface, ...) authorization.SubjectAccessReviewStatus
- func VerifyAll(ctx context.Context, client kubernetes.Interface, requests ...AccessRequest) error
- func VolumeID(in []core.Volume, name string) int
- type AccessRequest
- type PodResourceListFilter
- type PodResourceRequirementsFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyContainerResource ¶
func ApplyContainerResource(to core.ResourceRequirements, from core.ResourceRequirements) core.ResourceRequirements
ApplyContainerResource adds non-existing resources from `from` to `to` ResourceList
func ApplyContainerResourceList ¶
func ApplyContainerResourceList(to core.ResourceList, from core.ResourceList) core.ResourceList
ApplyContainerResourceList adds non-existing resources from `from` to `to` ResourceList
func ApplyContainerResourceRequirements ¶
func ApplyContainerResourceRequirements(container *core.Container, resources core.ResourceRequirements)
func ContainerPortId ¶
func ContainerPortId(in []core.ContainerPort, name string) int
func ExtractPodAcceptedResourceRequirement ¶
func ExtractPodAcceptedResourceRequirement(resources core.ResourceRequirements) core.ResourceRequirements
ExtractPodAcceptedResourceRequirement filters resource requirements for Pods.
func ExtractPodInitContainerAcceptedResourceRequirement ¶
func ExtractPodInitContainerAcceptedResourceRequirement(resources core.ResourceRequirements) core.ResourceRequirements
ExtractPodInitContainerAcceptedResourceRequirement filters resource requirements for InitContainers.
func ExtractStorageResourceRequirement ¶
func ExtractStorageResourceRequirement(resources core.ResourceRequirements) core.VolumeResourceRequirements
ExtractStorageResourceRequirement filters resource requirements for Pods.
func GetAnyContainerByName ¶
GetAnyContainerByName returns the container in the given containers with the given name. Returns false if not found.
func GetAnyContainerStatusByName ¶
func GetAnyContainerStatusByName(containers []core.ContainerStatus, name string) (core.ContainerStatus, bool)
GetAnyContainerStatusByName returns the container status in the given ContainerStatus list with the given name. Returns false if not found.
func GetContainerByName ¶
GetContainerByName returns the container in the given pod with the given name. Returns false if not found.
func GetContainerIDByName ¶
GetContainerIDByName returns the container id in the given list with the given name. Returns -1 if not found.
func GetContainerStatusByName ¶
GetContainerStatusByName returns the container status in the given pod with the given name. Returns false if not found.
func GetContainerStatusIDByName ¶
func GetContainerStatusIDByName(containers []core.ContainerStatus, name string) int
GetContainerStatusIDByName returns the container id in the given list with the given name. // Returns -1 if not found.
func GetFailedContainerNames ¶
func GetFailedContainerNames(containers []core.ContainerStatus) []string
GetFailedContainerNames returns list of failed containers from provided list of statuses.
func IsContainerFailed ¶
func IsContainerFailed(container *core.ContainerStatus) bool
IsContainerFailed returns true if the arangodb container has terminated wih a non-zero exit code.
func IsResourceRequirementsChanged ¶
func IsResourceRequirementsChanged(wanted, given core.ResourceRequirements) bool
IsResourceRequirementsChanged returns true if the resource requirements have changed.
func MergeContainerPorts ¶
func MergeContainerPorts(in []core.ContainerPort, envs ...core.ContainerPort) []core.ContainerPort
func MergeContainerResource ¶
func MergeContainerResource(to core.ResourceRequirements, from core.ResourceRequirements) core.ResourceRequirements
MergeContainerResource updates resources from `from` to `to` ResourceList
func MergeContainerResourceList ¶
func MergeContainerResourceList(to core.ResourceList, from core.ResourceList) core.ResourceList
MergeContainerResourceList updates resources from `from` to `to` ResourceList
func MergeEnvFrom ¶
func MergeEnvFrom(in []core.EnvFromSource, envs ...core.EnvFromSource) []core.EnvFromSource
func MergeLifecycleHandler ¶
func MergeLifecycleHandler(a, b *core.LifecycleHandler) *core.LifecycleHandler
func MergeNodeAffinity ¶
func MergeNodeAffinity(a, b *core.NodeAffinity) *core.NodeAffinity
func MergeNodeSelector ¶
func MergeNodeSelector(a, b *core.NodeSelector) *core.NodeSelector
func MergeOwnerReferences ¶
func MergeOwnerReferences(refs ...[]meta.OwnerReference) []meta.OwnerReference
func MergePodAffinity ¶
func MergePodAffinity(a, b *core.PodAffinity) *core.PodAffinity
func MergePodAntiAffinity ¶
func MergePodAntiAffinity(a, b *core.PodAntiAffinity) *core.PodAntiAffinity
func MergeVolumeMounts ¶
func MergeVolumeMounts(in []core.VolumeMount, envs ...core.VolumeMount) []core.VolumeMount
func OptionalNodeAffinity ¶
func OptionalNodeAffinity(a *core.NodeAffinity) *core.NodeAffinity
func OptionalPodAffinity ¶
func OptionalPodAffinity(a *core.PodAffinity) *core.PodAffinity
func OptionalPodAntiAffinity ¶
func OptionalPodAntiAffinity(a *core.PodAntiAffinity) *core.PodAntiAffinity
func PodResourceRequirementsInitContainersAcceptedResourceRequirements ¶
func PodResourceRequirementsInitContainersAcceptedResourceRequirements() []core.ResourceName
PodResourceRequirementsInitContainersAcceptedResourceRequirements returns struct if accepted Pod resource types
func PodResourceRequirementsPodAcceptedResourceRequirements ¶
func PodResourceRequirementsPodAcceptedResourceRequirements() []core.ResourceName
PodResourceRequirementsPodAcceptedResourceRequirements returns struct if accepted Pod resource types
func SelectLabels ¶
func SelectLabels(selector *meta.LabelSelector, labels map[string]string) bool
func UpscaleContainerResourceList ¶
func UpscaleContainerResourceList(to core.ResourceList, from core.ResourceList) core.ResourceList
UpscaleContainerResourceList scales up resources from `from` to `to` ResourceList
func UpscaleContainerResourceRequirements ¶
func UpscaleContainerResourceRequirements(container *core.Container, resources core.ResourceRequirements)
func UpscaleOptionalContainerResourceList ¶
func UpscaleOptionalContainerResourceList(to core.ResourceList, from core.ResourceList) core.ResourceList
UpscaleOptionalContainerResourceList scales up resources from `from` to `to` ResourceList if they exists in `to`
func VerifyAccessRequest ¶
func VerifyAccessRequest(ctx context.Context, client kubernetes.Interface, verb, group, version, resource, subResource, name, namespace string) (*authorization.SelfSubjectAccessReview, error)
func VerifyAccessRequestStatus ¶
func VerifyAccessRequestStatus(ctx context.Context, client kubernetes.Interface, verb, group, version, resource, subResource, name, namespace string) authorization.SubjectAccessReviewStatus
func VerifyAll ¶
func VerifyAll(ctx context.Context, client kubernetes.Interface, requests ...AccessRequest) error
Types ¶
type AccessRequest ¶
type AccessRequest struct {
Verb, Group, Version, Resource, SubResource, Name, Namespace string
}
func (AccessRequest) String ¶
func (a AccessRequest) String() string
func (AccessRequest) Verify ¶
func (a AccessRequest) Verify(ctx context.Context, client kubernetes.Interface) authorization.SubjectAccessReviewStatus
func (AccessRequest) VerifyErr ¶
func (a AccessRequest) VerifyErr(ctx context.Context, client kubernetes.Interface) error
type PodResourceListFilter ¶
type PodResourceListFilter func(in core.ResourceList) core.ResourceList
func NewPodResourceListFilter ¶
func NewPodResourceListFilter(filters ...core.ResourceName) PodResourceListFilter
NewPodResourceListFilter returns function which filter out not accepted resources from list
type PodResourceRequirementsFilter ¶
type PodResourceRequirementsFilter func(in core.ResourceRequirements) core.ResourceRequirements
func NewPodResourceRequirementsFilter ¶
func NewPodResourceRequirementsFilter(filters ...core.ResourceName) PodResourceRequirementsFilter
NewPodResourceRequirementsFilter returns function which filter out not accepted resources from resource requirements