fix RenderJobTemplate specIndex error
@@ -94,11 +94,25 @@ func RenderJobTemplates(
// Find job instance that's being rendered
var currentJobInstance *JobInstance
for _, instance := range job.Properties.Quarks.Instances {
+ if len(currentInstanceGroup.AZs) > 0 {
+ for azIndex, az := range currentInstanceGroup.AZs {
+ if instance.AZ == az {
+ if instance.Instance + azIndex*10000 == specIndex {
+ currentJobInstance = &instance
+ break
+ }
+ }
+ }
+ if currentJobInstance != nil {
+ break
+ }
+ } else {
if instance.Index == specIndex {
currentJobInstance = &instance
break
}
}
+ }
if currentJobInstance == nil {
return errors.Errorf("no job instance found for spec index '%d'", specIndex)
}
