Unverified Commit 2f11a06f authored by Lang Martin's avatar Lang Martin Committed by Danielle Lancashire
Browse files

schema: csi_volumes schema

parent 56c5ac5c
Showing with 44 additions and 0 deletions
+44 -0
......@@ -47,6 +47,7 @@ func init() {
autopilotConfigTableSchema,
schedulerConfigTableSchema,
clusterMetaTableSchema,
csiVolumeTableSchema,
}...)
}
......@@ -677,3 +678,46 @@ func clusterMetaTableSchema() *memdb.TableSchema {
},
}
}
func csiVolumeTableSchema() *memdb.TableSchema {
return &memdb.TableSchema{
Name: "csi_volumes",
Indexes: map[string]*memdb.IndexSchema{
// Primary index is used for volume upsert
// and simple direct lookup. ID is required to be
// unique.
"id": {
Name: "id",
AllowMissing: false,
Unique: true,
// Use a compound so (Namespace, ID) is unique
Indexer: &memdb.CompoundIndex{
Indexes: []memdb.Indexer{
&memdb.StringFieldIndex{
Field: "Namespace",
},
&memdb.StringFieldIndex{
Field: "ID",
},
},
},
},
"driver": {
Name: "driver",
AllowMissing: false,
Unique: false,
Indexer: &memdb.CompoundIndex{
Indexes: []memdb.Indexer{
&memdb.StringFieldIndex{
Field: "Namespace",
},
&memdb.StringFieldIndex{
Field: "Driver",
},
},
},
},
},
}
}
Supports Markdown
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