Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions completions/bash/crio
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ h
--enable-criu-support
--enable-metrics
--enable-nri
--enable-pod-events
--enable-profile-unix-socket
--enable-tracing
--gid-mappings
Expand Down
1 change: 1 addition & 0 deletions completions/fish/crio.fish
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ complete -c crio -n '__fish_crio_no_subcommand' -f -l drop-infra-ctr -d 'Determi
complete -c crio -n '__fish_crio_no_subcommand' -f -l enable-criu-support -d 'Enable CRIU integration, requires that the criu binary is available in $PATH.'
complete -c crio -n '__fish_crio_no_subcommand' -f -l enable-metrics -d 'Enable metrics endpoint for the server on localhost:9090.'
complete -c crio -n '__fish_crio_no_subcommand' -f -l enable-nri -d 'Enable NRI (Node Resource Interface) support. (default: false)'
complete -c crio -n '__fish_crio_no_subcommand' -f -l enable-pod-events -d 'If true, CRI-O starts sending the container events to the kubelet'
complete -c crio -n '__fish_crio_no_subcommand' -f -l enable-profile-unix-socket -d 'Enable pprof profiler on crio unix domain socket.'
complete -c crio -n '__fish_crio_no_subcommand' -f -l enable-tracing -d 'Enable OpenTelemetry trace data exporting.'
complete -c crio -n '__fish_crio_no_subcommand' -f -l gid-mappings -r -d 'Specify the GID mappings to use for the user namespace.'
Expand Down
1 change: 1 addition & 0 deletions completions/zsh/_crio
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ it later with **--config**. Global options will modify the output.'
'--enable-criu-support'
'--enable-metrics'
'--enable-nri'
'--enable-pod-events'
'--enable-profile-unix-socket'
'--enable-tracing'
'--gid-mappings'
Expand Down
3 changes: 3 additions & 0 deletions docs/crio.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ crio
[--enable-criu-support]
[--enable-metrics]
[--enable-nri]
[--enable-pod-events]
[--enable-profile-unix-socket]
[--enable-tracing]
[--gid-mappings]=[value]
Expand Down Expand Up @@ -220,6 +221,8 @@ crio [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]

**--enable-nri**: Enable NRI (Node Resource Interface) support. (default: false)

**--enable-pod-events**: If true, CRI-O starts sending the container events to the kubelet

**--enable-profile-unix-socket**: Enable pprof profiler on crio unix domain socket.

**--enable-tracing**: Enable OpenTelemetry trace data exporting.
Expand Down
3 changes: 3 additions & 0 deletions docs/crio.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ the container runtime configuration.
**enable_criu_support**=false
Enable CRIU integration, requires that the criu binary is available in $PATH. (default: false)

**enable_pod_events**=false
Enable CRI-O to generate the container pod-level events in order to optimize the performance of the Pod Lifecycle Event Generator (PLEG) module in Kubelet.

