Skip to content

Commit

Permalink
Annotate CRD structs with categories
Browse files Browse the repository at this point in the history
  • Loading branch information
Baarsgaard committed Aug 26, 2024
1 parent c3a0c18 commit b6f9cff
Show file tree
Hide file tree
Showing 18 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/v1beta1/grafana_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type OperatorReconcileVars struct {
}

// GrafanaSpec defines the desired state of Grafana
// +kubebuilder:resource:categories={grafanacrs,grafana-operator}
type GrafanaSpec struct {
// +kubebuilder:pruning:PreserveUnknownFields
// Config defines how your grafana ini file should looks like.
Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/grafanaalertrulegroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ type GrafanaAlertRuleGroupStatus struct {
//+kubebuilder:subresource:status

// GrafanaAlertRuleGroup is the Schema for the grafanaalertrulegroups API
// +kubebuilder:resource:categories={grafanacrs,grafana-operator}
type GrafanaAlertRuleGroup struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/grafanacontactpoint_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type GrafanaContactPointStatus struct {
//+kubebuilder:subresource:status

// GrafanaContactPoint is the Schema for the grafanacontactpoints API
// +kubebuilder:resource:categories={grafanacrs,grafana-operator}
type GrafanaContactPoint struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/grafanadashboard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type GrafanaDashboardDatasource struct {
// GrafanaDashboardSpec defines the desired state of GrafanaDashboard
// +kubebuilder:validation:XValidation:rule="(has(self.folderUID) && !(has(self.folderRef))) || (has(self.folderRef) && !(has(self.folderUID))) || !(has(self.folderRef) && (has(self.folderUID)))", message="Only one of folderUID or folderRef can be declared at the same time"
// +kubebuilder:validation:XValidation:rule="(has(self.folder) && !(has(self.folderRef) || has(self.folderUID))) || !(has(self.folder))", message="folder field cannot be set when folderUID or folderRef is already declared"
// +kubebuilder:resource:categories={grafanacrs,grafana-operator}
type GrafanaDashboardSpec struct {
// dashboard json
// +optional
Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/grafanadatasource_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ type GrafanaDatasourceStatus struct {
// +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=""
// +kubebuilder:resource:categories={grafanacrs,grafana-operator}
type GrafanaDatasource struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/grafanafolder_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ type GrafanaFolderStatus struct {
// 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=""
// +kubebuilder:resource:categories={grafanacrs,grafana-operator}
type GrafanaFolder struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/grafananotificationpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ type GrafanaNotificationPolicyStatus struct {
//+kubebuilder:subresource:status

// GrafanaNotificationPolicy is the Schema for the GrafanaNotificationPolicy API
// +kubebuilder:resource:categories={grafanacrs,grafana-operator}
type GrafanaNotificationPolicy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaAlertRuleGroup
listKind: GrafanaAlertRuleGroupList
plural: grafanaalertrulegroups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaContactPoint
listKind: GrafanaContactPointList
plural: grafanacontactpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaDatasource
listKind: GrafanaDatasourceList
plural: grafanadatasources
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/grafana.integreatly.org_grafanafolders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaFolder
listKind: GrafanaFolderList
plural: grafanafolders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaNotificationPolicy
listKind: GrafanaNotificationPolicyList
plural: grafananotificationpolicies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaAlertRuleGroup
listKind: GrafanaAlertRuleGroupList
plural: grafanaalertrulegroups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaContactPoint
listKind: GrafanaContactPointList
plural: grafanacontactpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaDatasource
listKind: GrafanaDatasourceList
plural: grafanadatasources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaFolder
listKind: GrafanaFolderList
plural: grafanafolders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaNotificationPolicy
listKind: GrafanaNotificationPolicyList
plural: grafananotificationpolicies
Expand Down
15 changes: 15 additions & 0 deletions deploy/kustomize/base/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaAlertRuleGroup
listKind: GrafanaAlertRuleGroupList
plural: grafanaalertrulegroups
Expand Down Expand Up @@ -316,6 +319,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaContactPoint
listKind: GrafanaContactPointList
plural: grafanacontactpoints
Expand Down Expand Up @@ -984,6 +990,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaDatasource
listKind: GrafanaDatasourceList
plural: grafanadatasources
Expand Down Expand Up @@ -1237,6 +1246,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaFolder
listKind: GrafanaFolderList
plural: grafanafolders
Expand Down Expand Up @@ -1457,6 +1469,9 @@ metadata:
spec:
group: grafana.integreatly.org
names:
categories:
- grafanacrs
- grafana-operator
kind: GrafanaNotificationPolicy
listKind: GrafanaNotificationPolicyList
plural: grafananotificationpolicies
Expand Down

0 comments on commit b6f9cff

Please sign in to comment.