kubelet: move getNodeReference logic into a function

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
Federico Simoncelli
2015-03-30 09:20:20 -04:00
parent 7bbf526a1f
commit 604e0ad328

View File

@@ -1996,19 +1996,22 @@ func (kl *Kubelet) PortForward(podFullName string, uid types.UID, port uint16, s
return kl.runner.PortForward(podInfraContainer.ID, port, stream)
}
// BirthCry sends an event that the kubelet has started up.
func (kl *Kubelet) BirthCry() {
// Make an event that kubelet restarted.
// TODO: get the real minion object of ourself,
func (kl *Kubelet) getNodeReference() *api.ObjectReference {
// and use the real minion name and UID.
// TODO: what is namespace for node?
ref := &api.ObjectReference{
return &api.ObjectReference{
Kind: "Node",
Name: kl.hostname,
UID: types.UID(kl.hostname),
Namespace: "",
}
kl.recorder.Eventf(ref, "starting", "Starting kubelet.")
}
// BirthCry sends an event that the kubelet has started up.
func (kl *Kubelet) BirthCry() {
// Make an event that kubelet restarted.
// TODO: get the real minion object of ourself,
kl.recorder.Eventf(kl.getNodeReference(), "starting", "Starting kubelet.")
}
func (kl *Kubelet) StreamingConnectionIdleTimeout() time.Duration {