Make TaskList generic

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2022-08-10 14:02:53 -07:00
parent 23f66ece59
commit ff65fc2d0e
7 changed files with 150 additions and 152 deletions

View File

@@ -143,7 +143,7 @@ func NewShimManager(ctx context.Context, config *ManagerConfig) (*ShimManager, e
state: config.State,
containerdAddress: config.Address,
containerdTTRPCAddress: config.TTRPCAddress,
shims: runtime.NewTaskList(),
shims: runtime.NewNSMap[runtime.Task](),
events: config.Events,
containers: config.Store,
schedCore: config.SchedCore,
@@ -167,7 +167,7 @@ type ShimManager struct {
containerdAddress string
containerdTTRPCAddress string
schedCore bool
shims *runtime.TaskList
shims *runtime.NSMap[runtime.Task]
events *exchange.Exchange
containers containers.Store
// runtimePaths is a cache of `runtime names` -> `resolved fs path`

View File

@@ -134,7 +134,7 @@ func loadShim(ctx context.Context, bundle *Bundle, onClose func()) (_ *shimTask,
return s, nil
}
func cleanupAfterDeadShim(ctx context.Context, id, ns string, rt *runtime.TaskList, events *exchange.Exchange, binaryCall *binary) {
func cleanupAfterDeadShim(ctx context.Context, id, ns string, rt *runtime.NSMap[runtime.Task], events *exchange.Exchange, binaryCall *binary) {
ctx = namespaces.WithNamespace(ctx, ns)
ctx, cancel := timeout.WithContext(ctx, cleanupTimeout)
defer cancel()