Documentation ¶
Index ¶
Constants ¶
const ( AnalysisReport = "analysis.report" BugReport = "bug-report.tar.gz" FullCluster = "full-cluster" BugReportDir = "bug-report" )
Variables ¶
This section is empty.
Functions ¶
func CaptureContainerLogs ¶
func CaptureContainerLogs(namespace string, podName string, containerName string, containerLogsDir string)
CaptureContainerLogs executes a "kubectl cp" command to copy a container's log directories to a local path on disk for examination. This utilizes the cluster snapshot directory and KUBECONFIG settings do capture the logs to the same path as the cluster snapshot location; the container log directory is copied to DUMP_DIRECTORY/podName.
namespace - The namespace of the target pod podName - The name of the pod containerName - The target container name within the pod containerLogsDir - The logs directory location within the container
DUMP_KUBECONFIG - The kube config file to use when executing the bug-report CLI. DUMP_DIRECTORY - The directory to store the cluster snapshot within.
func ExecuteBugReport ¶
ExecuteBugReport executes the cluster bug-report CLI using config from environment variables. DUMP_KUBECONFIG - The kube config file to use when executing the bug-report CLI. DUMP_DIRECTORY - The directory to store the cluster snapshot within. DUMP_COMMAND - The fully qualified cluster snapshot executable. One or more additional namespaces specified using ns are set for the flag --include-namespaces
Types ¶
type ClusterDumpWrapper ¶
type ClusterDumpWrapper struct {
// contains filtered or unexported fields
}
ClusterDumpWrapper creates cluster snapshots if the test fails (spec or aftersuite) A maximum of two cluster snapshots will be generated: - snapshot if any spec in the suite fails - snapshot if the aftersuite fails
func NewClusterDumpWrapper ¶
func NewClusterDumpWrapper(tf *framework.TestFramework, ns ...string) *ClusterDumpWrapper
func (*ClusterDumpWrapper) AfterEach ¶
func (c *ClusterDumpWrapper) AfterEach(body func()) bool
AfterEach wraps ginkgo.AfterEach usage: var _ = c.AfterEach(t, func() { ...after each logic... })
func (*ClusterDumpWrapper) AfterSuiteFunc ¶
func (c *ClusterDumpWrapper) AfterSuiteFunc(body func()) func()
AfterSuiteFunc wraps a function to emit a cluster dump if the suite failed usage: var afterSuite = c.AfterSuiteFunc(t, func() { ...after suite logic... })
func (*ClusterDumpWrapper) BeforeSuiteFunc ¶
func (c *ClusterDumpWrapper) BeforeSuiteFunc(body func()) func()