-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: uds monitor pepr #696
Conversation
@jeff-mccoy I've looked through this PR and everything is generally easy to follow/understand. My only real callout is the tight coupling between the stream logic and Pepr logs (example). Understood this is a necessary evil (we are streaming logs after all 😅 ), just want to ensure @defenseunicorns/pepr are tracking this coupling as well |
Co-authored-by: UncleGedd <42304551+UncleGedd@users.noreply.github.com>
Co-authored-by: UncleGedd <42304551+UncleGedd@users.noreply.github.com>
For sure that's why I broke out the code into a pepr-specific implementation of the stream.Reader interface. It also is very tied to how we log things with Pepr in UDS Core, so we'll need to be aware of that, but there's not really a way around that. |
@jeff-mccoy I went through this code with @TristanHoladay and @decleaver, and discussed with some of the UDS Core folks as well, TLDR: we're g2g I have some nits that can be addressed in a follow-up ticket along with adding some e2e tests (would be good for the UDS CLI team to get some more practice with those |
All comments resolved, requested changes made |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Follow up ticket to add docs + e2e tests: #701
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [defenseunicorns/uds-cli](https://github.com/defenseunicorns/uds-cli) | minor | `0.11.2` -> `0.12.0` | | [defenseunicorns/uds-cli](https://github.com/defenseunicorns/uds-cli) | minor | `v0.11.2` -> `v0.12.0` | --- ### Release Notes <details> <summary>defenseunicorns/uds-cli (defenseunicorns/uds-cli)</summary> ### [`v0.12.0`](https://github.com/defenseunicorns/uds-cli/releases/tag/v0.12.0) [Compare Source](https://github.com/defenseunicorns/uds-cli/compare/v0.11.2...v0.12.0) #### What's Changed - feat: uds monitor pepr by [@​jeff-mccoy](https://github.com/jeff-mccoy) in [https://github.com/defenseunicorns/uds-cli/pull/696](https://github.com/defenseunicorns/uds-cli/pull/696) - docs: remove out of place quotation by [@​zachariahmiller](https://github.com/zachariahmiller) in [https://github.com/defenseunicorns/uds-cli/pull/706](https://github.com/defenseunicorns/uds-cli/pull/706) - chore: ensure nginx shorthand in dev tests by [@​UncleGedd](https://github.com/UncleGedd) in [https://github.com/defenseunicorns/uds-cli/pull/700](https://github.com/defenseunicorns/uds-cli/pull/700) - chore(deps): update actions/checkout action to v4.1.7 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/697](https://github.com/defenseunicorns/uds-cli/pull/697) - chore(deps): update homebrew/actions digest to [`1be15ef`](https://github.com/defenseunicorns/uds-cli/commit/1be15ef) by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/683](https://github.com/defenseunicorns/uds-cli/pull/683) - fix(deps): update module github.com/fatih/color to v1.17.0 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/678](https://github.com/defenseunicorns/uds-cli/pull/678) - fix(deps): update golang.org/x/exp digest to [`7f521ea`](https://github.com/defenseunicorns/uds-cli/commit/7f521ea) by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/642](https://github.com/defenseunicorns/uds-cli/pull/642) - chore(deps): update github/codeql-action action to v3.25.10 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/649](https://github.com/defenseunicorns/uds-cli/pull/649) - fix(deps): update module helm.sh/helm/v3 to v3.15.2 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/690](https://github.com/defenseunicorns/uds-cli/pull/690) - chore: adr for caching implementation by [@​decleaver](https://github.com/decleaver) in [https://github.com/defenseunicorns/uds-cli/pull/707](https://github.com/defenseunicorns/uds-cli/pull/707) - chore: add monitor docs and tests by [@​UncleGedd](https://github.com/UncleGedd) in [https://github.com/defenseunicorns/uds-cli/pull/715](https://github.com/defenseunicorns/uds-cli/pull/715) - chore(deps): update zarf to v0.35.0 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/711](https://github.com/defenseunicorns/uds-cli/pull/711) - fix(engine): use k8s timestamps instead of pepr timestamps by [@​jeff-mccoy](https://github.com/jeff-mccoy) in [https://github.com/defenseunicorns/uds-cli/pull/717](https://github.com/defenseunicorns/uds-cli/pull/717) - chore(deps): update homebrew/actions digest to [`68fa6ae`](https://github.com/defenseunicorns/uds-cli/commit/68fa6ae) by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/713](https://github.com/defenseunicorns/uds-cli/pull/713) - fix(deps): update module github.com/spf13/cobra to v1.8.1 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/710](https://github.com/defenseunicorns/uds-cli/pull/710) - chore: uds engine install adr by [@​decleaver](https://github.com/decleaver) in [https://github.com/defenseunicorns/uds-cli/pull/699](https://github.com/defenseunicorns/uds-cli/pull/699) - fix: update bundle-anatomy.md by [@​Madeline-UX](https://github.com/Madeline-UX) in [https://github.com/defenseunicorns/uds-cli/pull/720](https://github.com/defenseunicorns/uds-cli/pull/720) - chore: various doc linting fixes by [@​UnicornChance](https://github.com/UnicornChance) in [https://github.com/defenseunicorns/uds-cli/pull/724](https://github.com/defenseunicorns/uds-cli/pull/724) - feat: fall back to non-strict unmarshalling by [@​decleaver](https://github.com/decleaver) in [https://github.com/defenseunicorns/uds-cli/pull/721](https://github.com/defenseunicorns/uds-cli/pull/721) - chore(deps): update podinfo to v6.7.0 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/723](https://github.com/defenseunicorns/uds-cli/pull/723) - feat: distinguish between stdout and stderr output by [@​UncleGedd](https://github.com/UncleGedd) in [https://github.com/defenseunicorns/uds-cli/pull/730](https://github.com/defenseunicorns/uds-cli/pull/730) - fix(deps): update kubernetes packages to v0.30.2 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/702](https://github.com/defenseunicorns/uds-cli/pull/702) - chore(deps): update actions/create-github-app-token action to v1.10.2 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/727](https://github.com/defenseunicorns/uds-cli/pull/727) - feat(ci): included dependency review action by [@​naveensrinivasan](https://github.com/naveensrinivasan) in [https://github.com/defenseunicorns/uds-cli/pull/479](https://github.com/defenseunicorns/uds-cli/pull/479) - chore(deps): update actions/dependency-review-action action to v4.3.3 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/732](https://github.com/defenseunicorns/uds-cli/pull/732) - chore(deps): update actions/checkout action to v4.1.7 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/731](https://github.com/defenseunicorns/uds-cli/pull/731) - fix: ensure inspected image list is machine readable by [@​UncleGedd](https://github.com/UncleGedd) in [https://github.com/defenseunicorns/uds-cli/pull/734](https://github.com/defenseunicorns/uds-cli/pull/734) - fix: release pipeline by [@​UncleGedd](https://github.com/UncleGedd) in [https://github.com/defenseunicorns/uds-cli/pull/739](https://github.com/defenseunicorns/uds-cli/pull/739) - fix: release pipeline again by [@​UncleGedd](https://github.com/UncleGedd) in [https://github.com/defenseunicorns/uds-cli/pull/740](https://github.com/defenseunicorns/uds-cli/pull/740) #### New Contributors - [@​Madeline-UX](https://github.com/Madeline-UX) made their first contribution in [https://github.com/defenseunicorns/uds-cli/pull/720](https://github.com/defenseunicorns/uds-cli/pull/720) **Full Changelog**: defenseunicorns/uds-cli@v0.11.2...v0.12.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/defenseunicorns/uds-core). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjAuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [defenseunicorns/uds-cli](https://github.com/defenseunicorns/uds-cli) | minor | `0.11.2` -> `0.12.0` | | [defenseunicorns/uds-cli](https://github.com/defenseunicorns/uds-cli) | minor | `v0.11.2` -> `v0.12.0` | --- ### Release Notes <details> <summary>defenseunicorns/uds-cli (defenseunicorns/uds-cli)</summary> ### [`v0.12.0`](https://github.com/defenseunicorns/uds-cli/releases/tag/v0.12.0) [Compare Source](https://github.com/defenseunicorns/uds-cli/compare/v0.11.2...v0.12.0) #### What's Changed - feat: uds monitor pepr by [@​jeff-mccoy](https://github.com/jeff-mccoy) in [https://github.com/defenseunicorns/uds-cli/pull/696](https://github.com/defenseunicorns/uds-cli/pull/696) - docs: remove out of place quotation by [@​zachariahmiller](https://github.com/zachariahmiller) in [https://github.com/defenseunicorns/uds-cli/pull/706](https://github.com/defenseunicorns/uds-cli/pull/706) - chore: ensure nginx shorthand in dev tests by [@​UncleGedd](https://github.com/UncleGedd) in [https://github.com/defenseunicorns/uds-cli/pull/700](https://github.com/defenseunicorns/uds-cli/pull/700) - chore(deps): update actions/checkout action to v4.1.7 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/697](https://github.com/defenseunicorns/uds-cli/pull/697) - chore(deps): update homebrew/actions digest to [`1be15ef`](https://github.com/defenseunicorns/uds-cli/commit/1be15ef) by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/683](https://github.com/defenseunicorns/uds-cli/pull/683) - fix(deps): update module github.com/fatih/color to v1.17.0 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/678](https://github.com/defenseunicorns/uds-cli/pull/678) - fix(deps): update golang.org/x/exp digest to [`7f521ea`](https://github.com/defenseunicorns/uds-cli/commit/7f521ea) by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/642](https://github.com/defenseunicorns/uds-cli/pull/642) - chore(deps): update github/codeql-action action to v3.25.10 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/649](https://github.com/defenseunicorns/uds-cli/pull/649) - fix(deps): update module helm.sh/helm/v3 to v3.15.2 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/690](https://github.com/defenseunicorns/uds-cli/pull/690) - chore: adr for caching implementation by [@​decleaver](https://github.com/decleaver) in [https://github.com/defenseunicorns/uds-cli/pull/707](https://github.com/defenseunicorns/uds-cli/pull/707) - chore: add monitor docs and tests by [@​UncleGedd](https://github.com/UncleGedd) in [https://github.com/defenseunicorns/uds-cli/pull/715](https://github.com/defenseunicorns/uds-cli/pull/715) - chore(deps): update zarf to v0.35.0 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/711](https://github.com/defenseunicorns/uds-cli/pull/711) - fix(engine): use k8s timestamps instead of pepr timestamps by [@​jeff-mccoy](https://github.com/jeff-mccoy) in [https://github.com/defenseunicorns/uds-cli/pull/717](https://github.com/defenseunicorns/uds-cli/pull/717) - chore(deps): update homebrew/actions digest to [`68fa6ae`](https://github.com/defenseunicorns/uds-cli/commit/68fa6ae) by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/713](https://github.com/defenseunicorns/uds-cli/pull/713) - fix(deps): update module github.com/spf13/cobra to v1.8.1 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/710](https://github.com/defenseunicorns/uds-cli/pull/710) - chore: uds engine install adr by [@​decleaver](https://github.com/decleaver) in [https://github.com/defenseunicorns/uds-cli/pull/699](https://github.com/defenseunicorns/uds-cli/pull/699) - fix: update bundle-anatomy.md by [@​Madeline-UX](https://github.com/Madeline-UX) in [https://github.com/defenseunicorns/uds-cli/pull/720](https://github.com/defenseunicorns/uds-cli/pull/720) - chore: various doc linting fixes by [@​UnicornChance](https://github.com/UnicornChance) in [https://github.com/defenseunicorns/uds-cli/pull/724](https://github.com/defenseunicorns/uds-cli/pull/724) - feat: fall back to non-strict unmarshalling by [@​decleaver](https://github.com/decleaver) in [https://github.com/defenseunicorns/uds-cli/pull/721](https://github.com/defenseunicorns/uds-cli/pull/721) - chore(deps): update podinfo to v6.7.0 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/723](https://github.com/defenseunicorns/uds-cli/pull/723) - feat: distinguish between stdout and stderr output by [@​UncleGedd](https://github.com/UncleGedd) in [https://github.com/defenseunicorns/uds-cli/pull/730](https://github.com/defenseunicorns/uds-cli/pull/730) - fix(deps): update kubernetes packages to v0.30.2 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/702](https://github.com/defenseunicorns/uds-cli/pull/702) - chore(deps): update actions/create-github-app-token action to v1.10.2 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/727](https://github.com/defenseunicorns/uds-cli/pull/727) - feat(ci): included dependency review action by [@​naveensrinivasan](https://github.com/naveensrinivasan) in [https://github.com/defenseunicorns/uds-cli/pull/479](https://github.com/defenseunicorns/uds-cli/pull/479) - chore(deps): update actions/dependency-review-action action to v4.3.3 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/732](https://github.com/defenseunicorns/uds-cli/pull/732) - chore(deps): update actions/checkout action to v4.1.7 by [@​renovate](https://github.com/renovate) in [https://github.com/defenseunicorns/uds-cli/pull/731](https://github.com/defenseunicorns/uds-cli/pull/731) - fix: ensure inspected image list is machine readable by [@​UncleGedd](https://github.com/UncleGedd) in [https://github.com/defenseunicorns/uds-cli/pull/734](https://github.com/defenseunicorns/uds-cli/pull/734) - fix: release pipeline by [@​UncleGedd](https://github.com/UncleGedd) in [https://github.com/defenseunicorns/uds-cli/pull/739](https://github.com/defenseunicorns/uds-cli/pull/739) - fix: release pipeline again by [@​UncleGedd](https://github.com/UncleGedd) in [https://github.com/defenseunicorns/uds-cli/pull/740](https://github.com/defenseunicorns/uds-cli/pull/740) #### New Contributors - [@​Madeline-UX](https://github.com/Madeline-UX) made their first contribution in [https://github.com/defenseunicorns/uds-cli/pull/720](https://github.com/defenseunicorns/uds-cli/pull/720) **Full Changelog**: defenseunicorns/uds-cli@v0.11.2...v0.12.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/defenseunicorns/uds-core). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjAuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Description
Introduces the
uds monitor
command tree, with the first command beinguds monitor pepr
. This provides the same capabilities asnpx pepr monitor
from Pepr, and many more capabilities specific to UDS. Commands:uds monitor pepr
Aggregates all admission and operator logs into a single stream
uds monitor pepr operator
Stream UDS Operator actions (Package processing, status updates, and errors)
uds monitor pepr policies
Stream UDS Policy logs (Allow, Deny, Mutate)
uds monitor pepr allowed
Stream UDS Policy allow logs
uds monitor pepr denied
Stream UDS Policy deny logs
uds monitor pepr mutated
Stream UDS Policy mutation logs
uds monitor pepr failed
Stream UDS Policy deny logs and UDS Operator error logs
Flags:
-n, --namespace
- Namespace to monitor. Default is all namespaces-f, --follow
- Follow the logs-t, --timestamps
- Show timestamps in logs. Default is false--since
- Only return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs--json
- Return the raw JSON output that would be processed the command (extra log lines filtered out)With timestamps
Without timestamps
Related Issue
Fixes #
Relates to #
Type of change
Checklist before merging