Skip to content

Commit

Permalink
fix(hatchery): error on sendSpawnInfos
Browse files Browse the repository at this point in the history
  • Loading branch information
fsamin authored and richardlt committed Jan 17, 2020
1 parent d1e0b8b commit 7a2cad4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions engine/hatchery/swarm/swarm_util_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ checkImage:
if !imageFound {
hatchery.SendSpawnInfo(ctx, h, spawnArgs.JobID, sdk.SpawnMsg{
ID: sdk.MsgSpawnInfoHatcheryStartDockerPull.ID,
Args: []interface{}{h.Name, cArgs.image},
Args: []interface{}{h.Name(), cArgs.image},
})

_, next := observability.Span(ctx, "swarm.dockerClient.pullImage", observability.Tag("image", cArgs.image))
Expand All @@ -136,15 +136,15 @@ checkImage:
next()
hatchery.SendSpawnInfo(ctx, h, spawnArgs.JobID, sdk.SpawnMsg{
ID: sdk.MsgSpawnInfoHatcheryEndDockerPullErr.ID,
Args: []interface{}{h.Name, cArgs.image, err},
Args: []interface{}{h.Name(), cArgs.image, err},
})
return sdk.WrapError(err, "Unable to pull image %s on %s", cArgs.image, dockerClient.name)
}
next()

hatchery.SendSpawnInfo(ctx, h, spawnArgs.JobID, sdk.SpawnMsg{
ID: sdk.MsgSpawnInfoHatcheryEndDockerPull.ID,
Args: []interface{}{h.Name, cArgs.image},
Args: []interface{}{h.Name(), cArgs.image},
})
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/hatchery/hatchery.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func canRunJobWithModel(ctx context.Context, h InterfaceWithModels, j workerStar

// SendSpawnInfo sends a spawnInfo
func SendSpawnInfo(ctx context.Context, h Interface, jobID int64, spawnMsg sdk.SpawnMsg) {
if h.CDSClient() == nil {
if h.CDSClient() == nil || jobID == 0 {
return
}
infos := []sdk.SpawnInfo{{RemoteTime: time.Now(), Message: spawnMsg}}
Expand Down

0 comments on commit 7a2cad4

Please sign in to comment.