mirror of
https://github.com/containers/podman.git
synced 2025-06-04 21:55:24 +08:00
apiv2 add bindings for logs|events
add go-bindings for logs and events. tests were also added. Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
@ -326,7 +326,6 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) {
|
||||
builder.WriteRune(' ')
|
||||
}
|
||||
builder.WriteString(line.Msg)
|
||||
|
||||
// Build header and output entry
|
||||
binary.BigEndian.PutUint32(header[4:], uint32(len(header)+builder.Len()))
|
||||
if _, err := w.Write(header[:]); err != nil {
|
||||
@ -335,7 +334,6 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) {
|
||||
if _, err := fmt.Fprint(w, builder.String()); err != nil {
|
||||
log.Errorf("unable to write builder string: %q", err)
|
||||
}
|
||||
|
||||
if flusher, ok := w.(http.Flusher); ok {
|
||||
flusher.Flush()
|
||||
}
|
||||
|
@ -63,6 +63,6 @@ func (s *APIServer) registerEventsHandlers(r *mux.Router) error {
|
||||
// description: returns a string of json data describing an event
|
||||
// 500:
|
||||
// "$ref": "#/responses/InternalError"
|
||||
r.Handle(VersionedPath("/events"), s.APIHandler(compat.GetEvents)).Methods(http.MethodGet)
|
||||
r.Handle(VersionedPath("/libpod/events"), s.APIHandler(compat.GetEvents)).Methods(http.MethodGet)
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user