Merge pull request #53830 from juanvallejo/jvallejo/prevent-delta-fifo-store-panic

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

perform nil check before iterating over keys

**Release note**:
```release-note
NONE
```

Fixes panic due to nil pointer dereference

Related downstream bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1377940
cc @smarterclayton

Kubernetes-commit: 8cbc9d7e27104cb18b1c5b7c60a9c4927d170b78
This commit is contained in:
Kubernetes Publisher 2017-10-13 09:43:13 -07:00
commit 10a3c2dff4
2 changed files with 53 additions and 49 deletions

98
Godeps/Godeps.json generated
View File

@ -476,199 +476,199 @@
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/equality", "ImportPath": "k8s.io/apimachinery/pkg/api/equality",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/errors", "ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/meta", "ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/resource", "ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion", "ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/conversion/unstructured",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/fields", "ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/labels", "ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime", "ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/selection", "ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/types", "ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/cache", "ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/clock", "ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/diff", "ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/errors", "ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/framer", "ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr", "ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/json", "ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/net", "ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime", "ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/sets", "ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation", "ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/wait", "ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml", "ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/version", "ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/watch", "ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "4386ce4494bcd2ae3cc96b2f7a1a7fd8277380cc" "Rev": "8f08e92da84286e3923d61d445ec4ff23b432272"
}, },
{ {
"ImportPath": "k8s.io/kube-openapi/pkg/common", "ImportPath": "k8s.io/kube-openapi/pkg/common",

View File

@ -539,6 +539,10 @@ func (f *DeltaFIFO) Resync() error {
f.lock.Lock() f.lock.Lock()
defer f.lock.Unlock() defer f.lock.Unlock()
if f.knownObjects == nil {
return nil
}
keys := f.knownObjects.ListKeys() keys := f.knownObjects.ListKeys()
for _, k := range keys { for _, k := range keys {
if err := f.syncKeyLocked(k); err != nil { if err := f.syncKeyLocked(k); err != nil {