2024-02-20 11:28:27 -05:00
|
|
|
package v0alpha1
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
|
|
|
"k8s.io/apimachinery/pkg/runtime"
|
|
|
|
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
|
|
|
|
|
2024-02-23 15:15:43 -05:00
|
|
|
common "github.com/grafana/grafana/pkg/apimachinery/apis/common/v0alpha1"
|
2024-02-20 11:28:27 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
GROUP = "scope.grafana.app"
|
|
|
|
|
VERSION = "v0alpha1"
|
|
|
|
|
APIVERSION = GROUP + "/" + VERSION
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var ScopeResourceInfo = common.NewResourceInfo(GROUP, VERSION,
|
|
|
|
|
"scopes", "scope", "Scope",
|
|
|
|
|
func() runtime.Object { return &Scope{} },
|
|
|
|
|
func() runtime.Object { return &ScopeList{} },
|
|
|
|
|
)
|
|
|
|
|
|
2024-03-18 09:22:28 -04:00
|
|
|
var ScopeDashboardResourceInfo = common.NewResourceInfo(GROUP, VERSION,
|
|
|
|
|
"scopedashboards", "scopedashboard", "ScopeDashboard",
|
2024-03-26 15:52:12 +01:00
|
|
|
func() runtime.Object { return &ScopeDashboardBinding{} },
|
|
|
|
|
func() runtime.Object { return &ScopeDashboardBindingList{} },
|
2024-03-18 09:22:28 -04:00
|
|
|
)
|
|
|
|
|
|
2024-02-20 11:28:27 -05:00
|
|
|
var (
|
|
|
|
|
// SchemeGroupVersion is group version used to register these objects
|
|
|
|
|
SchemeGroupVersion = schema.GroupVersion{Group: GROUP, Version: VERSION}
|
|
|
|
|
|
|
|
|
|
// SchemaBuilder is used by standard codegen
|
|
|
|
|
SchemeBuilder runtime.SchemeBuilder
|
|
|
|
|
localSchemeBuilder = &SchemeBuilder
|
|
|
|
|
AddToScheme = localSchemeBuilder.AddToScheme
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
localSchemeBuilder.Register(addKnownTypes)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Adds the list of known types to the given scheme.
|
|
|
|
|
func addKnownTypes(scheme *runtime.Scheme) error {
|
|
|
|
|
scheme.AddKnownTypes(SchemeGroupVersion,
|
|
|
|
|
&Scope{},
|
|
|
|
|
&ScopeList{},
|
2024-03-26 15:52:12 +01:00
|
|
|
&ScopeDashboardBinding{},
|
|
|
|
|
&ScopeDashboardBindingList{},
|
2024-02-20 11:28:27 -05:00
|
|
|
)
|
|
|
|
|
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
|
|
|
|
func Resource(resource string) schema.GroupResource {
|
|
|
|
|
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
|
|
|
|
}
|