naming

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// MaxK8sNameLen is the Kubernetes DNS-1123 label limit.
	MaxK8sNameLen = 63

	// MaxWorkloadNameLen is the safe max for TrainJob names,
	// leaving room for JobSet pod suffixes. The longest replicatedJob name
	// is "launcher", giving suffix "-launcher-{N}-{hash}" ~18 chars.
	MaxWorkloadNameLen = 44

	// MaxJobNameLen is the safe max for Job names,
	// leaving room for the "-workload" suffix (9 chars).
	MaxJobNameLen = 35

	// MaxWorkflowNameLen is the safe max for Workflow names,
	// leaving room for "-job" (4 chars) + "-workload" (9 chars) downstream.
	MaxWorkflowNameLen = 31
)

Variables

This section is empty.

Functions

func ExtractHash

func ExtractHash(name string) string

ExtractHash returns the trailing hash from a Truncate'd name. e.g., "gpu-cluster-cert-communic-873b9" → "873b9". If the name has no hash (no hyphen or too short), returns a computed hash.

func Truncate

func Truncate(name string, maxLen int) string

Truncate returns name unchanged if it fits within maxLen. Otherwise, it truncates to (maxLen - 6) characters, strips trailing hyphens, and appends "-{5-char FNV-32a hash}" of the full original name. The result is deterministic: same input always produces the same output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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