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

Function CleanupClusterLogs

tests/utils/namespaces/namespace.go:69–78  ·  view source on GitHub ↗

CleanupClusterLogs cleans up the cluster logs of a given namespace

(namespace string, testFailed bool)

Source from the content-addressed store, hash-verified

67
68// CleanupClusterLogs cleans up the cluster logs of a given namespace
69func CleanupClusterLogs(namespace string, testFailed bool) error {
70 exists, _ := fileutils.FileExists(path.Join(SternLogDirectory, namespace))
71 if exists && !testFailed {
72 if err := fileutils.RemoveDirectory(path.Join(SternLogDirectory, namespace)); err != nil {
73 return err
74 }
75 }
76
77 return nil
78}
79
80// cleanupNamespace does cleanup duty related to the tear-down of a namespace,
81// and is intended to be called in a DeferCleanup clause

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected