nomad: adding policy table to state store

This commit is contained in:
Armon Dadgar 2017-08-07 13:34:47 -07:00
parent a0c3787a9e
commit 85cad11885

View file

@ -26,6 +26,7 @@ func stateStoreSchema() *memdb.DBSchema {
evalTableSchema,
allocTableSchema,
vaultAccessorTableSchema,
aclPolicyTableSchema,
}
// Add each of the tables
@ -430,3 +431,21 @@ func vaultAccessorTableSchema() *memdb.TableSchema {
},
}
}
// aclPolicyTableSchema returns the MemDB schema for the policy table.
// This table is used to store the policies which are refrenced by tokens
func aclPolicyTableSchema() *memdb.TableSchema {
return &memdb.TableSchema{
Name: "acl_policy",
Indexes: map[string]*memdb.IndexSchema{
"id": &memdb.IndexSchema{
Name: "id",
AllowMissing: false,
Unique: true,
Indexer: &memdb.StringFieldIndex{
Field: "Name",
},
},
},
}
}