package identifiers

import "github.com/google/cadvisor/container/containerd/identifiers"

Package identifiers provides common validation for identifiers and keys across containerd.

Identifiers in containerd must be a alphanumeric, allowing limited underscores, dashes and dots.

While the character set may be expanded in the future, identifiers are guaranteed to be safely used as filesystem path components.

Index

Functions

func Validate

func Validate(s string) error

Validate returns nil if the string s is a valid identifier.

identifiers are similar to the domain name rules according to RFC 1035, section 2.3.1. However rules in this package are relaxed to allow numerals to follow period (".") and mixed case is allowed.

In general identifiers that pass this validation should be safe for use as filesystem path components.

Source Files

validate.go

Version
v0.52.1 (latest)
Published
Mar 5, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
3 days ago

Tools for package owners.