mirror of
https://github.com/moby/moby.git
synced 2026-08-09 09:33:50 +00:00
Merge pull request #53281 from thaJeztah/fix_stackoverflow
daemon/pkg/opts: fix recursive NRI JSON decoding on go1.27 (JSON v2)
This commit is contained in:
@@ -19,11 +19,8 @@ type NRIOpts struct {
|
||||
func (c *NRIOpts) UnmarshalJSON(raw []byte) error {
|
||||
dec := json.NewDecoder(bytes.NewReader(raw))
|
||||
dec.DisallowUnknownFields()
|
||||
type nc *NRIOpts // prevent recursion
|
||||
if err := dec.Decode(nc(c)); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
type nriOpts NRIOpts // prevent recursion
|
||||
return dec.Decode((*nriOpts)(c))
|
||||
}
|
||||
|
||||
// NamedNRIOpts is a NamedOption and flags.Value for NRI configuration parsing.
|
||||
|
||||
Reference in New Issue
Block a user