diff --git a/cmd/find.go b/cmd/find.go index cef4b2f..83bbaf4 100644 --- a/cmd/find.go +++ b/cmd/find.go @@ -65,7 +65,6 @@ var clusterCmd = &cobra.Command{ panic(err) } } else { - fmt.Printf("\n\n") fmt.Println(out) } }, diff --git a/cmd/root.go b/cmd/root.go index 20ece7d..bd82ea8 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -16,10 +16,10 @@ var ( func init() { klog.InitFlags(nil) - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) flag.Set("alsologtostderr", "true") flag.Set("logtostderr", "true") flag.Parse() + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) } var rootCmd = &cobra.Command{ diff --git a/pkg/helm/chartrepo.go b/pkg/helm/chartrepo.go index 0baf55c..854275f 100644 --- a/pkg/helm/chartrepo.go +++ b/pkg/helm/chartrepo.go @@ -66,7 +66,7 @@ func NewRepo(urls []string) []*Repo { } err := repo.loadReleases() if err != nil { - klog.Warningf("Could not load chart repo: %s", address) + klog.V(5).Infof("Could not load chart repo %s: %s", address, err) } else { mutex.Lock() repos = append(repos, repo) @@ -82,19 +82,16 @@ func NewRepo(urls []string) []*Repo { func (r *Repo) loadReleases() error { response, err := http.Get(fmt.Sprintf("%s/index.yaml", r.URL)) if err != nil { - klog.Warningf("Error loading chart repo %s: %v", r.URL, err) return err } data, err := ioutil.ReadAll(response.Body) if err != nil { - klog.Warningf("Error reading chart data from repo %s: %v", r.URL, err) return err } err = yaml.Unmarshal(data, r.Charts) if err != nil { - klog.Warningf("Error unmarshalling yaml for chart repo %s: %v", r.URL, err) return err } return nil diff --git a/pkg/helm/cluster.go b/pkg/helm/cluster.go index 358b7b6..c5ffcdd 100644 --- a/pkg/helm/cluster.go +++ b/pkg/helm/cluster.go @@ -38,7 +38,7 @@ func (h *Helm) GetHelmReleasesVersion3(helmRepos []*Repo) ([]output.ReleaseOutpu return nil, err } - klog.Infof("Got %d installed releases in the cluster", len(deployed)) + klog.V(5).Infof("Got %d installed releases in the cluster", len(deployed)) for _, chart := range deployed { validRepos := IsRepoIncluded(chart.Chart.Metadata.Name, helmRepos) newest := TryToFindNewestReleaseByChart(chart, validRepos) @@ -78,7 +78,7 @@ func (h *Helm) GetHelmReleasesVersion2(helmRepos []*Repo) ([]output.ReleaseOutpu return nil, err } - klog.Infof("Got %d installed releases in the cluster", len(deployed)) + klog.V(5).Infof("Got %d installed releases in the cluster", len(deployed)) for _, chart := range deployed { validRepos := IsRepoIncluded(chart.Chart.Metadata.Name, helmRepos)