mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-08-27 00:37:20 +00:00
Merge pull request #34 from replicatedhq/error
fail with an error if downloaded bundle doesn't have the version file
This commit is contained in:
@@ -9,8 +9,8 @@ import (
|
||||
|
||||
func writeVersionFile(path string) (string, error) {
|
||||
version := troubleshootv1beta1.SupportBundleVersion{
|
||||
ApiVersion: "troubleshoot.replicated.com/v1beta1",
|
||||
Kind: "SupportBundle",
|
||||
ApiVersion: "troubleshoot.replicated.com/v1beta1",
|
||||
Kind: "SupportBundle",
|
||||
}
|
||||
b, err := yaml.Marshal(version)
|
||||
if err != nil {
|
||||
|
||||
@@ -32,6 +32,11 @@ func DownloadAndAnalyze(ctx context.Context, bundleURL string) ([]*AnalyzeResult
|
||||
return nil, err
|
||||
}
|
||||
|
||||
_, err = os.Stat(filepath.Join(tmpDir, "version.yaml"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
analyzers, err := getTroubleshootAnalyzers()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package v1beta1
|
||||
|
||||
type SupportBundleVersion struct {
|
||||
ApiVersion string `json:"apiVersion" yaml:"apiVersion"`
|
||||
Kind string `json:"kind" yaml:"kind"`
|
||||
ApiVersion string `json:"apiVersion" yaml:"apiVersion"`
|
||||
Kind string `json:"kind" yaml:"kind"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user