Documentation ¶
Index ¶
- Constants
- Variables
- func AnalyzeSupportBundle(ctx context.Context, spec *troubleshootv1beta2.SupportBundleSpec, ...) ([]*analyzer.AnalyzeResult, error)
- func ConcatSpec(target *troubleshootv1beta2.SupportBundle, ...) *troubleshootv1beta2.SupportBundle
- func GetFilesContents(bundleArchive string, filenames []string) (map[string][]byte, error)
- func GetPodDetails(bundleArchive string, podNamespace string, podName string) (*types.PodDetails, error)
- func GetRedactorFromURI(redactorURI string) (*troubleshootv1beta2.Redactor, error)
- func GetRedactorsFromURIs(redactorURIs []string) ([]*troubleshootv1beta2.Redact, error)
- func GetSupportBundleFromURI(bundleURI string) (*troubleshootv1beta2.SupportBundle, error)
- func LoadRedactorSpec(arg string) ([]byte, error)
- func LoadSupportBundleSpec(arg string) ([]byte, error)
- func ParseRedactorsFromDocs(docs []string) ([]*troubleshootv1beta2.Redact, error)
- func ParseSupportBundle(doc []byte, followURI bool) (*troubleshootv1beta2.SupportBundle, error)
- func ParseSupportBundleFromDoc(doc []byte) (*troubleshootv1beta2.SupportBundle, error)
- func ProcessSupportBundleAfterCollection(spec *troubleshootv1beta2.SupportBundleSpec, archivePath string) (bool, error)
- type SupportBundleCreateOpts
- type SupportBundleResponse
Constants ¶
const AnalysisFilename = "analysis.json"
Variables ¶
var (
SupportBundleNameRegex = regexp.MustCompile(`^\/?support-bundle-(\d{4})-(\d{2})-(\d{2})T(\d{2})_(\d{2})_(\d{2})\/?`)
)
Functions ¶
func AnalyzeSupportBundle ¶
func AnalyzeSupportBundle(ctx context.Context, 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 ConcatSpec ¶ added in v0.42.0
func ConcatSpec(target *troubleshootv1beta2.SupportBundle, source *troubleshootv1beta2.SupportBundle) *troubleshootv1beta2.SupportBundle
ConcatSpec the intention with these appends is to swap them out at a later date with more specific handlers for merging the spec fields
func GetFilesContents ¶ added in v0.19.0
GetFilesContents will return the file contents for filenames matching the filenames parameter.
func GetPodDetails ¶ added in v0.19.0
func GetRedactorFromURI ¶
func GetRedactorFromURI(redactorURI string) (*troubleshootv1beta2.Redactor, error)
GetRedactorFromURI parses a redactor from a URI into a Redactor object Deprecated: use loader.LoadSpecs instead
func GetRedactorsFromURIs ¶ added in v0.53.0
func GetRedactorsFromURIs(redactorURIs []string) ([]*troubleshootv1beta2.Redact, error)
GetRedactorsFromURIs parses redactors from a URIs Redactor objects Deprecated: use loader.LoadSpecs instead
func GetSupportBundleFromURI ¶
func GetSupportBundleFromURI(bundleURI string) (*troubleshootv1beta2.SupportBundle, error)
GetSupportBundleFromURI downloads and parses a support bundle from a URI and returns a SupportBundle object
func LoadRedactorSpec ¶
func LoadSupportBundleSpec ¶
func ParseRedactorsFromDocs ¶ added in v0.47.0
func ParseRedactorsFromDocs(docs []string) ([]*troubleshootv1beta2.Redact, error)
ParseRedactorsFromDocs parses a slice of YAML docs and returns a slice of Redactors Deprecated: use loader.LoadSpecs instead
func ParseSupportBundle ¶ added in v0.44.0
func ParseSupportBundle(doc []byte, followURI bool) (*troubleshootv1beta2.SupportBundle, error)
ParseSupportBundle parses a support bundle from a byte array into a SupportBundle object Deprecated: use loader.LoadSpecs instead
func ParseSupportBundleFromDoc ¶
func ParseSupportBundleFromDoc(doc []byte) (*troubleshootv1beta2.SupportBundle, error)
ParseSupportBundle parses a support bundle from a byte array into a SupportBundle object Deprecated: use loader.LoadSpecs instead
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 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()).