mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-08-27 00:37:20 +00:00
Some cleanup
This commit is contained in:
@@ -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())
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user