Chore: Upgrade k8s.io/api v0.34.1 and grafana-app-sdk v0.43.1 (#111009)

This commit is contained in:
Ryan McKinley
2025-09-16 13:35:20 +03:00
committed by GitHub
parent c251ebf4d5
commit 0a79b3bdc5
142 changed files with 4404 additions and 2627 deletions
@@ -0,0 +1,97 @@
package v0alpha1
import (
"context"
"github.com/grafana/grafana-app-sdk/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type DashboardClient struct {
client *resource.TypedClient[*Dashboard, *DashboardList]
}
func NewDashboardClient(client resource.Client) *DashboardClient {
return &DashboardClient{
client: resource.NewTypedClient[*Dashboard, *DashboardList](client, DashboardKind()),
}
}
func NewDashboardClientFromGenerator(generator resource.ClientGenerator) (*DashboardClient, error) {
c, err := generator.ClientFor(DashboardKind())
if err != nil {
return nil, err
}
return NewDashboardClient(c), nil
}
func (c *DashboardClient) Get(ctx context.Context, identifier resource.Identifier) (*Dashboard, error) {
return c.client.Get(ctx, identifier)
}
func (c *DashboardClient) List(ctx context.Context, namespace string, opts resource.ListOptions) (*DashboardList, error) {
return c.client.List(ctx, namespace, opts)
}
func (c *DashboardClient) ListAll(ctx context.Context, namespace string, opts resource.ListOptions) (*DashboardList, error) {
resp, err := c.client.List(ctx, namespace, resource.ListOptions{
ResourceVersion: opts.ResourceVersion,
Limit: opts.Limit,
LabelFilters: opts.LabelFilters,
FieldSelectors: opts.FieldSelectors,
})
if err != nil {
return nil, err
}
for resp.GetContinue() != "" {
page, err := c.client.List(ctx, namespace, resource.ListOptions{
Continue: resp.GetContinue(),
ResourceVersion: opts.ResourceVersion,
Limit: opts.Limit,
LabelFilters: opts.LabelFilters,
FieldSelectors: opts.FieldSelectors,
})
if err != nil {
return nil, err
}
resp.SetContinue(page.GetContinue())
resp.SetResourceVersion(page.GetResourceVersion())
resp.SetItems(append(resp.GetItems(), page.GetItems()...))
}
return resp, nil
}
func (c *DashboardClient) Create(ctx context.Context, obj *Dashboard, opts resource.CreateOptions) (*Dashboard, error) {
// Make sure apiVersion and kind are set
obj.APIVersion = GroupVersion.Identifier()
obj.Kind = DashboardKind().Kind()
return c.client.Create(ctx, obj, opts)
}
func (c *DashboardClient) Update(ctx context.Context, obj *Dashboard, opts resource.UpdateOptions) (*Dashboard, error) {
return c.client.Update(ctx, obj, opts)
}
func (c *DashboardClient) Patch(ctx context.Context, identifier resource.Identifier, req resource.PatchRequest, opts resource.PatchOptions) (*Dashboard, error) {
return c.client.Patch(ctx, identifier, req, opts)
}
func (c *DashboardClient) UpdateStatus(ctx context.Context, newStatus DashboardStatus, opts resource.UpdateOptions) (*Dashboard, error) {
return c.client.Update(ctx, &Dashboard{
TypeMeta: metav1.TypeMeta{
Kind: DashboardKind().Kind(),
APIVersion: GroupVersion.Identifier(),
},
ObjectMeta: metav1.ObjectMeta{
ResourceVersion: opts.ResourceVersion,
},
Status: newStatus,
}, resource.UpdateOptions{
Subresource: "status",
ResourceVersion: opts.ResourceVersion,
})
}
func (c *DashboardClient) Delete(ctx context.Context, identifier resource.Identifier, opts resource.DeleteOptions) error {
return c.client.Delete(ctx, identifier, opts)
}
@@ -19,6 +19,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1.AnnotationPermission": schema_pkg_apis_dashboard_v0alpha1_AnnotationPermission(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1.Dashboard": schema_pkg_apis_dashboard_v0alpha1_Dashboard(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1.DashboardAccess": schema_pkg_apis_dashboard_v0alpha1_DashboardAccess(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1.DashboardClient": schema_pkg_apis_dashboard_v0alpha1_DashboardClient(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1.DashboardConversionStatus": schema_pkg_apis_dashboard_v0alpha1_DashboardConversionStatus(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1.DashboardHit": schema_pkg_apis_dashboard_v0alpha1_DashboardHit(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1.DashboardJSONCodec": schema_pkg_apis_dashboard_v0alpha1_DashboardJSONCodec(ref),
@@ -221,6 +222,26 @@ func schema_pkg_apis_dashboard_v0alpha1_DashboardAccess(ref common.ReferenceCall
}
}
func schema_pkg_apis_dashboard_v0alpha1_DashboardClient(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"client": {
SchemaProps: spec.SchemaProps{
Ref: ref("github.com/grafana/grafana-app-sdk/resource.TypedClient[T,L]"),
},
},
},
Required: []string{"client"},
},
},
Dependencies: []string{
"github.com/grafana/grafana-app-sdk/resource.TypedClient[T,L]"},
}
}
func schema_pkg_apis_dashboard_v0alpha1_DashboardConversionStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -5,6 +5,7 @@ API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/
API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1,LibraryPanelStatus,Warnings
API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1,SearchResults,Hits
API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1,SortableFields,Fields
API rule violation: names_match,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1,DashboardClient,client
API rule violation: names_match,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1,SortBy,Descending
API rule violation: names_match,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1,SortableField,Field
API rule violation: names_match,github.com/grafana/grafana/pkg/apimachinery/apis/common/v0alpha1,Unstructured,Object
@@ -0,0 +1,97 @@
package v1beta1
import (
"context"
"github.com/grafana/grafana-app-sdk/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type DashboardClient struct {
client *resource.TypedClient[*Dashboard, *DashboardList]
}
func NewDashboardClient(client resource.Client) *DashboardClient {
return &DashboardClient{
client: resource.NewTypedClient[*Dashboard, *DashboardList](client, DashboardKind()),
}
}
func NewDashboardClientFromGenerator(generator resource.ClientGenerator) (*DashboardClient, error) {
c, err := generator.ClientFor(DashboardKind())
if err != nil {
return nil, err
}
return NewDashboardClient(c), nil
}
func (c *DashboardClient) Get(ctx context.Context, identifier resource.Identifier) (*Dashboard, error) {
return c.client.Get(ctx, identifier)
}
func (c *DashboardClient) List(ctx context.Context, namespace string, opts resource.ListOptions) (*DashboardList, error) {
return c.client.List(ctx, namespace, opts)
}
func (c *DashboardClient) ListAll(ctx context.Context, namespace string, opts resource.ListOptions) (*DashboardList, error) {
resp, err := c.client.List(ctx, namespace, resource.ListOptions{
ResourceVersion: opts.ResourceVersion,
Limit: opts.Limit,
LabelFilters: opts.LabelFilters,
FieldSelectors: opts.FieldSelectors,
})
if err != nil {
return nil, err
}
for resp.GetContinue() != "" {
page, err := c.client.List(ctx, namespace, resource.ListOptions{
Continue: resp.GetContinue(),
ResourceVersion: opts.ResourceVersion,
Limit: opts.Limit,
LabelFilters: opts.LabelFilters,
FieldSelectors: opts.FieldSelectors,
})
if err != nil {
return nil, err
}
resp.SetContinue(page.GetContinue())
resp.SetResourceVersion(page.GetResourceVersion())
resp.SetItems(append(resp.GetItems(), page.GetItems()...))
}
return resp, nil
}
func (c *DashboardClient) Create(ctx context.Context, obj *Dashboard, opts resource.CreateOptions) (*Dashboard, error) {
// Make sure apiVersion and kind are set
obj.APIVersion = GroupVersion.Identifier()
obj.Kind = DashboardKind().Kind()
return c.client.Create(ctx, obj, opts)
}
func (c *DashboardClient) Update(ctx context.Context, obj *Dashboard, opts resource.UpdateOptions) (*Dashboard, error) {
return c.client.Update(ctx, obj, opts)
}
func (c *DashboardClient) Patch(ctx context.Context, identifier resource.Identifier, req resource.PatchRequest, opts resource.PatchOptions) (*Dashboard, error) {
return c.client.Patch(ctx, identifier, req, opts)
}
func (c *DashboardClient) UpdateStatus(ctx context.Context, newStatus DashboardStatus, opts resource.UpdateOptions) (*Dashboard, error) {
return c.client.Update(ctx, &Dashboard{
TypeMeta: metav1.TypeMeta{
Kind: DashboardKind().Kind(),
APIVersion: GroupVersion.Identifier(),
},
ObjectMeta: metav1.ObjectMeta{
ResourceVersion: opts.ResourceVersion,
},
Status: newStatus,
}, resource.UpdateOptions{
Subresource: "status",
ResourceVersion: opts.ResourceVersion,
})
}
func (c *DashboardClient) Delete(ctx context.Context, identifier resource.Identifier, opts resource.DeleteOptions) error {
return c.client.Delete(ctx, identifier, opts)
}
@@ -19,6 +19,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1.AnnotationPermission": schema_pkg_apis_dashboard_v1beta1_AnnotationPermission(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1.Dashboard": schema_pkg_apis_dashboard_v1beta1_Dashboard(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1.DashboardAccess": schema_pkg_apis_dashboard_v1beta1_DashboardAccess(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1.DashboardClient": schema_pkg_apis_dashboard_v1beta1_DashboardClient(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1.DashboardConversionStatus": schema_pkg_apis_dashboard_v1beta1_DashboardConversionStatus(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1.DashboardJSONCodec": schema_pkg_apis_dashboard_v1beta1_DashboardJSONCodec(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1.DashboardList": schema_pkg_apis_dashboard_v1beta1_DashboardList(ref),
@@ -214,6 +215,26 @@ func schema_pkg_apis_dashboard_v1beta1_DashboardAccess(ref common.ReferenceCallb
}
}
func schema_pkg_apis_dashboard_v1beta1_DashboardClient(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"client": {
SchemaProps: spec.SchemaProps{
Ref: ref("github.com/grafana/grafana-app-sdk/resource.TypedClient[T,L]"),
},
},
},
Required: []string{"client"},
},
},
Dependencies: []string{
"github.com/grafana/grafana-app-sdk/resource.TypedClient[T,L]"},
}
}
func schema_pkg_apis_dashboard_v1beta1_DashboardConversionStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -1,4 +1,5 @@
API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1,DashboardMetadata,Finalizers
API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1,LibraryPanelStatus,Warnings
API rule violation: names_match,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1,DashboardClient,client
API rule violation: names_match,github.com/grafana/grafana/pkg/apimachinery/apis/common/v0alpha1,Unstructured,Object
API rule violation: streaming_list_type_json_tags,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1,DashboardList,ListMeta
@@ -0,0 +1,97 @@
package v2alpha1
import (
"context"
"github.com/grafana/grafana-app-sdk/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type DashboardClient struct {
client *resource.TypedClient[*Dashboard, *DashboardList]
}
func NewDashboardClient(client resource.Client) *DashboardClient {
return &DashboardClient{
client: resource.NewTypedClient[*Dashboard, *DashboardList](client, DashboardKind()),
}
}
func NewDashboardClientFromGenerator(generator resource.ClientGenerator) (*DashboardClient, error) {
c, err := generator.ClientFor(DashboardKind())
if err != nil {
return nil, err
}
return NewDashboardClient(c), nil
}
func (c *DashboardClient) Get(ctx context.Context, identifier resource.Identifier) (*Dashboard, error) {
return c.client.Get(ctx, identifier)
}
func (c *DashboardClient) List(ctx context.Context, namespace string, opts resource.ListOptions) (*DashboardList, error) {
return c.client.List(ctx, namespace, opts)
}
func (c *DashboardClient) ListAll(ctx context.Context, namespace string, opts resource.ListOptions) (*DashboardList, error) {
resp, err := c.client.List(ctx, namespace, resource.ListOptions{
ResourceVersion: opts.ResourceVersion,
Limit: opts.Limit,
LabelFilters: opts.LabelFilters,
FieldSelectors: opts.FieldSelectors,
})
if err != nil {
return nil, err
}
for resp.GetContinue() != "" {
page, err := c.client.List(ctx, namespace, resource.ListOptions{
Continue: resp.GetContinue(),
ResourceVersion: opts.ResourceVersion,
Limit: opts.Limit,
LabelFilters: opts.LabelFilters,
FieldSelectors: opts.FieldSelectors,
})
if err != nil {
return nil, err
}
resp.SetContinue(page.GetContinue())
resp.SetResourceVersion(page.GetResourceVersion())
resp.SetItems(append(resp.GetItems(), page.GetItems()...))
}
return resp, nil
}
func (c *DashboardClient) Create(ctx context.Context, obj *Dashboard, opts resource.CreateOptions) (*Dashboard, error) {
// Make sure apiVersion and kind are set
obj.APIVersion = GroupVersion.Identifier()
obj.Kind = DashboardKind().Kind()
return c.client.Create(ctx, obj, opts)
}
func (c *DashboardClient) Update(ctx context.Context, obj *Dashboard, opts resource.UpdateOptions) (*Dashboard, error) {
return c.client.Update(ctx, obj, opts)
}
func (c *DashboardClient) Patch(ctx context.Context, identifier resource.Identifier, req resource.PatchRequest, opts resource.PatchOptions) (*Dashboard, error) {
return c.client.Patch(ctx, identifier, req, opts)
}
func (c *DashboardClient) UpdateStatus(ctx context.Context, newStatus DashboardStatus, opts resource.UpdateOptions) (*Dashboard, error) {
return c.client.Update(ctx, &Dashboard{
TypeMeta: metav1.TypeMeta{
Kind: DashboardKind().Kind(),
APIVersion: GroupVersion.Identifier(),
},
ObjectMeta: metav1.ObjectMeta{
ResourceVersion: opts.ResourceVersion,
},
Status: newStatus,
}, resource.UpdateOptions{
Subresource: "status",
ResourceVersion: opts.ResourceVersion,
})
}
func (c *DashboardClient) Delete(ctx context.Context, identifier resource.Identifier, opts resource.DeleteOptions) error {
return c.client.Delete(ctx, identifier, opts)
}
@@ -31,6 +31,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1.DashboardAutoGridLayoutKind": schema_pkg_apis_dashboard_v2alpha1_DashboardAutoGridLayoutKind(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1.DashboardAutoGridLayoutSpec": schema_pkg_apis_dashboard_v2alpha1_DashboardAutoGridLayoutSpec(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1.DashboardAutoGridRepeatOptions": schema_pkg_apis_dashboard_v2alpha1_DashboardAutoGridRepeatOptions(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1.DashboardClient": schema_pkg_apis_dashboard_v2alpha1_DashboardClient(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1.DashboardConditionalRenderingDataKind": schema_pkg_apis_dashboard_v2alpha1_DashboardConditionalRenderingDataKind(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1.DashboardConditionalRenderingDataSpec": schema_pkg_apis_dashboard_v2alpha1_DashboardConditionalRenderingDataSpec(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1.DashboardConditionalRenderingGroupKind": schema_pkg_apis_dashboard_v2alpha1_DashboardConditionalRenderingGroupKind(ref),
@@ -956,6 +957,26 @@ func schema_pkg_apis_dashboard_v2alpha1_DashboardAutoGridRepeatOptions(ref commo
}
}
func schema_pkg_apis_dashboard_v2alpha1_DashboardClient(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"client": {
SchemaProps: spec.SchemaProps{
Ref: ref("github.com/grafana/grafana-app-sdk/resource.TypedClient[T,L]"),
},
},
},
Required: []string{"client"},
},
},
Dependencies: []string{
"github.com/grafana/grafana-app-sdk/resource.TypedClient[T,L]"},
}
}
func schema_pkg_apis_dashboard_v2alpha1_DashboardConditionalRenderingDataKind(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -39,6 +39,7 @@ API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/
API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1,DashboardTimeSettingsSpec,QuickRanges
API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1,DashboardV2alpha1FieldConfigSourceOverrides,Properties
API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1,LibraryPanelStatus,Warnings
API rule violation: names_match,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1,DashboardClient,client
API rule violation: names_match,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1,DashboardConditionalRenderingVariableKindOrConditionalRenderingDataKindOrConditionalRenderingTimeRangeSizeKind,ConditionalRenderingDataKind
API rule violation: names_match,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1,DashboardConditionalRenderingVariableKindOrConditionalRenderingDataKindOrConditionalRenderingTimeRangeSizeKind,ConditionalRenderingTimeRangeSizeKind
API rule violation: names_match,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1,DashboardConditionalRenderingVariableKindOrConditionalRenderingDataKindOrConditionalRenderingTimeRangeSizeKind,ConditionalRenderingVariableKind
@@ -0,0 +1,97 @@
package v2beta1
import (
"context"
"github.com/grafana/grafana-app-sdk/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type DashboardClient struct {
client *resource.TypedClient[*Dashboard, *DashboardList]
}
func NewDashboardClient(client resource.Client) *DashboardClient {
return &DashboardClient{
client: resource.NewTypedClient[*Dashboard, *DashboardList](client, DashboardKind()),
}
}
func NewDashboardClientFromGenerator(generator resource.ClientGenerator) (*DashboardClient, error) {
c, err := generator.ClientFor(DashboardKind())
if err != nil {
return nil, err
}
return NewDashboardClient(c), nil
}
func (c *DashboardClient) Get(ctx context.Context, identifier resource.Identifier) (*Dashboard, error) {
return c.client.Get(ctx, identifier)
}
func (c *DashboardClient) List(ctx context.Context, namespace string, opts resource.ListOptions) (*DashboardList, error) {
return c.client.List(ctx, namespace, opts)
}
func (c *DashboardClient) ListAll(ctx context.Context, namespace string, opts resource.ListOptions) (*DashboardList, error) {
resp, err := c.client.List(ctx, namespace, resource.ListOptions{
ResourceVersion: opts.ResourceVersion,
Limit: opts.Limit,
LabelFilters: opts.LabelFilters,
FieldSelectors: opts.FieldSelectors,
})
if err != nil {
return nil, err
}
for resp.GetContinue() != "" {
page, err := c.client.List(ctx, namespace, resource.ListOptions{
Continue: resp.GetContinue(),
ResourceVersion: opts.ResourceVersion,
Limit: opts.Limit,
LabelFilters: opts.LabelFilters,
FieldSelectors: opts.FieldSelectors,
})
if err != nil {
return nil, err
}
resp.SetContinue(page.GetContinue())
resp.SetResourceVersion(page.GetResourceVersion())
resp.SetItems(append(resp.GetItems(), page.GetItems()...))
}
return resp, nil
}
func (c *DashboardClient) Create(ctx context.Context, obj *Dashboard, opts resource.CreateOptions) (*Dashboard, error) {
// Make sure apiVersion and kind are set
obj.APIVersion = GroupVersion.Identifier()
obj.Kind = DashboardKind().Kind()
return c.client.Create(ctx, obj, opts)
}
func (c *DashboardClient) Update(ctx context.Context, obj *Dashboard, opts resource.UpdateOptions) (*Dashboard, error) {
return c.client.Update(ctx, obj, opts)
}
func (c *DashboardClient) Patch(ctx context.Context, identifier resource.Identifier, req resource.PatchRequest, opts resource.PatchOptions) (*Dashboard, error) {
return c.client.Patch(ctx, identifier, req, opts)
}
func (c *DashboardClient) UpdateStatus(ctx context.Context, newStatus DashboardStatus, opts resource.UpdateOptions) (*Dashboard, error) {
return c.client.Update(ctx, &Dashboard{
TypeMeta: metav1.TypeMeta{
Kind: DashboardKind().Kind(),
APIVersion: GroupVersion.Identifier(),
},
ObjectMeta: metav1.ObjectMeta{
ResourceVersion: opts.ResourceVersion,
},
Status: newStatus,
}, resource.UpdateOptions{
Subresource: "status",
ResourceVersion: opts.ResourceVersion,
})
}
func (c *DashboardClient) Delete(ctx context.Context, identifier resource.Identifier, opts resource.DeleteOptions) error {
return c.client.Delete(ctx, identifier, opts)
}
@@ -31,6 +31,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1.DashboardAutoGridLayoutKind": schema_pkg_apis_dashboard_v2beta1_DashboardAutoGridLayoutKind(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1.DashboardAutoGridLayoutSpec": schema_pkg_apis_dashboard_v2beta1_DashboardAutoGridLayoutSpec(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1.DashboardAutoGridRepeatOptions": schema_pkg_apis_dashboard_v2beta1_DashboardAutoGridRepeatOptions(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1.DashboardClient": schema_pkg_apis_dashboard_v2beta1_DashboardClient(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1.DashboardConditionalRenderingDataKind": schema_pkg_apis_dashboard_v2beta1_DashboardConditionalRenderingDataKind(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1.DashboardConditionalRenderingDataSpec": schema_pkg_apis_dashboard_v2beta1_DashboardConditionalRenderingDataSpec(ref),
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1.DashboardConditionalRenderingGroupKind": schema_pkg_apis_dashboard_v2beta1_DashboardConditionalRenderingGroupKind(ref),
@@ -967,6 +968,26 @@ func schema_pkg_apis_dashboard_v2beta1_DashboardAutoGridRepeatOptions(ref common
}
}
func schema_pkg_apis_dashboard_v2beta1_DashboardClient(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"client": {
SchemaProps: spec.SchemaProps{
Ref: ref("github.com/grafana/grafana-app-sdk/resource.TypedClient[T,L]"),
},
},
},
Required: []string{"client"},
},
},
Dependencies: []string{
"github.com/grafana/grafana-app-sdk/resource.TypedClient[T,L]"},
}
}
func schema_pkg_apis_dashboard_v2beta1_DashboardConditionalRenderingDataKind(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -39,6 +39,7 @@ API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/
API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1,DashboardTimeSettingsSpec,QuickRanges
API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1,DashboardV2beta1FieldConfigSourceOverrides,Properties
API rule violation: list_type_missing,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1,LibraryPanelStatus,Warnings
API rule violation: names_match,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1,DashboardClient,client
API rule violation: names_match,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1,DashboardConditionalRenderingVariableKindOrConditionalRenderingDataKindOrConditionalRenderingTimeRangeSizeKind,ConditionalRenderingDataKind
API rule violation: names_match,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1,DashboardConditionalRenderingVariableKindOrConditionalRenderingDataKindOrConditionalRenderingTimeRangeSizeKind,ConditionalRenderingTimeRangeSizeKind
API rule violation: names_match,github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1,DashboardConditionalRenderingVariableKindOrConditionalRenderingDataKindOrConditionalRenderingTimeRangeSizeKind,ConditionalRenderingVariableKind
@@ -11,6 +11,7 @@ import (
"github.com/grafana/grafana-app-sdk/app"
"github.com/grafana/grafana-app-sdk/resource"
"k8s.io/apimachinery/pkg/runtime"
v0alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1"
v1beta1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1"
@@ -110,3 +111,25 @@ func ManifestCustomRouteResponsesAssociator(kind, version, path, verb string) (g
goType, exists = customRouteToGoResponseType[fmt.Sprintf("%s|%s|%s|%s", version, kind, path, strings.ToUpper(verb))]
return goType, exists
}
var customRouteToGoParamsType = map[string]runtime.Object{}
func ManifestCustomRouteQueryAssociator(kind, version, path, verb string) (goType runtime.Object, exists bool) {
if len(path) > 0 && path[0] == '/' {
path = path[1:]
}
goType, exists = customRouteToGoParamsType[fmt.Sprintf("%s|%s|%s|%s", version, kind, path, strings.ToUpper(verb))]
return goType, exists
}
type GoTypeAssociator struct{}
func (g *GoTypeAssociator) KindToGoType(kind, version string) (goType resource.Kind, exists bool) {
return ManifestGoTypeAssociator(kind, version)
}
func (g *GoTypeAssociator) CustomRouteReturnGoType(kind, version, path, verb string) (goType any, exists bool) {
return ManifestCustomRouteResponsesAssociator(kind, version, path, verb)
}
func (g *GoTypeAssociator) CustomRouteQueryGoType(kind, version, path, verb string) (goType runtime.Object, exists bool) {
return ManifestCustomRouteQueryAssociator(kind, version, path, verb)
}
@@ -3,7 +3,6 @@
"apiVersion": "dashboard.grafana.app/v0alpha1",
"metadata": {
"name": "test-v2alpha1-complete",
"creationTimestamp": null,
"labels": {
"category": "test"
},
@@ -3,7 +3,6 @@
"apiVersion": "dashboard.grafana.app/v1beta1",
"metadata": {
"name": "test-v2alpha1-complete",
"creationTimestamp": null,
"labels": {
"category": "test"
},
@@ -3,7 +3,6 @@
"apiVersion": "dashboard.grafana.app/v2beta1",
"metadata": {
"name": "test-v2alpha1-complete",
"creationTimestamp": null,
"labels": {
"category": "test"
},
@@ -2,8 +2,7 @@
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v0alpha1",
"metadata": {
"name": "test-v2alpha1-annotations",
"creationTimestamp": null
"name": "test-v2alpha1-annotations"
},
"spec": null,
"status": {
@@ -2,8 +2,7 @@
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v1beta1",
"metadata": {
"name": "test-v2alpha1-annotations",
"creationTimestamp": null
"name": "test-v2alpha1-annotations"
},
"spec": null,
"status": {
@@ -2,8 +2,7 @@
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2beta1",
"metadata": {
"name": "test-v2alpha1-annotations",
"creationTimestamp": null
"name": "test-v2alpha1-annotations"
},
"spec": {
"annotations": [
@@ -2,8 +2,7 @@
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v0alpha1",
"metadata": {
"name": "test-v2alpha1-groupby-adhoc-vars",
"creationTimestamp": null
"name": "test-v2alpha1-groupby-adhoc-vars"
},
"spec": null,
"status": {
@@ -2,8 +2,7 @@
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v1beta1",
"metadata": {
"name": "test-v2alpha1-groupby-adhoc-vars",
"creationTimestamp": null
"name": "test-v2alpha1-groupby-adhoc-vars"
},
"spec": null,
"status": {
@@ -2,8 +2,7 @@
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2beta1",
"metadata": {
"name": "test-v2alpha1-groupby-adhoc-vars",
"creationTimestamp": null
"name": "test-v2alpha1-groupby-adhoc-vars"
},
"spec": {
"annotations": [],
@@ -2,8 +2,7 @@
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v0alpha1",
"metadata": {
"name": "test-v2alpha1-viz-config",
"creationTimestamp": null
"name": "test-v2alpha1-viz-config"
},
"spec": null,
"status": {
@@ -2,8 +2,7 @@
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v1beta1",
"metadata": {
"name": "test-v2alpha1-viz-config",
"creationTimestamp": null
"name": "test-v2alpha1-viz-config"
},
"spec": null,
"status": {
@@ -2,8 +2,7 @@
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2beta1",
"metadata": {
"name": "test-v2alpha1-viz-config",
"creationTimestamp": null
"name": "test-v2alpha1-viz-config"
},
"spec": {
"annotations": [],