mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Kubelet reports node related events with empty namespace for now.
This commit is contained in:
		@@ -25,7 +25,9 @@ import (
 | 
				
			|||||||
// ValidateEvent makes sure that the event makes sense.
 | 
					// ValidateEvent makes sure that the event makes sense.
 | 
				
			||||||
func ValidateEvent(event *api.Event) errs.ValidationErrorList {
 | 
					func ValidateEvent(event *api.Event) errs.ValidationErrorList {
 | 
				
			||||||
	allErrs := 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"))
 | 
							allErrs = append(allErrs, errs.NewFieldInvalid("involvedObject.namespace", event.InvolvedObject.Namespace, "namespace does not match involvedObject"))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if !util.IsDNS1123Subdomain(event.Namespace) {
 | 
						if !util.IsDNS1123Subdomain(event.Namespace) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2131,11 +2131,12 @@ func (kl *Kubelet) BirthCry() {
 | 
				
			|||||||
	// Make an event that kubelet restarted.
 | 
						// Make an event that kubelet restarted.
 | 
				
			||||||
	// TODO: get the real minion object of ourself,
 | 
						// TODO: get the real minion object of ourself,
 | 
				
			||||||
	// and use the real minion name and UID.
 | 
						// and use the real minion name and UID.
 | 
				
			||||||
 | 
						// TODO: what is namespace for node?
 | 
				
			||||||
	ref := &api.ObjectReference{
 | 
						ref := &api.ObjectReference{
 | 
				
			||||||
		Kind:      "Minion",
 | 
							Kind:      "Node",
 | 
				
			||||||
		Name:      kl.hostname,
 | 
							Name:      kl.hostname,
 | 
				
			||||||
		UID:       types.UID(kl.hostname),
 | 
							UID:       types.UID(kl.hostname),
 | 
				
			||||||
		Namespace: api.NamespaceDefault,
 | 
							Namespace: "",
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	kl.recorder.Eventf(ref, "starting", "Starting kubelet.")
 | 
						kl.recorder.Eventf(ref, "starting", "Starting kubelet.")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user