Some cleanup

This commit is contained in:
divolgin
2019-07-31 16:50:28 +00:00
parent ea58127389
commit 7e541de35b
4 changed files with 4 additions and 5 deletions
+3 -2
View File
@@ -5,12 +5,12 @@ import (
"encoding/json"
"fmt"
"gopkg.in/yaml.v2"
analyzer "github.com/replicatedhq/troubleshoot/pkg/analyze"
"github.com/replicatedhq/troubleshoot/pkg/convert"
"github.com/replicatedhq/troubleshoot/pkg/logger"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"gopkg.in/yaml.v2"
)
func Analyze() *cobra.Command {
@@ -61,10 +61,11 @@ func Analyze() *cobra.Command {
}
cmd.Flags().String("url", "", "URL of the support bundle to analyze")
cmd.MarkFlagRequired("url")
cmd.Flags().String("output", "", "output format: json, yaml")
cmd.Flags().String("compatibility", "", "output compatibility mode: support-bundle")
cmd.Flags().MarkHidden("compatibility")
cmd.Flags().Bool("quiet", false, "enable/disable error messaging and only show parseable output")
cmd.MarkFlagRequired("url")
viper.BindPFlags(cmd.Flags())
-1
View File
@@ -11,7 +11,6 @@ func writeVersionFile(path string) (string, error) {
version := troubleshootv1beta1.SupportBundleVersion{
ApiVersion: "troubleshoot.replicated.com/v1beta1",
Kind: "SupportBundle",
LayoutVersion: "0.0.1",
}
b, err := yaml.Marshal(version)
if err != nil {
+1 -1
View File
@@ -121,7 +121,7 @@ func extractTroubleshootBundle(reader io.Reader, destDir string) error {
}
func getTroubleshootAnalyzers() ([]*troubleshootv1beta1.Analyze, error) {
specURL := `https://gist.githubusercontent.com/divolgin/92b512ad4697c7255f383a7c1b56fd83/raw/troubleshoot_v1beta1_preflight.yaml`
specURL := `https://gist.githubusercontent.com/divolgin/92b512ad4697c7255f383a7c1b56fd83/raw`
resp, err := http.Get(specURL)
if err != nil {
return nil, err
-1
View File
@@ -3,5 +3,4 @@ package v1beta1
type SupportBundleVersion struct {
ApiVersion string `json:"apiVersion" yaml:"apiVersion"`
Kind string `json:"kind" yaml:"kind"`
LayoutVersion string `json:"layoutVersion" yaml:"layoutVersion"`
}