Skip to content

Commit

Permalink
Fix: Hotfix build container ttl key trimming (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsun-m authored Jan 11, 2025
1 parent 3a39a05 commit e4be950
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/abstractions/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,13 @@ func (is *RuncImageService) monitorImageContainers(ctx context.Context) {
}
}
case common.KeyOperationExpired:
containerId := strings.TrimPrefix(is.keyEventManager.TrimKeyspacePrefix(event.Key), Keys.imageBuildContainerTTL(""))
is.builder.scheduler.Stop(&types.StopContainerArgs{
ContainerId: containerId,
Force: true,
})
if strings.Contains(event.Key, Keys.imageBuildContainerTTL("")) {
containerId := strings.TrimPrefix(is.keyEventManager.TrimKeyspacePrefix(event.Key), Keys.imageBuildContainerTTL(""))
is.builder.scheduler.Stop(&types.StopContainerArgs{
ContainerId: containerId,
Force: true,
})
}
}
case <-ctx.Done():
return
Expand Down

0 comments on commit e4be950

Please sign in to comment.