Skip to content

Commit

Permalink
feat: extended status for kubectl (#1058)
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Braun <pbraun@redhat.com>
Co-authored-by: Edvin N <edvin.norling@gmail.com>
Co-authored-by: Hubert Stefanski <35736504+HubertStefanski@users.noreply.github.com>
  • Loading branch information
4 people committed May 22, 2023
1 parent e25fbd5 commit 2332f33
Show file tree
Hide file tree
Showing 21 changed files with 205 additions and 20 deletions.
3 changes: 3 additions & 0 deletions api/v1beta1/grafana_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ type GrafanaStatus struct {
//+kubebuilder:subresource:status

// Grafana is the Schema for the grafanas API
// +kubebuilder:printcolumn:name="Stage",type="string",JSONPath=".status.stage",description=""
// +kubebuilder:printcolumn:name="Stage status",type="string",JSONPath=".status.stageStatus",description=""
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description=""
type Grafana struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
3 changes: 3 additions & 0 deletions api/v1beta1/grafanadashboard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ type GrafanaDashboardStatus struct {
//+kubebuilder:subresource:status

// GrafanaDashboard is the Schema for the grafanadashboards API
// +kubebuilder:printcolumn:name="No matching instances",type="boolean",JSONPath=".status.NoMatchingInstances",description=""
// +kubebuilder:printcolumn:name="Last resync",type="date",format="date-time",JSONPath=".status.lastResync",description=""
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description=""
type GrafanaDashboard struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions api/v1beta1/grafanadatasource_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ type GrafanaDatasourceStatus struct {
//+kubebuilder:subresource:status

// GrafanaDatasource is the Schema for the grafanadatasources API
// +kubebuilder:printcolumn:name="No matching instances",type="boolean",JSONPath=".status.NoMatchingInstances",description=""
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description=""
type GrafanaDatasource struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions api/v1beta1/grafanafolder_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ type GrafanaFolderStatus struct {
//+kubebuilder:subresource:status

// GrafanaFolder is the Schema for the grafanafolders API
// +kubebuilder:printcolumn:name="No matching instances",type="boolean",JSONPath=".status.NoMatchingInstances",description=""
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description=""
type GrafanaFolder struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
13 changes: 12 additions & 1 deletion bundle/manifests/grafana.integreatly.org_grafanadashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ spec:
singular: grafanadashboard
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- format: date-time
jsonPath: .status.lastResync
name: Last resync
type: date
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ spec:
singular: grafanadatasource
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand Down
9 changes: 8 additions & 1 deletion bundle/manifests/grafana.integreatly.org_grafanafolders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ spec:
singular: grafanafolder
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand Down
12 changes: 11 additions & 1 deletion bundle/manifests/grafana.integreatly.org_grafanas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@ spec:
singular: grafana
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.stage
name: Stage
type: string
- jsonPath: .status.stageStatus
name: Stage status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand Down
13 changes: 12 additions & 1 deletion config/crd/bases/grafana.integreatly.org_grafanadashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ spec:
singular: grafanadashboard
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- format: date-time
jsonPath: .status.lastResync
name: Last resync
type: date
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ spec:
singular: grafanadatasource
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand Down
9 changes: 8 additions & 1 deletion config/crd/bases/grafana.integreatly.org_grafanafolders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ spec:
singular: grafanafolder
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand Down
12 changes: 11 additions & 1 deletion config/crd/bases/grafana.integreatly.org_grafanas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ spec:
singular: grafana
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.stage
name: Stage
type: string
- jsonPath: .status.stageStatus
name: Stage status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand Down
13 changes: 12 additions & 1 deletion config/grafana.integreatly.org_grafanadashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ spec:
singular: grafanadashboard
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- format: date-time
jsonPath: .status.lastResync
name: Last resync
type: date
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: GrafanaDashboard is the Schema for the grafanadashboards API
Expand Down
9 changes: 8 additions & 1 deletion config/grafana.integreatly.org_grafanadatasources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ spec:
singular: grafanadatasource
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: GrafanaDatasource is the Schema for the grafanadatasources API
Expand Down
9 changes: 8 additions & 1 deletion config/grafana.integreatly.org_grafanafolders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ spec:
singular: grafanafolder
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: GrafanaFolder is the Schema for the grafanafolders API
Expand Down
12 changes: 11 additions & 1 deletion config/grafana.integreatly.org_grafanas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ spec:
singular: grafana
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.stage
name: Stage
type: string
- jsonPath: .status.stageStatus
name: Stage status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: Grafana is the Schema for the grafanas API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ spec:
singular: grafanadashboard
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- format: date-time
jsonPath: .status.lastResync
name: Last resync
type: date
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ spec:
singular: grafanadatasource
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ spec:
singular: grafanafolder
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ spec:
singular: grafana
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.stage
name: Stage
type: string
- jsonPath: .status.stageStatus
name: Stage status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand Down
43 changes: 39 additions & 4 deletions deploy/kustomize/base/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ spec:
singular: grafanadashboard
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- format: date-time
jsonPath: .status.lastResync
name: Last resync
type: date
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: GrafanaDashboard is the Schema for the grafanadashboards API
Expand Down Expand Up @@ -192,7 +203,14 @@ spec:
singular: grafanadatasource
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: GrafanaDatasource is the Schema for the grafanadatasources API
Expand Down Expand Up @@ -400,7 +418,14 @@ spec:
singular: grafanafolder
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.NoMatchingInstances
name: No matching instances
type: boolean
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: GrafanaFolder is the Schema for the grafanafolders API
Expand Down Expand Up @@ -516,7 +541,17 @@ spec:
singular: grafana
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.stage
name: Stage
type: string
- jsonPath: .status.stageStatus
name: Stage status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: Grafana is the Schema for the grafanas API
Expand Down

0 comments on commit 2332f33

Please sign in to comment.