Add printer columns to PodNetworkConnectivityCheck CRD - #2977
Add printer columns to PodNetworkConnectivityCheck CRD#2977swshende-cmd wants to merge 2 commits into
Conversation
Previously, `oc get podnetworkconnectivitychecks` only displayed NAME and AGE columns, requiring users to inspect YAML output or use complex jsonpath queries to determine connectivity check status. This adds three additionalPrinterColumns to the CRD: - Target Endpoint: shows the endpoint being checked (.spec.targetEndpoint) - Reachable: shows the reachability status (True/False from conditions) - Since: shows when the status last changed (date type) This follows the same pattern used by ClusterOperator, ClusterVersion, and Route CRDs in this repository. Fixes: https://redhat.atlassian.net/browse/RFE-5093 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Hello @swshende-cmd! Some important instructions when contributing to openshift/api: |
|
Hi @swshende-cmd. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughAdded four Kubernetes print columns to Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change adds status columns to the resource listing without changing stored resource data or behavior; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi Reviewers, First of All, sorry if I have missed any workflow here: I was going through some back log cases and jiras and found this where I thought i can contribute, seems this was not a lot of change and surely adds value for customers in our product, I have gone ahead, implemented and tested this and would need your review for PR. Implementation Summary Before implementation (only NAME + AGE) After implementation (with Target Endpoint, Reachable, Since) Impact Happy to have all the suggestions and feedback! Thank you. |
|
/ok-to-test |
| scope: Namespaced | ||
| versions: | ||
| - name: v1alpha1 | ||
| - additionalPrinterColumns: |
There was a problem hiding this comment.
One thing to note, by adding these custom printer columns the default Age column will be dropped.
If we wanted to keep that information around we'd need to explicitly add an Age column here.
There was a problem hiding this comment.
After doing a bit more research on this API, it looks like this API is actually stamped out on the cluster via a controller whose implementation exists in client-go.
It seems like in order for this change to be properly picked up and applied to the cluster I think we would need to update https://github.com/openshift/library-go/blob/master/pkg/operator/connectivitycheckcontroller/manifests/controlplane.operator.openshift.io_podnetworkconnectivitychecks.yaml as well.
When custom additionalPrinterColumns are defined, the default Age column is no longer automatically included. Add it explicitly to maintain the expected oc get output. Addresses review feedback from @everettraven. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@everettraven Thank you for the review! Both points addressed: 1. Age column restored ✅ 2. library-go update 📝 Updated test results (OCP 4.22.3, with Age column)All 6 E2E tests passed:
|
|
@swshende-cmd: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
@everettraven Hi, if everything looks good, would you help with further needed help, Thank you in advance. |
|
/approve |
|
Pipeline controller notification No second-stage tests were triggered for this PR. This can happen when:
Use |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: everettraven The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/verified by @swshende-cmd |
|
@swshende-cmd: Jira verification commands are restricted to collaborators for this repo. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Summary
additionalPrinterColumnsto thePodNetworkConnectivityCheckCRD so thatoc get podnetworkconnectivitychecksdisplays useful status information at a glanceFixes: https://redhat.atlassian.net/browse/RFE-5093
Before
After
Implementation
Added 3
+kubebuilder:printcolumnannotations toPodNetworkConnectivityChecktype inoperatorcontrolplane/v1alpha1/types_conditioncheck.go:This follows the same pattern used by
ClusterOperator,ClusterVersion, andRouteCRDs.Test Plan
oc get podnetworkconnectivitychecks -Ashows all 3 new columns-o jsonand-o yamloutput unchanged-o wideworks correctlymake update(withPROTO_OPTIONAL=1) — code generation passesMade with Cursor