// unitDescription creates the description of a unit func unitDescription(t *jobs.Task, prefix string, scalingGroup uint) string { descriptionPostfix := fmt.Sprintf("[slice %d]", scalingGroup) if t.GroupGlobal() { descriptionPostfix = "[global]" } return fmt.Sprintf("%s unit for %s %s", prefix, t.FullName(), descriptionPostfix) }
// unitNameExt returns the name of the systemd unit for this task. func unitNameExt(t *jobs.Task, kind string, scalingGroup string) string { base := strings.Replace(t.FullName(), "/", "-", -1) + kind if t.GroupGlobal() && t.GroupCount() == 1 { return base } return fmt.Sprintf("%s@%v", base, scalingGroup) }