Commit 813a4c9d authored by Marek Grabowski's avatar Marek Grabowski

Merge pull request #17819 from mqliang/eventValidate

remove TODO: There is no namespace required for node.
parents 66877c20 8547a5c1
......@@ -24,7 +24,11 @@ import (
// ValidateEvent makes sure that the event makes sense.
func ValidateEvent(event *api.Event) validation.ErrorList {
allErrs := validation.ErrorList{}
// TODO: There is no namespace required for node.
// There is no namespace required for node.
if event.InvolvedObject.Kind == "Node" &&
event.Namespace != "" {
allErrs = append(allErrs, validation.NewInvalidError("involvedObject.namespace", event.InvolvedObject.Namespace, "namespace is not required for node"))
}
if event.InvolvedObject.Kind != "Node" &&
event.Namespace != event.InvolvedObject.Namespace {
allErrs = append(allErrs, validation.NewInvalidError("involvedObject.namespace", event.InvolvedObject.Namespace, "namespace does not match involvedObject"))
......
......@@ -173,7 +173,7 @@ var aEvent string = `
"name": "a"%s
},
"involvedObject": {
"kind": "Node",
"kind": "Pod",
"namespace": "default",
"name": "a",
"apiVersion": "v1"
......
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