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
cmd: enhance cilium bpf policy list&get #25389
cmd: enhance cilium bpf policy list&get #25389
Conversation
Currently, when listing all policy maps with structured output (e.g. `cilium bpf policy list -o json`), the output as a whole isn't structured as JSON, only the individual policy maps per endpoint. This prevents piping its output into other tools - e.g. jq. This commits changes this by formatting the full output as JSON/YAML with EndpointID, Path & Content. ``` [ { "EndpointID": "35", "Path": "/sys/fs/bpf/tc/globals/cilium_policy_00035", "Content": [ { // map entry }, { // map entry } ] }, { "EndpointID": "38", "Path": "/sys/fs/bpf/tc/globals/cilium_policy_00038", "Content": [ { // map entry }, { // map entry } ] }, ``` Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
This commit adds the recently introduced auth type to the list of attributes which get printed when listing the policies with `cilium bpf policy get/list`. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
/test Job 'Cilium-PR-K8s-1.26-kernel-net-next' failed: Click to show.Test Name
Failure Output
Jenkins URL: https://jenkins.cilium.io/job/Cilium-PR-K8s-1.26-kernel-net-next/2301/ If it is a flake and a GitHub issue doesn't already exist to track it, comment Then please upload the Jenkins artifacts to that issue. Job 'Cilium-PR-K8s-1.26-kernel-net-next' failed: Click to show.Test Name
Failure Output
Jenkins URL: https://jenkins.cilium.io/job/Cilium-PR-K8s-1.26-kernel-net-next/2312/ If it is a flake and a GitHub issue doesn't already exist to track it, comment Then please upload the Jenkins artifacts to that issue. |
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.
LGTM
This PR introduces the following changes related to the cilium commands
cilium bpf policy get/list
:mtls-spiffe
) gets printed when getting/listing in the table formListing all policy maps as JSON/YAML
Currently, when listing all policy maps with structured output (e.g.
cilium bpf policy list -o json
), the output as a whole isn't structured as JSON, only the individual policy maps per endpoint. This prevents piping its output into other tools - e.g. jq.This commits changes this by formatting the full output as JSON/YAML with EndpointID, Path & Content.
Endpoint ID
Explicitly display Endpoint ID in addition to path (where it might not be that obvious that it contains the endpoint id)
before
after