collection

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

collection package provides the interface for collection implementation and the actual collection execution

collection package provides the interface for collection implementation and the actual collection execution

collection package provides the interface for collection implementation and the actual collection execution

collection package provides the interface for collection implementation and the actual collection execution

Index

Constants

This section is empty.

Variables

View Source
var DirPerms fs.FileMode = 0750

Functions

func ClusterK8sExecute added in v0.2.0

func ClusterK8sExecute(namespace string, cs CopyStrategy, ddfs helpers.Filesystem, c Collector, k string) error

func ComposeCopy added in v0.2.2

func ComposeCopy(conf HostCaptureConfiguration, source, destination string) (stdOut string, err error)

Adds the sudo part into the CopyFromHost call

func ComposeCopyTo added in v0.3.0

func ComposeCopyTo(conf HostCaptureConfiguration, source, destination string) (stdOut string, err error)

Adds the sudo part into the CopyFromHost call

func ComposeExecute added in v0.2.2

func ComposeExecute(conf HostCaptureConfiguration, command []string) (stdOut string, err error)

Adds the sudo part into the HostExecute call

func ComposeExecuteAndStream added in v0.3.0

func ComposeExecuteAndStream(conf HostCaptureConfiguration, output cli.OutputHandler, command []string) error

Adds the sudo part into the HostExecute call

func Execute

func Execute(c Collector, s CopyStrategy, collectionArgs Args, clusterCollection ...func()) error

func ExtractTarGz added in v0.3.0

func ExtractTarGz(gzFilePath, dest string) error

func FindTarGzFiles added in v0.3.0

func FindTarGzFiles(rootDir string) ([]string, error)

func SanitizeArchivePath added in v0.3.0

func SanitizeArchivePath(d, t string) (v string, err error)

Sanitize archive file pathing from "G305: Zip Slip vulnerability"

Types

type Args

type Args struct {
	DDCfs          helpers.Filesystem
	CoordinatorStr string
	ExecutorsStr   string
	OutputLoc      string
	SudoUser       string
	CopyStrategy   CopyStrategy
}

type ClusterInfo

type ClusterInfo struct {
	NumberNodesContacted int `json:"numberNodesContacted"`
	TotalNodesAttempted  int `json:"totalNodesAttempted"`
}

type Collector

type Collector interface {
	CopyFromHost(hostString string, isCoordinator bool, source, destination string) (out string, err error)
	CopyToHost(hostString string, isCoordinator bool, source, destination string) (out string, err error)
	CopyFromHostSudo(hostString string, isCoordinator bool, sudoUser, source, destination string) (out string, err error)
	CopyToHostSudo(hostString string, isCoordinator bool, sudoUser, source, destination string) (out string, err error)
	FindHosts(searchTerm string) (podName []string, err error)
	HostExecute(hostString string, isCoordinator bool, args ...string) (stdOut string, err error)
	HostExecuteAndStream(hostString string, output cli.OutputHandler, isCoordinator bool, args ...string) error
	HelpText() string
}

type CopyStrategy added in v0.2.0

type CopyStrategy interface {
	CreatePath(fileType, source, nodeType string) (path string, err error)
	ArchiveDiag(o string, outputLoc string) error
	GetTmpDir() string
}

type FailedFiles

type FailedFiles struct {
	Path string `json:"path"`
	Err  error  `json:"err"`
}

func Capture

func Capture(conf HostCaptureConfiguration, localDDCPath, localDDCYamlPath, outputLoc string, skipRESTCollect bool) (files []helpers.CollectedFile, failedFiles []FailedFiles, skippedFiles []string)

Capture collects diagnostics, conf files and log files from the target hosts. Failures are permissive and are first logged and then returned at the end with the reason for the failure.

type FindErr added in v0.1.3

type FindErr struct {
	Cmd string
}

func (FindErr) Error added in v0.1.3

func (fe FindErr) Error() string

type HostCaptureConfiguration

type HostCaptureConfiguration struct {
	NodeCaptureOutput string
	IsCoordinator     bool
	Collector         Collector
	Host              string
	OutputLocation    string
	SudoUser          string
	CopyStrategy      CopyStrategy
	DDCfs             helpers.Filesystem
}

type SummaryInfo

type SummaryInfo struct {
	ClusterInfo         ClusterInfo             `json:"clusterInfo"`
	CollectedFiles      []helpers.CollectedFile `json:"collectedFiles"`
	FailedFiles         []FailedFiles           `json:"failedFiles"`
	SkippedFiles        []string                `json:"skippedFiles"`
	StartTimeUTC        time.Time               `json:"startTimeUTC"`
	EndTimeUTC          time.Time               `json:"endTimeUTC"`
	TotalRuntimeSeconds int64                   `json:"totalRuntimeSeconds"`
	TotalBytesCollected int64                   `json:"totalBytesCollected"`
	Executors           []string                `json:"executors"`
	Coordinators        []string                `json:"coordinators"`
}

func (SummaryInfo) String

func (summary SummaryInfo) String() (string, error)

type SummaryInfoWriterError

type SummaryInfoWriterError struct {
	SummaryInfo SummaryInfo
	Err         error
}

func (SummaryInfoWriterError) Error

func (w SummaryInfoWriterError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL