Commit 81b9213a authored by David Eads's avatar David Eads

expose generic storage factory primitives

parent da62c170
...@@ -192,7 +192,7 @@ func (s *EtcdOptions) ApplyWithStorageFactoryTo(factory serverstorage.StorageFac ...@@ -192,7 +192,7 @@ func (s *EtcdOptions) ApplyWithStorageFactoryTo(factory serverstorage.StorageFac
if err := s.addEtcdHealthEndpoint(c); err != nil { if err := s.addEtcdHealthEndpoint(c); err != nil {
return err return err
} }
c.RESTOptionsGetter = &storageFactoryRestOptionsFactory{Options: *s, StorageFactory: factory} c.RESTOptionsGetter = &StorageFactoryRestOptionsFactory{Options: *s, StorageFactory: factory}
return nil return nil
} }
...@@ -234,12 +234,12 @@ func (f *SimpleRestOptionsFactory) GetRESTOptions(resource schema.GroupResource) ...@@ -234,12 +234,12 @@ func (f *SimpleRestOptionsFactory) GetRESTOptions(resource schema.GroupResource)
return ret, nil return ret, nil
} }
type storageFactoryRestOptionsFactory struct { type StorageFactoryRestOptionsFactory struct {
Options EtcdOptions Options EtcdOptions
StorageFactory serverstorage.StorageFactory StorageFactory serverstorage.StorageFactory
} }
func (f *storageFactoryRestOptionsFactory) GetRESTOptions(resource schema.GroupResource) (generic.RESTOptions, error) { func (f *StorageFactoryRestOptionsFactory) GetRESTOptions(resource schema.GroupResource) (generic.RESTOptions, error) {
storageConfig, err := f.StorageFactory.NewConfig(resource) storageConfig, err := f.StorageFactory.NewConfig(resource)
if err != nil { if err != nil {
return generic.RESTOptions{}, fmt.Errorf("unable to find storage destination for %v, due to %v", resource, err.Error()) return generic.RESTOptions{}, fmt.Errorf("unable to find storage destination for %v, due to %v", resource, err.Error())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment