Playlist: Add internal API version (#77318)

This commit is contained in:
Todd Treece
2023-11-01 09:44:04 -04:00
committed by GitHub
parent e8f0f6b7c8
commit 384f5ccdc6
17 changed files with 553 additions and 68 deletions

View File

@@ -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

View File

@@ -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