nomad: recanonicalize network after connect hook (#8407)

* nomad: recanonicalize network after connect hook
This commit is contained in:
Nick Ethier
2020-07-10 10:59:51 -04:00
committed by GitHub
parent 1f09855cd4
commit 3962eecc25
2 changed files with 4 additions and 0 deletions

View File

@@ -178,6 +178,9 @@ func groupConnectHook(job *structs.Job, g *structs.TaskGroup) error {
}
}
}
// re-canonicalize group network since this hook runs after canonicalizaton
g.Networks[0].Canonicalize()
return nil
}

View File

@@ -100,6 +100,7 @@ func TestJobEndpointConnect_groupConnectHook(t *testing.T) {
To: -1,
},
}
tgOut.Networks[0].Canonicalize()
require.NoError(t, groupConnectHook(job, job.TaskGroups[0]))
require.Exactly(t, tgOut, job.TaskGroups[0])