supportbundle

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 37 Imported by: 6

Documentation

Index

Constants

View Source
const AnalysisFilename = "analysis.json"
View Source
const VersionFilename = "version.yaml"

Variables

View Source
var (
	SupportBundleNameRegex = regexp.MustCompile(`^\/?support-bundle-(\d{4})-(\d{2})-(\d{2})T(\d{2})_(\d{2})_(\d{2})\/?`)
)

Functions

func AnalyzeSupportBundle

func AnalyzeSupportBundle(spec *troubleshootv1beta2.SupportBundleSpec, tmpDir string) ([]*analyzer.AnalyzeResult, error)

AnalyzeSupportBundle performs analysis on a support bundle using the support bundle spec and an already unpacked support bundle on disk

func GetFilesContents added in v0.19.0

func GetFilesContents(bundleArchive string, filenames []string) (map[string][]byte, error)

GetFilesContents will return the file contents for filenames matching the filenames parameter.

func GetPodDetails added in v0.19.0

func GetPodDetails(bundleArchive string, podNamespace string, podName string) (*types.PodDetails, error)

func GetRedactorFromURI

func GetRedactorFromURI(redactorURI string) (*troubleshootv1beta2.Redactor, error)

func GetSupportBundleFromURI

func GetSupportBundleFromURI(bundleURI string) (*troubleshootv1beta2.SupportBundle, error)

func LoadRedactorSpec

func LoadRedactorSpec(arg string) ([]byte, error)

func LoadSupportBundleSpec

func LoadSupportBundleSpec(arg string) ([]byte, error)

func ParseSupportBundleFromDoc

func ParseSupportBundleFromDoc(doc []byte) (*troubleshootv1beta2.SupportBundle, error)

func ProcessSupportBundleAfterCollection

func ProcessSupportBundleAfterCollection(spec *troubleshootv1beta2.SupportBundleSpec, archivePath string) (bool, error)

ProcessSupportBundleAfterCollection performs the after collection actions, like Callbacks and sending the archive to a remote server.

Types

type SupportBundleCreateOpts

type SupportBundleCreateOpts struct {
	CollectorProgressCallback func(chan interface{}, string)
	CollectWithoutPermissions bool
	HttpClient                *http.Client
	KubernetesRestConfig      *rest.Config
	Namespace                 string
	ProgressChan              chan interface{}
	SinceTime                 *time.Time
	Redact                    bool
	FromCLI                   bool
}

type SupportBundleResponse

type SupportBundleResponse struct {
	AnalyzerResults []*analyzer.AnalyzeResult
	ArchivePath     string
	FileUploaded    bool
}

func CollectSupportBundleFromSpec

func CollectSupportBundleFromSpec(spec *troubleshootv1beta2.SupportBundleSpec, additionalRedactors *troubleshootv1beta2.Redactor, opts SupportBundleCreateOpts) (*SupportBundleResponse, error)

CollectSupportBundleFromSpec collects support bundle from start to finish, including running collectors, analyzers and after collection steps. Input arguments are specifications. if FromCLI option is set to true, the output is the name of the archive on disk in the cwd. if FromCLI option is set to false, the support bundle is archived in the OS temp folder (os.TempDir()).

func CollectSupportBundleFromURI

func CollectSupportBundleFromURI(specURI string, redactorURIs []string, opts SupportBundleCreateOpts) (*SupportBundleResponse, error)

CollectSupportBundleFromURI collects support bundle from start to finish, including running collectors, analyzers and after collection steps. Input arguments are the URIs of the support bundle and redactor specs. The support bundle is archived in the OS temp folder (os.TempDir()).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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