CountFiles uses the client pod to count the amount of files matching the given `path`
(storeEnv *Env, path string)
| 638 | // CountFiles uses the client pod to count the amount of files matching the |
| 639 | // given `path` |
| 640 | func 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` |
| 655 | func ListFiles(storeEnv *Env, path string) (string, error) { |