Skip to content

Commit

Permalink
Refactor fetching logs
Browse files Browse the repository at this point in the history
* The log action has been removed, it has been relaced by a log
  repository:

    * The repository takes care to fetch app and build logs, merge,
      filter and sort them
    * The log repo is injected with a log streamer function. That is
      useful for testing
    * Although the the log repo test is a test env one, it is using a
      fake log streamer as env tests cannot run pods, therefore there
      are no logs. Still, the test verifies how the repo is finding
      relevant pods and containers and the logic around filtering and
      sorting
    * When fetching logs from K8S we do specify `SinceTime`. However,
      that option option has a precision of a second, therefore it would
      ignore the second fraction. Thus we may get entries that are
      before the specified `StartTime` but still within its second. See
      kubernetes/kubernetes#77856
      kubernetes/kubernetes#92595 (comment)
    * In order to mitigate the above, the log repositories filters log
      records by `message.StartTime` to filter out earlier entries

* Introduced a new smoke test that runs `cf logs` (without `--recent`)
  and verifies that the command does not exit and the output does not
  grow (the test app is not logging enything after logging the port it
  listens to)

* Introduced the `/log` endpoint to `dorifi` to test logging

* Simplified more code by using go-functional
  • Loading branch information
georgethebeatle committed Aug 26, 2024
1 parent 5ac7842 commit 3b104cc
Show file tree
Hide file tree
Showing 26 changed files with 1,179 additions and 1,227 deletions.
94 changes: 0 additions & 94 deletions api/actions/app_logs.go

This file was deleted.

257 changes: 0 additions & 257 deletions api/actions/app_logs_test.go

This file was deleted.

Loading

0 comments on commit 3b104cc

Please sign in to comment.