Merge pull request #30251 from hongchaodeng/r2
Automatic merge from submit-queue Move new etcd storage (low level storage) into cacher In an effort for #29888, we are pushing forward this: What? - It changes creating etcd storage.Interface impl into creating config - In creating cacher storage (StorageWithCacher), it passes config created above and new etcd storage inside. Why? - We want to expose the information of (etcd) kv client to cacher. Cacher storage uses this information to talk to remote storage.
This commit is contained in:
@@ -77,11 +77,11 @@ func clientForUser(user string) *http.Client {
|
||||
|
||||
func newRBACAuthorizer(t *testing.T, superUser string, config *master.Config) authorizer.Authorizer {
|
||||
newRESTOptions := func(resource string) generic.RESTOptions {
|
||||
storageInterface, err := config.StorageFactory.New(rbacapi.Resource(resource))
|
||||
storageConfig, err := config.StorageFactory.NewConfig(rbacapi.Resource(resource))
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get storage: %v", err)
|
||||
}
|
||||
return generic.RESTOptions{Storage: storageInterface, Decorator: generic.UndecoratedStorage, ResourcePrefix: resource}
|
||||
return generic.RESTOptions{StorageConfig: storageConfig, Decorator: generic.UndecoratedStorage, ResourcePrefix: resource}
|
||||
}
|
||||
|
||||
roleRegistry := role.NewRegistry(roleetcd.NewREST(newRESTOptions("roles")))
|
||||
|
||||
Reference in New Issue
Block a user