Skip to content

Commit 424c7ca

Browse files
committed
Remove unused ClearState function
1 parent f422a58 commit 424c7ca

File tree

3 files changed

+0
-23
lines changed

3 files changed

+0
-23
lines changed

pkg/kubelet/status/state/state.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ type writer interface {
5050
SetPodResourceAllocation(PodResourceAllocation) error
5151
SetPodResizeStatus(podUID string, resizeStatus v1.PodResizeStatus)
5252
Delete(podUID string, containerName string) error
53-
ClearState() error
5453
}
5554

5655
// State interface provides methods for tracking and setting pod resource allocation

pkg/kubelet/status/state/state_checkpoint.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,6 @@ func (sc *stateCheckpoint) Delete(podUID string, containerName string) error {
154154
return sc.storeState()
155155
}
156156

157-
// ClearState clears the state and saves it in a checkpoint
158-
func (sc *stateCheckpoint) ClearState() error {
159-
sc.mux.Lock()
160-
defer sc.mux.Unlock()
161-
sc.cache.ClearState()
162-
return sc.storeState()
163-
}
164-
165157
type noopStateCheckpoint struct{}
166158

167159
// NewNoopStateCheckpoint creates a dummy state checkpoint manager
@@ -194,7 +186,3 @@ func (sc *noopStateCheckpoint) SetPodResizeStatus(_ string, _ v1.PodResizeStatus
194186
func (sc *noopStateCheckpoint) Delete(_ string, _ string) error {
195187
return nil
196188
}
197-
198-
func (sc *noopStateCheckpoint) ClearState() error {
199-
return nil
200-
}

pkg/kubelet/status/state/state_mem.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,3 @@ func (s *stateMemory) Delete(podUID string, containerName string) error {
116116
s.deleteContainer(podUID, containerName)
117117
return nil
118118
}
119-
120-
func (s *stateMemory) ClearState() error {
121-
s.Lock()
122-
defer s.Unlock()
123-
124-
s.podAllocation = make(PodResourceAllocation)
125-
s.podResizeStatus = make(PodResizeStatus)
126-
klog.V(3).InfoS("Cleared state")
127-
return nil
128-
}

0 commit comments

Comments
 (0)