Merge pull request #129895 from tallclair/refactor-allocation

Delete unused code: allocated state ClearState
This commit is contained in:
Kubernetes Prow Robot 2025-02-02 09:40:55 -08:00 committed by GitHub
commit 6e3546228d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 0 additions and 23 deletions

View File

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

View File

@ -142,14 +142,6 @@ func (sc *stateCheckpoint) Delete(podUID string, containerName string) error {
return sc.storeState() 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{} type noopStateCheckpoint struct{}
// NewNoopStateCheckpoint creates a dummy state checkpoint manager // NewNoopStateCheckpoint creates a dummy state checkpoint manager
@ -178,7 +170,3 @@ func (sc *noopStateCheckpoint) SetPodResizeStatus(_ string, _ v1.PodResizeStatus
func (sc *noopStateCheckpoint) Delete(_ string, _ string) error { func (sc *noopStateCheckpoint) Delete(_ string, _ string) error {
return nil return nil
} }
func (sc *noopStateCheckpoint) ClearState() error {
return nil
}

View File

@ -110,13 +110,3 @@ func (s *stateMemory) Delete(podUID string, containerName string) error {
s.deleteContainer(podUID, containerName) s.deleteContainer(podUID, containerName)
return nil 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
}