mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 21:21:14 +00:00
kubelet: move getNodeReference logic into a function
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
@@ -1996,19 +1996,22 @@ func (kl *Kubelet) PortForward(podFullName string, uid types.UID, port uint16, s
|
|||||||
return kl.runner.PortForward(podInfraContainer.ID, port, stream)
|
return kl.runner.PortForward(podInfraContainer.ID, port, stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
// BirthCry sends an event that the kubelet has started up.
|
func (kl *Kubelet) getNodeReference() *api.ObjectReference {
|
||||||
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.
|
// and use the real minion name and UID.
|
||||||
// TODO: what is namespace for node?
|
// TODO: what is namespace for node?
|
||||||
ref := &api.ObjectReference{
|
return &api.ObjectReference{
|
||||||
Kind: "Node",
|
Kind: "Node",
|
||||||
Name: kl.hostname,
|
Name: kl.hostname,
|
||||||
UID: types.UID(kl.hostname),
|
UID: types.UID(kl.hostname),
|
||||||
Namespace: "",
|
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 {
|
func (kl *Kubelet) StreamingConnectionIdleTimeout() time.Duration {
|
||||||
|
Reference in New Issue
Block a user