mirror of
https://github.com/containers/podman.git
synced 2025-10-16 02:32:55 +08:00
25 lines
479 B
Go
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
|
|
}
|