Chore: Use Kind().GroupVersionResource() (#113133)
This commit is contained in:
@@ -10,7 +10,6 @@ import (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/internalversion"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apiserver/pkg/registry/rest"
|
||||
|
||||
playlist "github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1"
|
||||
@@ -87,10 +86,7 @@ func (s *legacyStorage) Get(ctx context.Context, name string, options *metav1.Ge
|
||||
})
|
||||
if err != nil || dto == nil {
|
||||
if errors.Is(err, playlistsvc.ErrPlaylistNotFound) || err == nil {
|
||||
err = k8serrors.NewNotFound(schema.GroupResource{
|
||||
Group: playlist.PlaylistKind().Group(),
|
||||
Resource: playlist.PlaylistKind().Plural(),
|
||||
}, name)
|
||||
err = k8serrors.NewNotFound(playlist.PlaylistKind().GroupVersionResource().GroupResource(), name)
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -65,11 +65,7 @@ func RegisterAppInstaller(
|
||||
|
||||
// GetLegacyStorage returns the legacy storage for the playlist app.
|
||||
func (p *PlaylistAppInstaller) GetLegacyStorage(requested schema.GroupVersionResource) grafanarest.Storage {
|
||||
gvr := schema.GroupVersionResource{
|
||||
Group: playlistv0alpha1.PlaylistKind().Group(),
|
||||
Version: playlistv0alpha1.PlaylistKind().Version(),
|
||||
Resource: playlistv0alpha1.PlaylistKind().Plural(),
|
||||
}
|
||||
gvr := playlistv0alpha1.PlaylistKind().GroupVersionResource()
|
||||
if requested.String() != gvr.String() {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user