### CRIO.RUNTIME.RUNTIMES TABLE
The "crio.runtime.runtimes" table defines a list of OCI compatible runtimes. The runtime to use is picked based on the runtime handler provided by the CRI. If no runtime handler is provided, the runtime will be picked based on the level of trust of the workload. This option supports live configuration reload. This option supports live configuration reload.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ replace (
k8s.io/component-base => k8s.io/kubernetes/staging/src/k8s.io/component-base v0.0.0-20220823173643-a866cbe2e5bb
k8s.io/component-helpers => k8s.io/kubernetes/staging/src/k8s.io/component-helpers v0.0.0-20220823173643-a866cbe2e5bb
k8s.io/controller-manager => k8s.io/kubernetes/staging/src/k8s.io/controller-manager v0.0.0-20220823173643-a866cbe2e5bb
k8s.io/cri-api => k8s.io/kubernetes/staging/src/k8s.io/cri-api v0.0.0-20220823173643-a866cbe2e5bb
k8s.io/cri-api => k8s.io/kubernetes/staging/src/k8s.io/cri-api v0.0.0-20221108143616-86284d42f891
k8s.io/csi-translation-lib => k8s.io/kubernetes/staging/src/k8s.io/csi-translation-lib v0.0.0-20220823173643-a866cbe2e5bb
k8s.io/kube-aggregator => k8s.io/kubernetes/staging/src/k8s.io/kube-aggregator v0.0.0-20220823173643-a866cbe2e5bb
k8s.io/kube-controller-manager => k8s.io/kubernetes/staging/src/k8s.io/kube-controller-manager v0.0.0-20220823173643-a866cbe2e5bb
Expand Down
9 changes: 7 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2441,6 +2441,7 @@ golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.1.1-0.20221027164007-c63010009c80/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk=
golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
Expand Down Expand Up @@ -2644,12 +2645,14 @@ golang.org/x/sys v0.0.0-20220817070843-5a390386f1f2/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -2661,6 +2664,7 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down Expand Up @@ -3011,6 +3015,7 @@ google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu
google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U=
google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
Expand Down Expand Up @@ -3146,8 +3151,8 @@ k8s.io/kubernetes/staging/src/k8s.io/component-base v0.0.0-20220823173643-a866cb
k8s.io/kubernetes/staging/src/k8s.io/component-helpers v0.0.0-20220823173643-a866cbe2e5bb h1:iSj3WOqIbEMrfusDtXFylp+Z7dqciXMHTpW0xjn7spU=
k8s.io/kubernetes/staging/src/k8s.io/component-helpers v0.0.0-20220823173643-a866cbe2e5bb/go.mod h1:KIZ/2pzaCIRrP3WNaE58bYJB//2YkfF/JMpJJH5tQI0=
k8s.io/kubernetes/staging/src/k8s.io/controller-manager v0.0.0-20220823173643-a866cbe2e5bb/go.mod h1:qlSB479QVn61EyMrwuLi7gP8S6ZJDSIjdQZ+Sb0x5rE=
k8s.io/kubernetes/staging/src/k8s.io/cri-api v0.0.0-20220823173643-a866cbe2e5bb h1:O8AJseVjXnodqbpm0s2xHjQKD6czu2332/q9oJDfVis=
k8s.io/kubernetes/staging/src/k8s.io/cri-api v0.0.0-20220823173643-a866cbe2e5bb/go.mod h1:fTud+mLeql7ZnYPVkB1x7nAqAd0CkLNZtvvPUHDyZuE=
k8s.io/kubernetes/staging/src/k8s.io/cri-api v0.0.0-20221108143616-86284d42f891 h1:0iDGxGw81jtpCrRElZuA8WcFX2hPiCsQRLc2DC4AQdQ=
k8s.io/kubernetes/staging/src/k8s.io/cri-api v0.0.0-20221108143616-86284d42f891/go.mod h1:zq2oDVFywv6KAgM08SYsZM85D0p6IzKywQUqPPvyIXQ=
k8s.io/kubernetes/staging/src/k8s.io/csi-translation-lib v0.0.0-20220823173643-a866cbe2e5bb/go.mod h1:aFc9omOWDcTcj1O7UMNVO1M2ncZ/962NOz1fey7Kz/Y=
k8s.io/kubernetes/staging/src/k8s.io/kube-aggregator v0.0.0-20220823173643-a866cbe2e5bb/go.mod h1:stj8Td14/RKRzQLDHPyrnM64SfAbQDb7DOKAlh2B8MM=
k8s.io/kubernetes/staging/src/k8s.io/kube-controller-manager v0.0.0-20220823173643-a866cbe2e5bb/go.mod h1:XkGYt1v3TsRhw2YhJCDINgdiOHpr1wW1HcXhLGwfSx4=
Expand Down
9 changes: 8 additions & 1 deletion internal/criocli/criocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ func mergeConfig(config *libconfig.Config, ctx *cli.Context) error {
if ctx.IsSet("stats-collection-period") {
config.StatsCollectionPeriod = ctx.Int("stats-collection-period")
}

if ctx.IsSet("enable-pod-events") {
config.EnablePodEvents = ctx.Bool("enable-pod-events")
}
return nil
}

Expand Down Expand Up @@ -1076,6 +1078,11 @@ func getCrioFlags(defConf *libconfig.Config) []cli.Flag {
EnvVars: []string{"CONTAINER_ENABLE_CRIU_SUPPORT"},
Value: false,
},
&cli.BoolFlag{
Name: "enable-pod-events",
Usage: "If true, CRI-O starts sending the container events to the kubelet",
EnvVars: []string{"ENABLE_POD_EVENTS"},
},
}
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ type RuntimeConfig struct {
// will cause a container creation to fail (as opposed to the current behavior of creating a directory).
AbsentMountSourcesToReject []string `toml:"absent_mount_sources_to_reject"`

// EnablePodEvents specifies if the container pod-level events should be generated to optimize the PLEG at Kubelet.
EnablePodEvents bool `toml:"enable_pod_events"`

// seccompConfig is the internal seccomp configuration
seccompConfig *seccomp.Config

Expand Down
11 changes: 11 additions & 0 deletions pkg/config/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ func initCrioTemplateConfig(c *Config) ([]*templateConfigValue, error) {
group: crioRuntimeConfig,
isDefaultValue: simpleEqual(dc.EnableCriuSupport, c.EnableCriuSupport),
},
{
templateString: templateStringCrioRuntimeEnablePodEvents,
group: crioRuntimeConfig,
isDefaultValue: simpleEqual(dc.EnablePodEvents, c.EnablePodEvents),
},
{
templateString: templateStringCrioRuntimeDefaultRuntime,
group: crioRuntimeConfig,
Expand Down Expand Up @@ -1085,6 +1090,12 @@ const templateStringCrioRuntimeEnableCriuSupport = `# Globally enable/disable CR

`

const templateStringCrioRuntimeEnablePodEvents = `# Enable/disable the generation of the container,
# sandbox lifecycle events to be sent to the Kubelet to optimize the PLEG
{{ $.Comment }}enable_pod_events = {{ .EnablePodEvents }}

`

const templateStringCrioRuntimeDefaultRuntime = `# default_runtime is the _name_ of the OCI runtime to be used as the default.
# default_runtime is the _name_ of the OCI runtime to be used as the default.
# The name is matched against the runtimes map below.
Expand Down
1 change: 1 addition & 0 deletions server/container_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ func (s *Server) CreateContainer(ctx context.Context, req *types.CreateContainer
log.Warnf(ctx, "NRI post-create event failed for container %q: %v",
newContainer.ID(), err)
}
s.generateCRIEvent(ctx, newContainer, types.ContainerEventType_CONTAINER_CREATED_EVENT)

log.Infof(ctx, "Created container %s: %s", newContainer.ID(), newContainer.Description())
return &types.CreateContainerResponse{
Expand Down
11 changes: 9 additions & 2 deletions server/container_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import (
types "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func (s *Server) GetContainerEvents(req *types.GetEventsRequest, res types.RuntimeService_GetContainerEventsServer) error {
// Spoofing the GetContainerEvents method to return nil response until actual support code is added.
// GetContainerEvents sends the stream of container events to the client - kubelet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while we primarily care about the kubelet it's not necessarily the only client. there may be a crictl events call one day

func (s *Server) GetContainerEvents(req *types.GetEventsRequest, ces types.RuntimeService_GetContainerEventsServer) error {
if s.Config().EnablePodEvents {
for containerEvent := range s.ContainerEventsChan {
if err := ces.Send(&containerEvent); err != nil {
return err
}
}
}
return nil
}
2 changes: 1 addition & 1 deletion server/container_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (s *Server) RemoveContainer(ctx context.Context, req *types.RemoveContainer
}
}
}

s.generateCRIEvent(ctx, c, types.ContainerEventType_CONTAINER_DELETED_EVENT)
log.Infof(ctx, "Removed container %s: %s", c.ID(), c.Description())
return &types.RemoveContainerResponse{}, nil
}
Expand Down
1 change: 1 addition & 0 deletions server/container_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func (s *Server) StartContainer(ctx context.Context, req *types.StartContainerRe
if err := s.Runtime().StartContainer(ctx, c); err != nil {
return nil, fmt.Errorf("failed to start container %s: %w", c.ID(), err)
}
s.generateCRIEvent(ctx, c, types.ContainerEventType_CONTAINER_STARTED_EVENT)

if err := s.nri.postStartContainer(ctx, sandbox, c); err != nil {
log.Warnf(ctx, "NRI post-start failed for container %q: %v", c.ID(), err)
Expand Down
1 change: 1 addition & 0 deletions server/container_stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func (s *Server) StopContainer(ctx context.Context, req *types.StopContainerRequ
log.Warnf(ctx, "NRI stop failed for container %q: %v", c.ID(), err)
}

s.generateCRIEvent(ctx, c, types.ContainerEventType_CONTAINER_DELETED_EVENT)
log.Infof(ctx, "Stopped container %s: %s", c.ID(), c.Description())
return &types.StopContainerResponse{}, nil
}
Expand Down
1 change: 1 addition & 0 deletions server/sandbox_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func (s *Server) removePodSandbox(ctx context.Context, sb *sandbox.Sandbox) erro
if err := s.PodIDIndex().Delete(sb.ID()); err != nil {
return fmt.Errorf("failed to delete pod sandbox %s from index: %w", sb.ID(), err)
}
s.generateCRIEvent(ctx, sb.InfraContainer(), types.ContainerEventType_CONTAINER_DELETED_EVENT)

if err := s.nri.removePodSandbox(ctx, sb); err != nil {
log.Warnf(ctx, "NRI pod removal failed for %q: %v", sb.ID(), err)
Expand Down
2 changes: 2 additions & 0 deletions server/sandbox_run_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ func (s *Server) runPodSandbox(ctx context.Context, req *types.RunPodSandboxRequ
return nil, err
}

s.generateCRIEvent(ctx, sb.InfraContainer(), types.ContainerEventType_CONTAINER_CREATED_EVENT)
if err := s.Runtime().StartContainer(ctx, container); err != nil {
return nil, err
}
Expand Down Expand Up @@ -997,6 +998,7 @@ func (s *Server) runPodSandbox(ctx context.Context, req *types.RunPodSandboxRequ
s.resourceStore.Delete(sbox.Name())

sb.SetCreated()
s.generateCRIEvent(ctx, sb.InfraContainer(), types.ContainerEventType_CONTAINER_STARTED_EVENT)

log.Infof(ctx, "Ran pod sandbox %s with infra container: %s", container.ID(), container.Description())
resp = &types.RunPodSandboxResponse{PodSandboxId: sbox.ID()}
Expand Down
13 changes: 13 additions & 0 deletions server/sandbox_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package server

import (
"fmt"
"time"

"github.com/cri-o/cri-o/internal/log"
"github.com/cri-o/cri-o/internal/oci"
Expand Down Expand Up @@ -36,6 +37,16 @@ func (s *Server) PodSandboxStatus(ctx context.Context, req *types.PodSandboxStat
}
}

var containerStatuses []*types.ContainerStatus
var timestamp int64
if s.config.EnablePodEvents {
timestamp = time.Now().Unix()
containerStatuses, err = s.getContainerStatusesFromSandboxID(ctx, req.PodSandboxId)
if err != nil {
return nil, status.Errorf(codes.Unknown, "could not get container statuses of the sandbox Id %q: %v", req.PodSandboxId, err)
}
}

sandboxID := sb.ID()
resp := &types.PodSandboxStatusResponse{
Status: &types.PodSandboxStatus{
Expand All @@ -48,6 +59,8 @@ func (s *Server) PodSandboxStatus(ctx context.Context, req *types.PodSandboxStat
Metadata: sb.Metadata(),
Linux: linux,
},
ContainersStatuses: containerStatuses,
Timestamp: timestamp,
}

if len(sb.IPs()) > 0 {
Expand Down
2 changes: 2 additions & 0 deletions server/sandbox_stop_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/cri-o/cri-o/internal/runtimehandlerhooks"
"golang.org/x/net/context"
"golang.org/x/sync/errgroup"
types "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func (s *Server) stopPodSandbox(ctx context.Context, sb *sandbox.Sandbox) error {
Expand Down Expand Up @@ -93,6 +94,7 @@ func (s *Server) stopPodSandbox(ctx context.Context, sb *sandbox.Sandbox) error

log.Infof(ctx, "Stopped pod sandbox: %s", sb.ID())
sb.SetStopped(ctx, true)
s.generateCRIEvent(ctx, sb.InfraContainer(), types.ContainerEventType_CONTAINER_STOPPED_EVENT)

return nil
}
Loading