(input *aggregatorInput)
| 60 | } |
| 61 | |
| 62 | func runAggregator(input *aggregatorInput) error { |
| 63 | cfg, err := config.LoadConfig() |
| 64 | if err != nil { |
| 65 | return errors.Wrap(err, "error loading sonobuoy configuration") |
| 66 | } |
| 67 | |
| 68 | kcfg, err := input.kubecfg.Get() |
| 69 | if err != nil { |
| 70 | return errors.Wrap(err, "getting kubeconfig") |
| 71 | } |
| 72 | |
| 73 | // Run Discovery (gather API data, run plugins) |
| 74 | errcount := discovery.Run(kcfg, cfg) |
| 75 | |
| 76 | if input.noExit { |
| 77 | logrus.Info("no-exit was specified, sonobuoy is now blocking") |
| 78 | select {} |
| 79 | } |
| 80 | |
| 81 | if errcount > 0 { |
| 82 | return fmt.Errorf("%v errors encountered during execution", errcount) |
| 83 | } |
| 84 | |
| 85 | return nil |
| 86 | } |
no test coverage detected