Skip to content

Commit

Permalink
Merge pull request #15799 from mheon/fix_2126697
Browse files Browse the repository at this point in the history
Ensure that a broken OCI spec does not break inspect
  • Loading branch information
openshift-merge-robot authored Sep 14, 2022
2 parents bb4872e + 42937cd commit 4fc18d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libpod/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,9 @@ func (c *Container) specFromState() (*spec.Spec, error) {
return nil, fmt.Errorf("reading container config: %w", err)
}
if err := json.Unmarshal(content, &returnSpec); err != nil {
return nil, fmt.Errorf("unmarshalling container config: %w", err)
// Malformed spec, just use c.config.Spec instead
logrus.Warnf("Error unmarshalling container %s config: %v", c.ID(), err)
return c.config.Spec, nil
}
} else if !os.IsNotExist(err) {
// ignore when the file does not exist
Expand Down

0 comments on commit 4fc18d0

Please sign in to comment.