MCPcopy Create free account
hub / github.com/containerd/nerdctl / validateAllPathComponents

Function validateAllPathComponents

pkg/store/filestore.go:340–352  ·  view source on GitHub ↗

validateAllPathComponents will enforce validation for a slice of components

(pathComponent ...string)

Source from the content-addressed store, hash-verified

338
339// validateAllPathComponents will enforce validation for a slice of components
340func validateAllPathComponents(pathComponent ...string) error {
341 if len(pathComponent) == 0 {
342 return errors.Join(ErrInvalidArgument, errors.New("you must specify an identifier"))
343 }
344
345 for _, key := range pathComponent {
346 if err := filesystem.ValidatePathComponent(key); err != nil {
347 return errors.Join(ErrInvalidArgument, err)
348 }
349 }
350
351 return nil
352}
353
354func IsFilesystemSafe(identifier string) error {
355 if err := filesystem.ValidatePathComponent(identifier); err != nil {

Callers 7

GetMethod · 0.85
ExistsMethod · 0.85
SetMethod · 0.85
DeleteMethod · 0.85
LocationMethod · 0.85
GroupEnsureMethod · 0.85
GroupSizeMethod · 0.85

Calls 1

ValidatePathComponentFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…