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
@@ -7,9 +7,6 @@ import (
"maps"
"time"
appsdkapiserver "github.com/grafana/grafana-app-sdk/k8s/apiserver"
"github.com/grafana/grafana-app-sdk/logging"
"github.com/grafana/grafana/pkg/storage/legacysql/dualwrite"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apiserver/pkg/admission"
@@ -19,6 +16,10 @@ import (
serverstore "k8s.io/apiserver/pkg/server/storage"
"k8s.io/kube-openapi/pkg/common"
appsdkapiserver "github.com/grafana/grafana-app-sdk/k8s/apiserver"
"github.com/grafana/grafana-app-sdk/logging"
"github.com/grafana/grafana/pkg/storage/legacysql/dualwrite"
grafanarest "github.com/grafana/grafana/pkg/apiserver/rest"
"github.com/grafana/grafana/pkg/services/apiserver/builder"
"github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
@@ -5,6 +5,7 @@ import (
"fmt"
"strings"
"github.com/emicklei/go-restful/v3"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apiserver/pkg/registry/generic"
genericregistry "k8s.io/apiserver/pkg/registry/generic/registry"
@@ -26,7 +27,7 @@ var _ appsdkapiserver.GenericAPIServer = (*serverWrapper)(nil)
type serverWrapper struct {
ctx context.Context
appsdkapiserver.GenericAPIServer
*genericapiserver.GenericAPIServer
installer appsdkapiserver.AppInstaller
restOptionsGetter generic.RESTOptionsGetter
storageOpts *grafanaapiserveroptions.StorageOptions
@@ -117,3 +118,7 @@ func (s *serverWrapper) configureStorage(gr schema.GroupResource, dualWriteSuppo
return storage
}
func (s *serverWrapper) RegisteredWebServices() []*restful.WebService {
return []*restful.WebService{}
}
+7 -2
View File
@@ -44,11 +44,16 @@ func (o *ExtraOptions) ApplyTo(c *genericapiserver.RecommendedConfig) error {
handler := slogadapter.New(log.New("grafana-apiserver"))
logger := slog.New(handler)
if err := utilfeature.DefaultMutableFeatureGate.SetFromMap(map[string]bool{
string(genericfeatures.APIServerTracing): false,
string(genericfeatures.WatchList): true,
string(genericfeatures.WatchList): true,
}); err != nil {
return err
}
// disabling configured trace provider
if c.TracerProvider != nil {
c.TracerProvider = nil
}
// if verbosity is 8+, response bodies will be logged. versboity of 7 should then be the max
if o.Verbosity > 7 {
o.Verbosity = 7
@@ -15,7 +15,6 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
claims "github.com/grafana/authlib/types"
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1"
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1"
"github.com/grafana/grafana/pkg/apimachinery/identity"
@@ -458,8 +457,10 @@ func TestRestoreVersion(t *testing.T) {
result, err := dashboardVersionService.RestoreVersion(context.Background(), cmd)
require.Error(t, err)
require.Nil(t, result)
require.ErrorIs(t, err, dashboards.ErrDashboardNotFound)
if !apierrors.IsNotFound(err) {
require.ErrorIs(t, err, dashboards.ErrDashboardNotFound)
}
dashboardService.AssertExpectations(t)
})