From 48b75183029bcf6aa788460bf182790349321f4b Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Wed, 15 Mar 2017 13:35:50 -0700 Subject: [PATCH] Remove Name field from Object Signed-off-by: Aaron Lehmann --- manager/state/store/clusters.go | 1 - manager/state/store/extensions.go | 1 - manager/state/store/memory.go | 2 +- manager/state/store/networks.go | 1 - manager/state/store/nodes.go | 1 - manager/state/store/object.go | 1 - manager/state/store/resources.go | 1 - manager/state/store/secrets.go | 1 - manager/state/store/services.go | 1 - manager/state/store/tasks.go | 1 - 10 files changed, 1 insertion(+), 10 deletions(-) diff --git a/manager/state/store/clusters.go b/manager/state/store/clusters.go index b5e03c2e4a..a495dacc92 100644 --- a/manager/state/store/clusters.go +++ b/manager/state/store/clusters.go @@ -17,7 +17,6 @@ const ( func init() { register(ObjectStoreConfig{ - Name: tableCluster, Table: &memdb.TableSchema{ Name: tableCluster, Indexes: map[string]*memdb.IndexSchema{ diff --git a/manager/state/store/extensions.go b/manager/state/store/extensions.go index fd70ae5a90..f92db7e6ca 100644 --- a/manager/state/store/extensions.go +++ b/manager/state/store/extensions.go @@ -12,7 +12,6 @@ const tableExtension = "extension" func init() { register(ObjectStoreConfig{ - Name: tableExtension, Table: &memdb.TableSchema{ Name: tableExtension, Indexes: map[string]*memdb.IndexSchema{ diff --git a/manager/state/store/memory.go b/manager/state/store/memory.go index e32d010d7f..28000fabd9 100644 --- a/manager/state/store/memory.go +++ b/manager/state/store/memory.go @@ -73,7 +73,7 @@ var ( func register(os ObjectStoreConfig) { objectStorers = append(objectStorers, os) - schema.Tables[os.Name] = os.Table + schema.Tables[os.Table.Name] = os.Table } // MemoryStore is a concurrency-safe, in-memory implementation of the Store diff --git a/manager/state/store/networks.go b/manager/state/store/networks.go index c54d83994d..df549d429c 100644 --- a/manager/state/store/networks.go +++ b/manager/state/store/networks.go @@ -11,7 +11,6 @@ const tableNetwork = "network" func init() { register(ObjectStoreConfig{ - Name: tableNetwork, Table: &memdb.TableSchema{ Name: tableNetwork, Indexes: map[string]*memdb.IndexSchema{ diff --git a/manager/state/store/nodes.go b/manager/state/store/nodes.go index fa7fbf2cb7..9c036f0210 100644 --- a/manager/state/store/nodes.go +++ b/manager/state/store/nodes.go @@ -12,7 +12,6 @@ const tableNode = "node" func init() { register(ObjectStoreConfig{ - Name: tableNode, Table: &memdb.TableSchema{ Name: tableNode, Indexes: map[string]*memdb.IndexSchema{ diff --git a/manager/state/store/object.go b/manager/state/store/object.go index b9f1f50442..5f495fdfab 100644 --- a/manager/state/store/object.go +++ b/manager/state/store/object.go @@ -8,7 +8,6 @@ import ( // ObjectStoreConfig provides the necessary methods to store a particular object // type inside MemoryStore. type ObjectStoreConfig struct { - Name string Table *memdb.TableSchema Save func(ReadTx, *api.StoreSnapshot) error Restore func(Tx, *api.StoreSnapshot) error diff --git a/manager/state/store/resources.go b/manager/state/store/resources.go index 0f0a66910f..0cbbc34ca6 100644 --- a/manager/state/store/resources.go +++ b/manager/state/store/resources.go @@ -10,7 +10,6 @@ const tableResource = "resource" func init() { register(ObjectStoreConfig{ - Name: tableResource, Table: &memdb.TableSchema{ Name: tableResource, Indexes: map[string]*memdb.IndexSchema{ diff --git a/manager/state/store/secrets.go b/manager/state/store/secrets.go index 28fe9f5a99..203c94c974 100644 --- a/manager/state/store/secrets.go +++ b/manager/state/store/secrets.go @@ -11,7 +11,6 @@ const tableSecret = "secret" func init() { register(ObjectStoreConfig{ - Name: tableSecret, Table: &memdb.TableSchema{ Name: tableSecret, Indexes: map[string]*memdb.IndexSchema{ diff --git a/manager/state/store/services.go b/manager/state/store/services.go index 972115daba..c8394e2c7b 100644 --- a/manager/state/store/services.go +++ b/manager/state/store/services.go @@ -11,7 +11,6 @@ const tableService = "service" func init() { register(ObjectStoreConfig{ - Name: tableService, Table: &memdb.TableSchema{ Name: tableService, Indexes: map[string]*memdb.IndexSchema{ diff --git a/manager/state/store/tasks.go b/manager/state/store/tasks.go index 569acbc321..f97b5584a2 100644 --- a/manager/state/store/tasks.go +++ b/manager/state/store/tasks.go @@ -13,7 +13,6 @@ const tableTask = "task" func init() { register(ObjectStoreConfig{ - Name: tableTask, Table: &memdb.TableSchema{ Name: tableTask, Indexes: map[string]*memdb.IndexSchema{