Add CSINode to storage/v1

This commit is contained in:
Michelle Au
2019-10-02 18:47:48 -07:00
parent 2a1ac8bb8c
commit 603a2aa8a9
11 changed files with 127 additions and 17 deletions

View File

@@ -135,6 +135,15 @@ func (p RESTStorageProvider) v1Storage(apiResourceConfigSource serverstorage.API
"volumeattachments/status": volumeAttachmentStorage.Status,
}
// register csinodes if CSINodeInfo feature gate is enabled
if utilfeature.DefaultFeatureGate.Enabled(features.CSINodeInfo) {
csiNodeStorage, err := csinodestore.NewStorage(restOptionsGetter)
if err != nil {
return nil, err
}
storage["csinodes"] = csiNodeStorage.CSINode
}
return storage, nil
}