Skip to content

Commit

Permalink
nomad: recanonicalize network after connect hook (#8407)
Browse files Browse the repository at this point in the history
* nomad: recanonicalize network after connect hook
  • Loading branch information
nickethier committed Jul 10, 2020
1 parent 1f09855 commit 3962eec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nomad/job_endpoint_hook_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions nomad/job_endpoint_hook_connect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 3962eec

Please sign in to comment.