resources

package
v0.0.0-...-44f2bf6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyContainerResource

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 EnvId

func EnvId(in []core.EnvVar, 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

func GetAnyContainerByName(containers []core.Container, name string) (core.Container, bool)

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

func GetContainerByName(p *core.Pod, name string) (core.Container, bool)

GetContainerByName returns the container in the given pod with the given name. Returns false if not found.

func GetContainerIDByName

func GetContainerIDByName(containers []core.Container, name string) int

GetContainerIDByName returns the container id in the given list with the given name. Returns -1 if not found.

func GetContainerStatusByName

func GetContainerStatusByName(p *core.Pod, name string) (core.ContainerStatus, bool)

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 Merge

func Merge(a, b *core.Affinity) *core.Affinity

func MergeContainerPorts

func MergeContainerPorts(in []core.ContainerPort, envs ...core.ContainerPort) []core.ContainerPort

func MergeContainerResource

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 MergeEnvs

func MergeEnvs(in []core.EnvVar, envs ...core.EnvVar) []core.EnvVar

func MergeLifecycle

func MergeLifecycle(a, b *core.Lifecycle) *core.Lifecycle

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 MergeProbes

func MergeProbes(a, b *core.Probe) *core.Probe

func MergeVolumeMounts

func MergeVolumeMounts(in []core.VolumeMount, envs ...core.VolumeMount) []core.VolumeMount

func MergeVolumes

func MergeVolumes(in []core.Volume, envs ...core.Volume) []core.Volume

func Optional

func Optional(a *core.Affinity) *core.Affinity

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

func VolumeID

func VolumeID(in []core.Volume, name string) int

Types

type AccessRequest

type AccessRequest struct {
	Verb, Group, Version, Resource, SubResource, Name, Namespace string
}

func (AccessRequest) String

func (a AccessRequest) String() string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL