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

Function TestDirectoryEmpty

tests/utils/utils.go:270–279  ·  view source on GitHub ↗

TestDirectoryEmpty tests if a directory `directoryPath` exists on pod `podName` in namespace `namespace`

(namespace, podName, directoryPath string)

Source from the content-addressed store, hash-verified

268
269// TestDirectoryEmpty tests if a directory `directoryPath` exists on pod `podName` in namespace `namespace`
270func TestDirectoryEmpty(namespace, podName, directoryPath string) bool {
271 testDirectoryEmptyCommand := "test \"$(ls -A" + directoryPath + ")\""
272 _, _, err := run.Unchecked(fmt.Sprintf(
273 "kubectl exec -n %v %v -- %v",
274 namespace,
275 podName,
276 testDirectoryEmptyCommand))
277
278 return err == nil
279}

Callers

nothing calls this directly

Calls 1

UncheckedFunction · 0.92

Tested by

no test coverage detected