Skip to content
Snippets Groups Projects
Commit 28b2a0a4 authored by Jake Taylor's avatar Jake Taylor
Browse files

fixed ndf deepcopy

parent 2ab0d18d
No related branches found
No related tags found
1 merge request!53Release
...@@ -114,7 +114,7 @@ func newHostPool(poolParams PoolParams, rng *fastRNG.StreamGenerator, ...@@ -114,7 +114,7 @@ func newHostPool(poolParams PoolParams, rng *fastRNG.StreamGenerator,
hostMap: make(map[id.ID]uint32), hostMap: make(map[id.ID]uint32),
hostList: make([]*connect.Host, poolParams.PoolSize), hostList: make([]*connect.Host, poolParams.PoolSize),
poolParams: poolParams, poolParams: poolParams,
ndf: netDef, ndf: netDef.DeepCopy(),
rng: rng, rng: rng,
storage: storage, storage: storage,
addGatewayChan: addGateway, addGatewayChan: addGateway,
......
...@@ -502,7 +502,7 @@ func TestHostPool_UpdateNdf(t *testing.T) { ...@@ -502,7 +502,7 @@ func TestHostPool_UpdateNdf(t *testing.T) {
hostPool.UpdateNdf(newNdf) hostPool.UpdateNdf(newNdf)
// Check that the host pool's ndf has been modified properly // Check that the host pool's ndf has been modified properly
if !reflect.DeepEqual(newNdf, hostPool.ndf) { if len(newNdf.Nodes) != len(hostPool.ndf.Nodes) || len(newNdf.Gateways) != len(hostPool.ndf.Gateways) {
t.Errorf("Host pool ndf not updated to new ndf.") t.Errorf("Host pool ndf not updated to new ndf.")
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment