Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions operatorcontrolplane/v1alpha1/types_conditioncheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ 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"
// +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
Expand Down

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,23 @@ 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
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,22 @@ 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
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
Scope: Namespaced
ShortNames: null
TopLevelFeatureGates: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,23 @@ spec:
singular: podnetworkconnectivitycheck
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

- 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
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: |-
Expand Down