utils

package
v0.43.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSortedSet

func NewSortedSet() *sortedSet

func ValidateConfigMapKey

func ValidateConfigMapKey(key string) error

ValidateConfigMapKey validatest that the input ConfigMap key is valid. It must must consist of alphabetic characters, digits, '_', '-', or '.', regex used for validation is '[-._a-zA-Z0-9]+'

func ValidateEnvVarName

func ValidateEnvVarName(name string) error

ValidateEnvVarName validatest that the input name is a valid Kubernetes Environment Variable name. It must must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*'

func ValidateFunctionName

func ValidateFunctionName(name string) error

ValidateFunctionName validates that the input name is a valid function name, ie. valid DNS-1035 label. It must consist of lower case alphanumeric characters or '-' and start with an alphabetic character and end with an alphanumeric character. (e.g. 'my-name', or 'abc-1', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')

func ValidateLabelKey

func ValidateLabelKey(key string) error

ValidateLabelKey validates that the input name is a valid Kubernetes key. Valid label names have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/).

func ValidateLabelValue

func ValidateLabelValue(value string) error

ValidateLabelValue ensures that the input is a Kubernetes label value Valid label values must be 63 characters or less (can be empty), unless empty, must begin and end with an alphanumeric character ([a-z0-9A-Z]), could contain dashes (-), underscores (_), dots (.), and alphanumerics between. Label values may also come from the environment and therefore, could be enclosed with {{}} Treat this as a special case.

func ValidateSecretKey

func ValidateSecretKey(key string) error

ValidateSecretKey validatest that the input Secret key is valid. It must must consist of alphabetic characters, digits, '_', '-', or '.', regex used for validation is '[-._a-zA-Z0-9]+'

Types

type ErrInvalidConfigMapKey

type ErrInvalidConfigMapKey error

ErrInvalidConfigMapKey indicates the key specified for ConfigMap did not pass validation.

type ErrInvalidEnvVarName

type ErrInvalidEnvVarName error

ErrInvalidEnvVarName indicates the name did not pass env var name validation.

type ErrInvalidFunctionName

type ErrInvalidFunctionName error

ErrInvalidName indicates the name did not pass function name validation.

type ErrInvalidLabel

type ErrInvalidLabel error

ErrInvalidLabel indicates the name did not pass label key validation, or the value did not pass label value validation.

type ErrInvalidSecretKey

type ErrInvalidSecretKey error

ErrInvalidSecretKey indicates the key specified for ConfigMap did not pass validation.

Jump to

Keyboard shortcuts

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