Skip to content

Commit 6e35462

Browse files
authored
Merge pull request kubernetes#129895 from tallclair/refactor-allocation
Delete unused code: allocated state ClearState
2 parents b4f902f + 424c7ca commit 6e35462

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
@@ -49,7 +49,6 @@ type writer interface {
4949
SetContainerResourceAllocation(podUID string, containerName string, alloc v1.ResourceRequirements) error
5050
SetPodResizeStatus(podUID string, resizeStatus v1.PodResizeStatus)
5151
Delete(podUID string, containerName string) error
52-
ClearState() error
5352
}
5453

5554
// 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
@@ -142,14 +142,6 @@ func (sc *stateCheckpoint) Delete(podUID string, containerName string) error {
142142
return sc.storeState()
143143
}
144144

145-
// ClearState clears the state and saves it in a checkpoint
146-
func (sc *stateCheckpoint) ClearState() error {
147-
sc.mux.Lock()
148-
defer sc.mux.Unlock()
149-
sc.cache.ClearState()
150-
return sc.storeState()
151-
}
152-
153145
type noopStateCheckpoint struct{}
154146

155147
// NewNoopStateCheckpoint creates a dummy state checkpoint manager
@@ -178,7 +170,3 @@ func (sc *noopStateCheckpoint) SetPodResizeStatus(_ string, _ v1.PodResizeStatus
178170
func (sc *noopStateCheckpoint) Delete(_ string, _ string) error {
179171
return nil
180172
}
181-
182-
func (sc *noopStateCheckpoint) ClearState() error {
183-
return nil
184-
}

pkg/kubelet/status/state/state_mem.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,3 @@ func (s *stateMemory) Delete(podUID string, containerName string) error {
110110
s.deleteContainer(podUID, containerName)
111111
return nil
112112
}
113-
114-
func (s *stateMemory) ClearState() error {
115-
s.Lock()
116-
defer s.Unlock()
117-
118-
s.podAllocation = make(PodResourceAllocation)
119-
s.podResizeStatus = make(PodResizeStatus)
120-
klog.V(3).InfoS("Cleared state")
121-
return nil
122-
}

0 commit comments

Comments
 (0)