From 2ef5e320db186d1e4477e12177a4850ccc970fda Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Wed, 9 Dec 2015 21:41:58 +0100 Subject: [PATCH] Fix node events --- pkg/api/validation/events.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/api/validation/events.go b/pkg/api/validation/events.go index 6eba8904726..20123e756f9 100644 --- a/pkg/api/validation/events.go +++ b/pkg/api/validation/events.go @@ -25,7 +25,10 @@ import ( func ValidateEvent(event *api.Event) validation.ErrorList { allErrs := validation.ErrorList{} // There is no namespace required for node. + // However, older client code accidentally sets event.Namespace + // to api.NamespaceDefault, so we accept that too, but "" is preferred. if event.InvolvedObject.Kind == "Node" && + event.Namespace != api.NamespaceDefault && event.Namespace != "" { allErrs = append(allErrs, validation.NewInvalidError(validation.NewFieldPath("involvedObject", "namespace"), event.InvolvedObject.Namespace, "namespace is not required for node")) }