Remove unused ClearState function

This commit is contained in:
Tim Allclair 2025-01-29 11:59:35 -08:00
parent f422a58398
commit 424c7ca7e5
3 changed files with 0 additions and 23 deletions

View File

@ -50,7 +50,6 @@ type writer interface {
SetPodResourceAllocation(PodResourceAllocation) error
SetPodResizeStatus(podUID string, resizeStatus v1.PodResizeStatus)
Delete(podUID string, containerName string) error
ClearState() error
}
// State interface provides methods for tracking and setting pod resource allocation

View File

@ -154,14 +154,6 @@ func (sc *stateCheckpoint) Delete(podUID string, containerName string) error {
return sc.storeState()
}
// ClearState clears the state and saves it in a checkpoint
func (sc *stateCheckpoint) ClearState() error {
sc.mux.Lock()
defer sc.mux.Unlock()
sc.cache.ClearState()
return sc.storeState()
}
type noopStateCheckpoint struct{}
// NewNoopStateCheckpoint creates a dummy state checkpoint manager
@ -194,7 +186,3 @@ func (sc *noopStateCheckpoint) SetPodResizeStatus(_ string, _ v1.PodResizeStatus
func (sc *noopStateCheckpoint) Delete(_ string, _ string) error {
return nil
}
func (sc *noopStateCheckpoint) ClearState() error {
return nil
}

View File

@ -116,13 +116,3 @@ func (s *stateMemory) Delete(podUID string, containerName string) error {
s.deleteContainer(podUID, containerName)
return nil
}
func (s *stateMemory) ClearState() error {
s.Lock()
defer s.Unlock()
s.podAllocation = make(PodResourceAllocation)
s.podResizeStatus = make(PodResizeStatus)
klog.V(3).InfoS("Cleared state")
return nil
}