summaryrefslogtreecommitdiff
path: root/vendor/gopkg.in/yaml.v3/decode.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-07-02 11:37:41 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-07-02 11:38:28 +0200
commit7eb9ed975899ffe12fb82066aebf652444205e02 (patch)
tree7bcf61f24cab74996f3641c0d6163a0b47979694 /vendor/gopkg.in/yaml.v3/decode.go
parent955c1d2bfeac0c399bbc4d82fd7b72ed4cc868d3 (diff)
downloadpodman-7eb9ed975899ffe12fb82066aebf652444205e02.tar.gz
podman-7eb9ed975899ffe12fb82066aebf652444205e02.tar.bz2
podman-7eb9ed975899ffe12fb82066aebf652444205e02.zip
vendor containers/common@main
Pull in fixes for local image lookups. Fixes: #10835 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/gopkg.in/yaml.v3/decode.go')
-rw-r--r--vendor/gopkg.in/yaml.v3/decode.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/vendor/gopkg.in/yaml.v3/decode.go b/vendor/gopkg.in/yaml.v3/decode.go
index 21c0dacfd..df36e3a30 100644
--- a/vendor/gopkg.in/yaml.v3/decode.go
+++ b/vendor/gopkg.in/yaml.v3/decode.go
@@ -399,7 +399,7 @@ func (d *decoder) callObsoleteUnmarshaler(n *Node, u obsoleteUnmarshaler) (good
//
// If n holds a null value, prepare returns before doing anything.
func (d *decoder) prepare(n *Node, out reflect.Value) (newout reflect.Value, unmarshaled, good bool) {
- if n.ShortTag() == nullTag || n.Kind == 0 && n.IsZero() {
+ if n.ShortTag() == nullTag {
return out, false, false
}
again := true
@@ -808,8 +808,10 @@ func (d *decoder) mapping(n *Node, out reflect.Value) (good bool) {
}
}
+ mapIsNew := false
if out.IsNil() {
out.Set(reflect.MakeMap(outt))
+ mapIsNew = true
}
for i := 0; i < l; i += 2 {
if isMerge(n.Content[i]) {
@@ -826,7 +828,7 @@ func (d *decoder) mapping(n *Node, out reflect.Value) (good bool) {
failf("invalid map key: %#v", k.Interface())
}
e := reflect.New(et).Elem()
- if d.unmarshal(n.Content[i+1], e) {
+ if d.unmarshal(n.Content[i+1], e) || n.Content[i+1].ShortTag() == nullTag && (mapIsNew || !out.MapIndex(k).IsValid()) {
out.SetMapIndex(k, e)
}
}