mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-15 14:53:44 +00:00
Fix node events
This commit is contained in:
parent
13681360c3
commit
2ef5e320db
@ -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"))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user