From 17d514a3516e4516751c51575ac4c97926e590ea Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Mon, 7 Aug 2017 13:34:47 -0700 Subject: [PATCH] nomad: adding policy table to state store --- nomad/state/schema.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/nomad/state/schema.go b/nomad/state/schema.go index 6d9675c86..b060eda5d 100644 --- a/nomad/state/schema.go +++ b/nomad/state/schema.go @@ -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", + }, + }, + }, + } +}