diff --git a/shim/container.go b/shim/container.go index 0b90130..3ce79b5 100644 --- a/shim/container.go +++ b/shim/container.go @@ -130,17 +130,17 @@ func (c *Container) Config() *v1.Config { return c.cfg } -func (c *Container) ScheduleScaleDown() error { - return c.scheduleScaleDownIn(c.cfg.ScaleDownDuration) +func (c *Container) ScheduleScaleDown() { + c.scheduleScaleDownIn(c.cfg.ScaleDownDuration) } -func (c *Container) scheduleScaleDownIn(in time.Duration) error { +func (c *Container) scheduleScaleDownIn(in time.Duration) { // cancel any potential pending scaledonws c.CancelScaleDown() if in == 0 { log.G(c.context).Info("scale down is disabled") - return nil + return } log.G(c.context).Infof("scheduling scale down in %s", in) @@ -182,7 +182,6 @@ func (c *Container) scheduleScaleDownIn(in time.Duration) error { } }) c.scaleDownTimer = timer - return nil } func (c *Container) CancelScaleDown() { @@ -473,8 +472,8 @@ func (c *Container) restoreHandler(ctx context.Context) activator.RestoreHook { log.G(ctx).Errorf("error restoring container, exiting process: %s", err) } c.Container = restoredContainer - - return c.ScheduleScaleDown() + c.ScheduleScaleDown() + return nil } } diff --git a/shim/task/service_zeropod.go b/shim/task/service_zeropod.go index 0278ddd..db39eef 100644 --- a/shim/task/service_zeropod.go +++ b/shim/task/service_zeropod.go @@ -231,10 +231,7 @@ func (w *wrapper) Start(ctx context.Context, r *taskAPI.StartRequest) (*taskAPI. return resp, nil } - if err := zeropodContainer.ScheduleScaleDown(); err != nil { - return nil, err - } - + zeropodContainer.ScheduleScaleDown() return resp, err } @@ -311,9 +308,7 @@ func (w *wrapper) Delete(ctx context.Context, r *taskAPI.DeleteRequest) (*taskAP // on delete of an exec container we want to schedule scaling down again // but only if there are no other running execs. if w.runningExecs[zeropodContainer.Container] == 0 { - if err := zeropodContainer.ScheduleScaleDown(); err != nil { - return nil, err - } + zeropodContainer.ScheduleScaleDown() } w.lifecycleMu.Unlock() }