grafana/pkg/kinds/general.go
Dan Cech d76defe517
K8s: Move GrafanaMetaAccessor into grafana-apiserver and remove usage of kinds metadata (#79602)
* move GrafanaMetaAccessor into pkg/apis, add support for Spec.Title & Spec.Name

* K8s: Move GrafanaMetaAccessor (PR into another) (#79728)

* access titles

* remove title

* remove title

* remove kinds metadata accessor

* remove kinds metadata accessor

* fixes

* error handling

* fix tests

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-01-12 16:18:14 -05:00

19 lines
533 B
Go

package kinds
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// GrafanaResource is a generic kubernetes resource with a helper for the common grafana metadata
// This is a temporary solution until this object (or similar) can be moved to the app-sdk or kindsys
type GrafanaResource[Spec any, Status any] struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec *Spec `json:"spec,omitempty"`
Status *Status `json:"status,omitempty"`
// Avoid extending
_ any `json:"-"`
}