@@ -21,7 +21,6 @@ import (
21
21
"k8s.io/apiserver/pkg/storage"
22
22
"k8s.io/apiserver/pkg/storage/storagebackend"
23
23
"k8s.io/apiserver/pkg/storage/storagebackend/factory"
24
- "k8s.io/klog"
25
24
)
26
25
27
26
// StorageDecorator is a function signature for producing a storage.Interface
@@ -33,7 +32,7 @@ type StorageDecorator func(
33
32
newFunc func () runtime.Object ,
34
33
newListFunc func () runtime.Object ,
35
34
getAttrsFunc storage.AttrFunc ,
36
- trigger storage.TriggerPublisherFunc ) (storage.Interface , factory.DestroyFunc )
35
+ trigger storage.TriggerPublisherFunc ) (storage.Interface , factory.DestroyFunc , error )
37
36
38
37
// UndecoratedStorage returns the given a new storage from the given config
39
38
// without any decoration.
@@ -44,17 +43,13 @@ func UndecoratedStorage(
44
43
newFunc func () runtime.Object ,
45
44
newListFunc func () runtime.Object ,
46
45
getAttrsFunc storage.AttrFunc ,
47
- trigger storage.TriggerPublisherFunc ) (storage.Interface , factory.DestroyFunc ) {
46
+ trigger storage.TriggerPublisherFunc ) (storage.Interface , factory.DestroyFunc , error ) {
48
47
return NewRawStorage (config )
49
48
}
50
49
51
50
// NewRawStorage creates the low level kv storage. This is a work-around for current
52
51
// two layer of same storage interface.
53
52
// TODO: Once cacher is enabled on all registries (event registry is special), we will remove this method.
54
- func NewRawStorage (config * storagebackend.Config ) (storage.Interface , factory.DestroyFunc ) {
55
- s , d , err := factory .Create (* config )
56
- if err != nil {
57
- klog .Fatalf ("Unable to create storage backend: config (%v), err (%v)" , config , err )
58
- }
59
- return s , d
53
+ func NewRawStorage (config * storagebackend.Config ) (storage.Interface , factory.DestroyFunc , error ) {
54
+ return factory .Create (* config )
60
55
}
0 commit comments