MCPcopy
hub / github.com/kubernetes/client-go / ResolvePaths

Function ResolvePaths

tools/clientcmd/loader.go:571–582  ·  view source on GitHub ↗

ResolvePaths updates the given refs to be absolute paths, relative to the given base directory

(refs []*string, base string)

Source from the content-addressed store, hash-verified

569
570// ResolvePaths updates the given refs to be absolute paths, relative to the given base directory
571func ResolvePaths(refs []*string, base string) error {
572 for _, ref := range refs {
573 // Don't resolve empty paths
574 if len(*ref) > 0 {
575 // Don't resolve absolute paths
576 if !filepath.IsAbs(*ref) {
577 *ref = filepath.Join(base, *ref)
578 }
579 }
580 }
581 return nil
582}
583
584// RelativizePathWithNoBacksteps updates the given refs to be relative paths, relative to the given base directory as long as they do not require backsteps.
585// Any path requiring a backstep is left as-is as long it is absolute. Any non-absolute path that can't be relativized produces an error

Callers 4

ResolveLocalPathsFunction · 0.85
ResolveConfigPathsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected