func (spec *workSpec) SetMeta(meta coordinate.WorkSpecMeta) error { return spec.do(func() error { // Preserve immutable fields (taking advantage of meta pass-by-value) meta.CanBeContinuous = spec.meta.CanBeContinuous meta.NextWorkSpecName = spec.meta.NextWorkSpecName meta.Runtime = spec.meta.Runtime // If this cannot be continuous, force-clear that flag if !meta.CanBeContinuous { meta.Continuous = false } spec.meta = meta return nil }) }