From 32370d2dce6e5b9d7e3807d47ee47e350e854876 Mon Sep 17 00:00:00 2001 From: Swapnil Date: Wed, 12 Aug 2026 09:03:22 +0530 Subject: [PATCH 1/2] 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: |- From 55ece6a404129972d25a9f11217051dbe844e980 Mon Sep 17 00:00:00 2001 From: Swapnil Date: Wed, 19 Aug 2026 07:12:46 +0530 Subject: [PATCH 2/2] Add explicit Age printer column to preserve default behavior 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 --- operatorcontrolplane/v1alpha1/types_conditioncheck.go | 1 + .../0000_10_network_01_podnetworkconnectivitychecks.crd.yaml | 3 +++ .../v1alpha1/zz_generated.featuregated-crd-manifests.yaml | 3 +++ .../AAA_ungated.yaml | 3 +++ 4 files changed, 10 insertions(+) diff --git a/operatorcontrolplane/v1alpha1/types_conditioncheck.go b/operatorcontrolplane/v1alpha1/types_conditioncheck.go index 736fa3f143a..6a9ee283766 100644 --- a/operatorcontrolplane/v1alpha1/types_conditioncheck.go +++ b/operatorcontrolplane/v1alpha1/types_conditioncheck.go @@ -18,6 +18,7 @@ import ( // +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" +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=".metadata.creationTimestamp" // +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 b4d9a5f1df7..bdf8043bdad 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 @@ -28,6 +28,9 @@ spec: jsonPath: .status.conditions[?(@.type=="Reachable")].lastTransitionTime name: Since type: date + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1alpha1 schema: openAPIV3Schema: diff --git a/operatorcontrolplane/v1alpha1/zz_generated.featuregated-crd-manifests.yaml b/operatorcontrolplane/v1alpha1/zz_generated.featuregated-crd-manifests.yaml index c43b1bedf67..c062dd528b0 100644 --- a/operatorcontrolplane/v1alpha1/zz_generated.featuregated-crd-manifests.yaml +++ b/operatorcontrolplane/v1alpha1/zz_generated.featuregated-crd-manifests.yaml @@ -27,6 +27,9 @@ podnetworkconnectivitychecks.controlplane.operator.openshift.io: jsonPath: .status.conditions[?(@.type=="Reachable")].lastTransitionTime name: Since type: date + - jsonPath: .metadata.creationTimestamp + name: Age + 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 2dbf51dcbb7..01c23eea664 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 @@ -31,6 +31,9 @@ spec: jsonPath: .status.conditions[?(@.type=="Reachable")].lastTransitionTime name: Since type: date + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1alpha1 schema: openAPIV3Schema: