Files
podman/pkg/domain/infra/abi/config.go
Jan Kaluza a98154a978 Switch common, storage and image to monorepo.
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2025-09-01 12:33:04 +02:00

25 lines
479 B
Go

//go:build !remote
package abi
import (
"encoding/json"
"errors"
"io"
"go.podman.io/image/v5/manifest"
)
// DecodeOverrideConfig reads a Schema2Config from a Reader, suppressing EOF
// errors.
func DecodeOverrideConfig(reader io.Reader) (*manifest.Schema2Config, error) {
config := manifest.Schema2Config{}
if reader != nil {
err := json.NewDecoder(reader).Decode(&config)
if err != nil && !errors.Is(err, io.EOF) {
return nil, err
}
}
return &config, nil
}