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

Fix jobs-related bug in task conversion
This commit is contained in:
Akihiro Suda 2020-12-03 17:03:52 +09:00 committed by GitHub
commit e16549cbba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}