mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Playlist: Add internal API version (#77318)
This commit is contained in:
@@ -307,6 +307,9 @@ func (s *service) start(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if g == nil {
|
||||
continue
|
||||
}
|
||||
err = server.InstallAPIGroup(g)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -287,7 +287,10 @@ func (s *Storage) Watch(ctx context.Context, key string, opts storage.ListOption
|
||||
// match 'opts.ResourceVersion' according 'opts.ResourceVersionMatch'.
|
||||
func (s *Storage) Get(ctx context.Context, key string, opts storage.GetOptions, objPtr runtime.Object) error {
|
||||
filename := s.filePath(key)
|
||||
if !exists(filename) {
|
||||
obj, err := readFile(s.codec, filename, func() runtime.Object {
|
||||
return objPtr
|
||||
})
|
||||
if err != nil {
|
||||
if opts.IgnoreNotFound {
|
||||
return runtime.SetZeroValue(objPtr)
|
||||
}
|
||||
@@ -298,13 +301,6 @@ func (s *Storage) Get(ctx context.Context, key string, opts storage.GetOptions,
|
||||
return storage.NewKeyNotFoundError(key, int64(rv))
|
||||
}
|
||||
|
||||
obj, err := readFile(s.codec, filename, func() runtime.Object {
|
||||
return objPtr
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
currentVersion, err := s.Versioner().ObjectResourceVersion(obj)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user