From f662d7d11c3aa3100f59255a1b0ca2ee3bd00b03 Mon Sep 17 00:00:00 2001 From: Dawn Chen Date: Thu, 26 Mar 2015 16:30:23 -0700 Subject: [PATCH] Kubelet reports node related events with empty namespace for now. --- pkg/api/validation/events.go | 4 +++- pkg/kubelet/kubelet.go | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/api/validation/events.go b/pkg/api/validation/events.go index 15ad7ff84aa..f2a036022e1 100644 --- a/pkg/api/validation/events.go +++ b/pkg/api/validation/events.go @@ -25,7 +25,9 @@ import ( // ValidateEvent makes sure that the event makes sense. func ValidateEvent(event *api.Event) errs.ValidationErrorList { allErrs := errs.ValidationErrorList{} - if event.Namespace != event.InvolvedObject.Namespace { + // TODO: There is no namespace required for minion + if event.InvolvedObject.Kind != "Node" && + event.Namespace != event.InvolvedObject.Namespace { allErrs = append(allErrs, errs.NewFieldInvalid("involvedObject.namespace", event.InvolvedObject.Namespace, "namespace does not match involvedObject")) } if !util.IsDNS1123Subdomain(event.Namespace) { diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index b27fec0b5a7..2967b08cab4 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -2131,11 +2131,12 @@ func (kl *Kubelet) BirthCry() { // Make an event that kubelet restarted. // TODO: get the real minion object of ourself, // and use the real minion name and UID. + // TODO: what is namespace for node? ref := &api.ObjectReference{ - Kind: "Minion", + Kind: "Node", Name: kl.hostname, UID: types.UID(kl.hostname), - Namespace: api.NamespaceDefault, + Namespace: "", } kl.recorder.Eventf(ref, "starting", "Starting kubelet.") }