client/driver/env: use 'job.Dispatch' to trigger optional meta logic

This commit is contained in:
Nick Ethier
2018-06-11 12:01:19 -04:00
parent e8f9b40321
commit e325e85a19

View File

@@ -402,7 +402,7 @@ func (b *Builder) setAlloc(alloc *structs.Allocation) *Builder {
taskMetaSize := len(combined) * 2
// if job is parameterized initialize optional meta to empty strings
if alloc.Job.IsParameterized() {
if alloc.Job.Dispatched {
b.taskMeta = make(map[string]string,
taskMetaSize+(len(alloc.Job.ParameterizedJob.MetaOptional)*2))