Move PLEG event back to CRI

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2023-05-30 13:54:15 -07:00
parent fc50334ca9
commit f857626d64
4 changed files with 3 additions and 17 deletions

View File

@@ -43,10 +43,6 @@ import (
type CRIService interface {
// TODO: we should implement Event backoff in Controller.
BackOffEvent(id string, event interface{})
// TODO: refactor event generator for PLEG.
// GenerateAndSendContainerEvent is called by controller for sandbox container events.
GenerateAndSendContainerEvent(ctx context.Context, containerID string, sandboxID string, eventType runtime.ContainerEventType)
}
// ImageService specifies dependencies to CRI image service.

View File

@@ -20,8 +20,6 @@ import (
"context"
"fmt"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
"github.com/containerd/containerd"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/log"
@@ -59,10 +57,5 @@ func (c *Controller) Shutdown(ctx context.Context, sandboxID string) error {
}
}
// Send CONTAINER_DELETED event with ContainerId equal to SandboxId.
c.cri.GenerateAndSendContainerEvent(ctx, sandboxID, sandboxID, runtime.ContainerEventType_CONTAINER_DELETED_EVENT)
c.sandboxStore.Delete(sandboxID)
return nil
}