-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LibraryPanels: Expose library panels in dashboard apiserver #92213
Conversation
@@ -17,6 +17,9 @@ func GetOpenAPIDefinitions(builders []APIGroupBuilder) common.GetOpenAPIDefiniti | |||
return func(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { | |||
defs := v0alpha1.GetOpenAPIDefinitions(ref) // common grafana apis | |||
maps.Copy(defs, data.GetOpenAPIDefinitions(ref)) | |||
maps.Copy(defs, map[string]common.OpenAPIDefinition{ // TODO -- move to SDK definition above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed when grafana/grafana-plugin-sdk-go#1062 is merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
pkg/apis/dashboard/v0alpha1/types.go
Outdated
// The dashboard body (unstructured for now) | ||
Spec LibraryPanelSpec `json:"spec"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Not sure what you mean by unstructured here, as it seems to have a structure with specific fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the comment! it was unstructured at first... then I got more ambitious
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
This updates the dashboard apiserver so it also returns library panels.
http://localhost:3000/apis/dashboard.grafana.app/v0alpha1/namespaces/default/librarypanels
This includes a slightly improved schema for library panels in k8s -- we can consider using this as a foundation for dashboard panels.
Note: this still requires dev mode and: