MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / ListFiles

Function ListFiles

tests/utils/objectstore/objectstore.go:655–666  ·  view source on GitHub ↗

ListFiles uses the client pod to list the paths matching the given `path`

(storeEnv *Env, path string)

Source from the content-addressed store, hash-verified

653
654// ListFiles uses the client pod to list the paths matching the given `path`
655func ListFiles(storeEnv *Env, path string) (string, error) {
656 var stdout string
657 stdout, _, err := run.Unchecked(fmt.Sprintf(
658 "kubectl exec -n %v %v -- %v",
659 storeEnv.Namespace,
660 storeEnv.ClientPodRef(),
661 composeListFiles(path)))
662 if err != nil {
663 return "", err
664 }
665 return strings.Trim(stdout, "\n"), nil
666}
667
668// globToRegexp converts a path glob, where `*` matches any sequence of
669// characters including `/`, into an anchored extended regular expression

Callers 1

Calls 3

UncheckedFunction · 0.92
composeListFilesFunction · 0.85
ClientPodRefMethod · 0.80

Tested by 1