Skip to content

Commit

Permalink
Add status printer column
Browse files Browse the repository at this point in the history
This commit adds a `status` printer column which
reflects the global state of the NicClusterPolicy CR instance.

Example:
$> kubectl get nicclusterpolicy
NAME                 STATUS
nic-cluster-policy   ready
  • Loading branch information
adrianchiris committed Feb 11, 2021
1 parent a977944 commit f4003d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/v1alpha1/nicclusterpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ type NicClusterPolicyStatus struct {
// kubebuilder:object:generate
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.state`,priority=0

// NicClusterPolicy is the Schema for the nicclusterpolicies API
type NicClusterPolicy struct {
Expand Down
6 changes: 5 additions & 1 deletion config/crd/bases/mellanox.com_nicclusterpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ spec:
singular: nicclusterpolicy
scope: Cluster
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.state
name: Status
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: NicClusterPolicy is the Schema for the nicclusterpolicies API
Expand Down

0 comments on commit f4003d9

Please sign in to comment.