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

Function CountFiles

tests/utils/objectstore/objectstore.go:640–652  ·  view source on GitHub ↗

CountFiles uses the client pod to count the amount of files matching the given `path`

(storeEnv *Env, path string)

Source from the content-addressed store, hash-verified

638// CountFiles uses the client pod to count the amount of files matching the
639// given `path`
640func CountFiles(storeEnv *Env, path string) (value int, err error) {
641 var stdout string
642 stdout, _, err = run.Unchecked(fmt.Sprintf(
643 "kubectl exec -n %v %v -- %v",
644 storeEnv.Namespace,
645 storeEnv.ClientPodRef(),
646 composeFindCmd(path)))
647 if err != nil {
648 return -1, err
649 }
650 value, err = strconv.Atoi(strings.TrimSpace(stdout))
651 return value, err
652}
653
654// ListFiles uses the client pod to list the paths matching the given `path`
655func ListFiles(storeEnv *Env, path string) (string, error) {

Calls 3

UncheckedFunction · 0.92
composeFindCmdFunction · 0.85
ClientPodRefMethod · 0.80