Documentation ¶
Index ¶
- Constants
- Variables
- func AnalyzeSupportBundle(spec *troubleshootv1beta2.SupportBundleSpec, tmpDir string) ([]*analyzer.AnalyzeResult, error)
- 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 GetSupportBundleFromURI(bundleURI string) (*troubleshootv1beta2.SupportBundle, error)
- func LoadRedactorSpec(arg string) ([]byte, error)
- func LoadSupportBundleSpec(arg string) ([]byte, 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"
const VersionFilename = "version.yaml"
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(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
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)
func GetSupportBundleFromURI ¶
func GetSupportBundleFromURI(bundleURI string) (*troubleshootv1beta2.SupportBundle, error)
func LoadRedactorSpec ¶
func LoadSupportBundleSpec ¶
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 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()).