K8s/Dashboards: Generate Dashboards k8s APIs using Grafana App SDK (#99966)
* Generate Dashboard kinds with `grafana-app-sdk` Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Hack together a fix for invalid TS codegen for v0 & v1 Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Address Go linter issues Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Address TS linter issues Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Add new app to CODEOWNERS Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Fix a couple of issues detected by tests Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Update OpenAPI definitions and test files Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Remove title from Dashboard v1alpha1 spec Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Remove unused CUE schemas Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * remove unrelated files * allow any in the generated betterer * Add a comment explaining why we don't use deepcopy-gen Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Default to v2alpha1 if dashboards v2 FF is enabled Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> --------- Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
co-authored by
Ryan McKinley
parent
3fffb2872e
commit
ea89a68028
@@ -0,0 +1,18 @@
|
||||
.PHONY: generate
|
||||
generate:
|
||||
@grafana-app-sdk generate \
|
||||
--source=./kinds/ \
|
||||
--gogenpath=../../pkg/apis \
|
||||
--tsgenpath=../../packages/grafana-schema/src/schema \
|
||||
--grouping=group \
|
||||
--defencoding=none \
|
||||
--genoperatorstate=false \
|
||||
--noschemasinmanifest
|
||||
|
||||
# This is a workaround for SDK codegen not producing correct output for v0alpha1
|
||||
@rm ../../packages/grafana-schema/src/schema/dashboard/v0alpha1/types.spec.gen.ts
|
||||
@cp ./tshack/v0alpha1_spec_gen.ts ../../packages/grafana-schema/src/schema/dashboard/v0alpha1/types.spec.gen.ts
|
||||
|
||||
# Same for v1alpha1
|
||||
@rm ../../packages/grafana-schema/src/schema/dashboard/v1alpha1/types.spec.gen.ts
|
||||
@cp ./tshack/v1alpha1_spec_gen.ts ../../packages/grafana-schema/src/schema/dashboard/v1alpha1/types.spec.gen.ts
|
||||
Reference in New Issue
Block a user