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: 0 additions & 1 deletion server/container_stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ 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
7 changes: 6 additions & 1 deletion server/sandbox_stop_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ 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)

if podInfraContainer.Spoofed() {
// event generation would be needed in case of a spoofed infra container where there is no
// exit process that hits the handleExit() code.
s.generateCRIEvent(ctx, sb.InfraContainer(), types.ContainerEventType_CONTAINER_STOPPED_EVENT)
}

return nil
}