package names
import "k8s.io/apiserver/pkg/storage/names"
Index ¶
Constants ¶
const (
MaxGeneratedNameLength = maxNameLength - randomLength
)
Types ¶
type NameGenerator ¶
type NameGenerator interface { // GenerateName generates a valid name from the base name, adding a random suffix to // the base. If base is valid, the returned name must also be valid. The generator is // responsible for knowing the maximum valid name length. GenerateName(base string) string }
NameGenerator generates names for objects. Some backends may have more information available to guide selection of new names and this interface hides those details.
var SimpleNameGenerator NameGenerator = simpleNameGenerator{}
SimpleNameGenerator is a generator that returns the name plus a random suffix of five alphanumerics when a name is requested. The string is guaranteed to not exceed the length of a standard Kubernetes name (63 characters)
Source Files ¶
generate.go
- Version
- v0.33.0 (latest)
- Published
- Apr 23, 2025
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 58 minutes ago –
Tools for package owners.