From 32370d2dce6e5b9d7e3807d47ee47e350e854876 Mon Sep 17 00:00:00 2001 From: Swapnil Date: Wed, 12 Aug 2026 09:03:22 +0530 Subject: [PATCH] Add printer columns to PodNetworkConnectivityCheck CRD 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 --- .../v1alpha1/types_conditioncheck.go | 3 +++ ...twork_01_podnetworkconnectivitychecks.crd.yaml | 15 ++++++++++++++- .../zz_generated.featuregated-crd-manifests.yaml | 14 +++++++++++++- .../AAA_ungated.yaml | 15 ++++++++++++++- 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/operatorcontrolplane/v1alpha1/types_conditioncheck.go b/operatorcontrolplane/v1alpha1/types_conditioncheck.go index ba92985c13d..736fa3f143a 100644 --- a/operatorcontrolplane/v1alpha1/types_conditioncheck.go +++ b/operatorcontrolplane/v1alpha1/types_conditioncheck.go @@ -15,6 +15,9 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:path=podnetworkconnectivitychecks,scope=Namespaced // +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Target Endpoint",type=string,JSONPath=".spec.targetEndpoint",description="The endpoint being checked" +// +kubebuilder:printcolumn:name="Reachable",type=string,JSONPath=".status.conditions[?(@.type==\"Reachable\")].status",description="Whether the target endpoint is reachable" +// +kubebuilder:printcolumn:name="Since",type=date,JSONPath=".status.conditions[?(@.type==\"Reachable\")].lastTransitionTime",description="The time the reachability status last changed" // +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/639 // +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=network,operatorOrdering=01 // +kubebuilder:metadata:annotations=include.release.openshift.io/self-managed-high-availability=true diff --git a/operatorcontrolplane/v1alpha1/zz_generated.crd-manifests/0000_10_network_01_podnetworkconnectivitychecks.crd.yaml b/operatorcontrolplane/v1alpha1/zz_generated.crd-manifests/0000_10_network_01_podnetworkconnectivitychecks.crd.yaml index 7508fd1b415..b4d9a5f1df7 100644 --- a/operatorcontrolplane/v1alpha1/zz_generated.crd-manifests/0000_10_network_01_podnetworkconnectivitychecks.crd.yaml +++ b/operatorcontrolplane/v1alpha1/zz_generated.crd-manifests/0000_10_network_01_podnetworkconnectivitychecks.crd.yaml @@ -15,7 +15,20 @@ spec: singular: podnetworkconnectivitycheck scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The endpoint being checked + jsonPath: .spec.targetEndpoint + name: Target Endpoint + type: string + - description: Whether the target endpoint is reachable + jsonPath: .status.conditions[?(@.type=="Reachable")].status + name: Reachable + type: string + - description: The time the reachability status last changed + jsonPath: .status.conditions[?(@.type=="Reachable")].lastTransitionTime + name: Since + type: date + name: v1alpha1 schema: openAPIV3Schema: description: |- diff --git a/operatorcontrolplane/v1alpha1/zz_generated.featuregated-crd-manifests.yaml b/operatorcontrolplane/v1alpha1/zz_generated.featuregated-crd-manifests.yaml index 2032118c9ca..c43b1bedf67 100644 --- a/operatorcontrolplane/v1alpha1/zz_generated.featuregated-crd-manifests.yaml +++ b/operatorcontrolplane/v1alpha1/zz_generated.featuregated-crd-manifests.yaml @@ -14,7 +14,19 @@ podnetworkconnectivitychecks.controlplane.operator.openshift.io: KindName: PodNetworkConnectivityCheck Labels: {} PluralName: podnetworkconnectivitychecks - PrinterColumns: [] + PrinterColumns: + - description: The endpoint being checked + jsonPath: .spec.targetEndpoint + name: Target Endpoint + type: string + - description: Whether the target endpoint is reachable + jsonPath: .status.conditions[?(@.type=="Reachable")].status + name: Reachable + type: string + - description: The time the reachability status last changed + jsonPath: .status.conditions[?(@.type=="Reachable")].lastTransitionTime + name: Since + type: date Scope: Namespaced ShortNames: null TopLevelFeatureGates: [] diff --git a/operatorcontrolplane/v1alpha1/zz_generated.featuregated-crd-manifests/podnetworkconnectivitychecks.controlplane.operator.openshift.io/AAA_ungated.yaml b/operatorcontrolplane/v1alpha1/zz_generated.featuregated-crd-manifests/podnetworkconnectivitychecks.controlplane.operator.openshift.io/AAA_ungated.yaml index 8d69d133c6b..2dbf51dcbb7 100644 --- a/operatorcontrolplane/v1alpha1/zz_generated.featuregated-crd-manifests/podnetworkconnectivitychecks.controlplane.operator.openshift.io/AAA_ungated.yaml +++ b/operatorcontrolplane/v1alpha1/zz_generated.featuregated-crd-manifests/podnetworkconnectivitychecks.controlplane.operator.openshift.io/AAA_ungated.yaml @@ -18,7 +18,20 @@ spec: singular: podnetworkconnectivitycheck scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The endpoint being checked + jsonPath: .spec.targetEndpoint + name: Target Endpoint + type: string + - description: Whether the target endpoint is reachable + jsonPath: .status.conditions[?(@.type=="Reachable")].status + name: Reachable + type: string + - description: The time the reachability status last changed + jsonPath: .status.conditions[?(@.type=="Reachable")].lastTransitionTime + name: Since + type: date + name: v1alpha1 schema: openAPIV3Schema: description: |-