sqlite: fix AllContainers with state

The state has been unmarshalled into the config which surfaced in wrong
states.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg 2023-02-23 11:19:43 +01:00
parent 21fcc9070f
commit 1b1cdfa357
1 changed files with 2 additions and 2 deletions

View File

@ -736,8 +736,8 @@ func (s *SQLiteState) AllContainers(loadState bool) ([]*Container, error) {
if err := json.Unmarshal([]byte(configJSON), ctr.config); err != nil {
return nil, fmt.Errorf("unmarshalling container config: %w", err)
}
if err := json.Unmarshal([]byte(stateJSON), ctr.config); err != nil {
return nil, fmt.Errorf("unmarshalling container %s config: %w", ctr.ID(), err)
if err := json.Unmarshal([]byte(stateJSON), ctr.state); err != nil {
return nil, fmt.Errorf("unmarshalling container %s state: %w", ctr.ID(), err)
}
ctrs = append(ctrs, ctr)