Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Fix CheckpointList
Browse files Browse the repository at this point in the history
A container checkpoint directory doesn't have config.json.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
Upstream-commit: 0b96bf891c64d6c707a0831466c53c16c8d99e02
Component: engine
  • Loading branch information
avagin committed Mar 1, 2019
1 parent 4b46db6 commit 521434e
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions components/engine/daemon/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package daemon // import "github.com/docker/docker/daemon"

import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
Expand Down Expand Up @@ -127,15 +126,7 @@ func (daemon *Daemon) CheckpointList(name string, config types.CheckpointListOpt
if !d.IsDir() {
continue
}
path := filepath.Join(checkpointDir, d.Name(), "config.json")
data, err := ioutil.ReadFile(path)
if err != nil {
return nil, err
}
var cpt types.Checkpoint
if err := json.Unmarshal(data, &cpt); err != nil {
return nil, err
}
cpt := types.Checkpoint{Name: d.Name()}
out = append(out, cpt)
}

Expand Down

0 comments on commit 521434e

Please sign in to comment.