Documentation
¶
Overview ¶
Package resourceclaim provides code that supports the usual pattern for accessing the ResourceClaim that is referenced by a PodResourceClaim:
- determine the ResourceClaim name that corresponds to the PodResourceClaim - retrieve the ResourceClaim - verify that the ResourceClaim is owned by the pod if generated from a template - use the ResourceClaim
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanBeReserved ¶
func CanBeReserved(claim *resourcev1alpha2.ResourceClaim) bool
CanBeReserved checks whether the claim could be reserved for another object.
func IsForPod ¶
func IsForPod(pod *v1.Pod, claim *resourcev1alpha2.ResourceClaim) error
IsForPod checks that the ResourceClaim is the ephemeral volume that was created for the Pod. It returns an error that is informative enough to be returned by the caller without adding further details about the Pod or ResourceClaim.
func IsReservedForPod ¶
func IsReservedForPod(pod *v1.Pod, claim *resourcev1alpha2.ResourceClaim) bool
IsReservedForPod checks whether a claim lists the pod as one of the objects that the claim was reserved for.
func Name ¶
func Name(pod *v1.Pod, podClaim *v1.PodResourceClaim) string
Name returns the name of the ResourceClaim object that gets referenced by or created for the PodResourceClaim. The name is deterministic and therefore this function does not need any additional information and it will never fail.
Either podClaim.ResourceClaimName or podClaim.Template must be non-nil, but not both. This is enforced by API validation.
If podClaim.Template is not nil, the caller must check that the ResourceClaim is indeed the one that was created for the Pod by calling IsUsable.
Types ¶
This section is empty.