Commit 2ef5e320 authored by Wojciech Tyczynski's avatar Wojciech Tyczynski

Fix node events

parent 13681360
...@@ -25,7 +25,10 @@ import ( ...@@ -25,7 +25,10 @@ import (
func ValidateEvent(event *api.Event) validation.ErrorList { func ValidateEvent(event *api.Event) validation.ErrorList {
allErrs := validation.ErrorList{} allErrs := validation.ErrorList{}
// There is no namespace required for node. // 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" && if event.InvolvedObject.Kind == "Node" &&
event.Namespace != api.NamespaceDefault &&
event.Namespace != "" { event.Namespace != "" {
allErrs = append(allErrs, validation.NewInvalidError(validation.NewFieldPath("involvedObject", "namespace"), event.InvolvedObject.Namespace, "namespace is not required for node")) allErrs = append(allErrs, validation.NewInvalidError(validation.NewFieldPath("involvedObject", "namespace"), event.InvolvedObject.Namespace, "namespace is not required for node"))
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment