mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
K8s: Move shared apis to a common folder with shared openapi spec (#80484)
This commit is contained in:
@@ -6,12 +6,15 @@ import (
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
common "k8s.io/kube-openapi/pkg/common"
|
||||
spec "k8s.io/kube-openapi/pkg/validation/spec"
|
||||
|
||||
"github.com/grafana/grafana/pkg/apis/common/v0alpha1"
|
||||
)
|
||||
|
||||
// This should eventually live in grafana-app-sdk
|
||||
func GetOpenAPIDefinitions(builders []APIGroupBuilder) common.GetOpenAPIDefinitions {
|
||||
return func(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
|
||||
defs := getStandardOpenAPIDefinitions(ref)
|
||||
maps.Copy(defs, v0alpha1.GetOpenAPIDefinitions(ref)) // common grafana apis
|
||||
for _, builder := range builders {
|
||||
g := builder.GetOpenAPIDefinitions()
|
||||
if g != nil {
|
||||
|
||||
Reference in New Issue
Block a user