ListFiles uses the client pod to list the paths matching the given `path`
(storeEnv *Env, path string)
| 653 | |
| 654 | // ListFiles uses the client pod to list the paths matching the given `path` |
| 655 | func 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 |