Skip to content

Commit

Permalink
fix: manage podman inspect result as a list also
Browse files Browse the repository at this point in the history
  • Loading branch information
too-common-name committed Oct 8, 2024
1 parent edfbf8b commit e63ea58
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/podman/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ func (o *PodmanCli) PodInspect(podname string) (PodInspectData, error) {
return PodInspectData{}, err
}

var result PodInspectData
var result []PodInspectData
if err := json.Unmarshal(out, &result); err != nil {

Check failure on line 38 in pkg/podman/inspect.go

View workflow job for this annotation

GitHub Actions / validate

shadow: declaration of "err" shadows declaration at line 29 (govet)
var singleResult PodInspectData
err = json.Unmarshal(out, &singleResult)
return singleResult, err
}

err = json.Unmarshal(out, &result)
return result, err
return result[0], err
}

0 comments on commit e63ea58

Please sign in to comment.