mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #115929 from HirazawaUi/delete-kubelet-unused-function
cleanup(kubelet): remove unused function
This commit is contained in:
commit
33d8614c9c
@ -35,10 +35,6 @@ func (f *fakeInternalContainerLifecycle) PreStartContainer(pod *v1.Pod, containe
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *fakeInternalContainerLifecycle) PreStopContainer(containerID string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *fakeInternalContainerLifecycle) PostStopContainer(containerID string) error {
|
||||
return nil
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ import (
|
||||
type InternalContainerLifecycle interface {
|
||||
PreCreateContainer(pod *v1.Pod, container *v1.Container, containerConfig *runtimeapi.ContainerConfig) error
|
||||
PreStartContainer(pod *v1.Pod, container *v1.Container, containerID string) error
|
||||
PreStopContainer(containerID string) error
|
||||
PostStopContainer(containerID string) error
|
||||
}
|
||||
|
||||
@ -52,10 +51,6 @@ func (i *internalContainerLifecycleImpl) PreStartContainer(pod *v1.Pod, containe
|
||||
return nil
|
||||
}
|
||||
|
||||
func (i *internalContainerLifecycleImpl) PreStopContainer(containerID string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (i *internalContainerLifecycleImpl) PostStopContainer(containerID string) error {
|
||||
return i.topologyManager.RemoveContainer(containerID)
|
||||
}
|
||||
|
@ -725,11 +725,6 @@ func (m *kubeGenericRuntimeManager) killContainer(ctx context.Context, pod *v1.P
|
||||
}
|
||||
m.recordContainerEvent(pod, containerSpec, containerID.ID, v1.EventTypeNormal, events.KillingContainer, message)
|
||||
|
||||
// Run internal pre-stop lifecycle hook
|
||||
if err := m.internalLifecycle.PreStopContainer(containerID.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Run the pre-stop lifecycle hooks if applicable and if there is enough time to run it
|
||||
if containerSpec.Lifecycle != nil && containerSpec.Lifecycle.PreStop != nil && gracePeriod > 0 {
|
||||
gracePeriod = gracePeriod - m.executePreStopHook(ctx, pod, containerID, containerSpec, gracePeriod)
|
||||
|
Loading…
Reference in New Issue
Block a user