-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
It would be useful to allow users to use an attribute on a CUE field to specify that it is a reference to another app platform kind (and how that reference is structured), so that we could then use an extension on the generated OpenAPI (for CRD or API Server OpenAPI) to allow a service to "discover" app platform references in kind schemas, and be able to construct a graph of relationships, or work based on specific kinds of references.
Something like
schema: {
spec: {
relatedDashboard: string @grafanaappsdk(type="ref" kind="Dashboard" group="dashboard.grafana.app" name=".") // use '.' to designate the value of the field
relatedObject: {
kind: string
group: string
namespace: string
name: string
} @grafanappsdk(type="ref" kind=".kind" group=".group" namespace=".namespace" name=".name") // we could probably have the same-name fields be defaulted to those values?
}
}Which would manifest on an extension for each of these fields like:
{
"relatedDashboard": {
"type": "string"
"x-grafana-object-ref": {
"kind": "Dashboard",
"group": "dashboard.grafana.app",
"name": "."
}
},
"relatedObject": {
"$ref": "#/components/schemas/relatedObject",
"x-grafana-object-ref": {
"kind": ".kind",
"group": ".group",
"namespace": ".namespace",
"name": ".name"
}
}
}But this should be modified to best fit the use-case. Discuss with @bcotton to work out the best layout for this.
Reactions are currently unavailable