From 1b1cdfa357778ca7a2d7296e3b7eb3dd5cf34d61 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 23 Feb 2023 11:19:43 +0100 Subject: [PATCH] sqlite: fix AllContainers with state The state has been unmarshalled into the config which surfaced in wrong states. Signed-off-by: Valentin Rothberg --- libpod/sqlite_state.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpod/sqlite_state.go b/libpod/sqlite_state.go index dacb7f041a..add06dd926 100644 --- a/libpod/sqlite_state.go +++ b/libpod/sqlite_state.go @@ -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)