Documentation
¶
Overview ¶
Package names defines facilities to work with Kubernetes names
It lets clients validate, transform and process names that can be used in Kubernetes. An example of such transformations would be transforming an Instance ID to a slug. A slug is a human-readable, friendly representation of the full instance ID which is also designed to be compatible with Kubernetes conventions for resource names.
Index ¶
- Variables
- func GetNamespaceLessSlug(slug, namespace string) (string, error)
- func ImageInfoToSlug(image, imageHash string) (string, error)
- func InstanceIDToSlug(name, namespace, kind, hashedID string) (string, error)
- func IsValidDNSLabelName(s string) bool
- func IsValidDNSSubdomainName(s string) bool
- func IsValidSlug(s string) bool
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidSlug = errors.New("Current inputs produce an invalid slug")
)
Functions ¶
func GetNamespaceLessSlug ¶ added in v0.0.139
func ImageInfoToSlug ¶
ImageInfoToSlug returns a human-friendly representation for a given image information
If the given inputs would produce an invalid slug, it returns an appropriate error
func InstanceIDToSlug ¶
InstanceIDToSlug retuns a human-friendly representation given a description of an instance ID
If the given inputs would produce an invalid slug, it returns an appropriate error
func IsValidDNSLabelName ¶
IsValidDNSLabelName returns true if a given string is a valid DNS label name as defined in the Kubernetes docs
func IsValidDNSSubdomainName ¶
IsValidDNSSubdomainName returns true if a given string is a valid DNS Subdomain name as defined in the Kubernetes docs
func IsValidSlug ¶
IsValidSlug returns true if a given string is a valid slug, else false
A string is considered a valid slug if it can be used as a name of a Kubernetes resource
Types ¶
This section is empty.