More if undos.
This commit is contained in:
parent
db1a8ec47a
commit
9ccf15fcf9
@ -46,7 +46,8 @@ var supportedApiVersions map[string]struct{} = map[string]struct{}{
|
|||||||
|
|
||||||
func RegisterHandlers(m manager.Manager) error {
|
func RegisterHandlers(m manager.Manager) error {
|
||||||
http.HandleFunc(apiResource, func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc(apiResource, func(w http.ResponseWriter, r *http.Request) {
|
||||||
if err := handleRequest(m, w, r); err != nil {
|
err := handleRequest(m, w, r)
|
||||||
|
if err != nil {
|
||||||
fmt.Fprintf(w, "%s", err)
|
fmt.Fprintf(w, "%s", err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -170,7 +171,8 @@ func getContainerInfoRequest(body io.ReadCloser) (*info.ContainerInfoRequest, er
|
|||||||
query.NumStats = 64
|
query.NumStats = 64
|
||||||
|
|
||||||
decoder := json.NewDecoder(body)
|
decoder := json.NewDecoder(body)
|
||||||
if err := decoder.Decode(&query); err != nil && err != io.EOF {
|
err := decoder.Decode(&query)
|
||||||
|
if err != nil && err != io.EOF {
|
||||||
return nil, fmt.Errorf("unable to decode the json value: %s", err)
|
return nil, fmt.Errorf("unable to decode the json value: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,8 @@ func TestUpdateSubcontainers(t *testing.T) {
|
|||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
if err := cd.updateSubcontainers(); err != nil {
|
err := cd.updateSubcontainers()
|
||||||
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,7 +381,8 @@ func (self *manager) watchForNewContainers() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// There is a race between starting the watch and new container creation so we do a detection before we read new containers.
|
// There is a race between starting the watch and new container creation so we do a detection before we read new containers.
|
||||||
if err := self.detectSubcontainers("/"); err != nil {
|
err := self.detectSubcontainers("/")
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user