argo-cd/server/application
Chris Sinjakli efc8ec1d78
chore: Log application name for invalid application spec (#6991)
When creating an application directly through the CLI or a `kubectl
apply`, it's relatively obvious which application is invalid (provided
you aren't applying several at once) as you're there creating it
interactively.

It's less clear when applications are generated by the application set
controller. When that happens, you need to go looking in the controller
logs, where you'll find something like:

> time="2021-08-10T11:36:02Z" level=error msg="application spec is
> invalid: InvalidSpecError: application destination
> {https://kubernetes.default.svc default} is not permitted in project
> 'my-project'"

which doesn't have any connection back to the application being
generated. This is particularly tricky to track down if you're searching
your logs via some sort of aggregator rather than watching `kubectl logs
-f`.

After this change, the log produced would be:

> time="2021-08-10T11:36:02Z" level=error msg="application spec for
> guestbook is invalid: InvalidSpecError: application destination
> {https://kubernetes.default.svc default} is not permitted in project
> 'my-project'"

There's probably fancier ways this information could be presented (e.g.
if application sets were represented in the UI and knew about failures
to apply their generated applications), but this logging change seems
like a cheap way to make this situation more debuggable.

Signed-off-by: Chris Sinjakli <chris@sinjakli.co.uk>
2021-08-18 11:10:52 +02:00
..
application.go chore: Log application name for invalid application spec (#6991) 2021-08-18 11:10:52 +02:00
application.proto chore: Upgrade Go module to v2 (#5931) 2021-04-01 20:44:18 +02:00
application_test.go chore: pre filter groups before enforcing #4296 (#6651) 2021-07-26 11:11:36 -07:00
broadcaster.go chore: Upgrade Go module to v2 (#5931) 2021-04-01 20:44:18 +02:00
broadcaster_test.go chore: Upgrade Go module to v2 (#5931) 2021-04-01 20:44:18 +02:00
logs.go fix: upgrade argo-ui version (fixes stuck logs viewer); properly retry loading logs if network connection broke (#5615) 2021-02-25 15:48:58 -08:00
logs_test.go feat: support viewing logs of multiple pods in UI (#5469) 2021-02-10 17:58:13 -08:00