소스 검색

Merge pull request #41742 from dperny/fix-jobs-convert

Fix jobs-related bug in task conversion
Akihiro Suda 4 년 전
부모
커밋
e16549cbba
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      daemon/cluster/convert/task.go

+ 6 - 6
daemon/cluster/convert/task.go

@@ -51,6 +51,12 @@ func TaskFromGRPC(t swarmapi.Task) (types.Task, error) {
 		task.NetworksAttachments = append(task.NetworksAttachments, networkAttachmentFromGRPC(na))
 	}
 
+	if t.JobIteration != nil {
+		task.JobIteration = &types.Version{
+			Index: t.JobIteration.Index,
+		}
+	}
+
 	if t.Status.PortStatus == nil {
 		return task, nil
 	}
@@ -65,11 +71,5 @@ func TaskFromGRPC(t swarmapi.Task) (types.Task, error) {
 		})
 	}
 
-	if t.JobIteration != nil {
-		task.JobIteration = &types.Version{
-			Index: t.JobIteration.Index,
-		}
-	}
-
 	return task, nil
 }