@@ -80,10 +80,6 @@ func (sc *stateCheckpoint) restoreState() error {
80
80
if err != nil {
81
81
return fmt .Errorf ("failed to set pod resource allocation: %w" , err )
82
82
}
83
- err = sc .cache .SetResizeStatus (praInfo .ResizeStatusEntries )
84
- if err != nil {
85
- return fmt .Errorf ("failed to set resize status: %w" , err )
86
- }
87
83
klog .V (2 ).InfoS ("State checkpoint: restored pod resource allocation state from checkpoint" )
88
84
return nil
89
85
}
@@ -92,10 +88,8 @@ func (sc *stateCheckpoint) restoreState() error {
92
88
func (sc * stateCheckpoint ) storeState () error {
93
89
podAllocation := sc .cache .GetPodResourceAllocation ()
94
90
95
- podResizeStatus := sc .cache .GetResizeStatus ()
96
91
checkpoint , err := NewCheckpoint (& PodResourceAllocationInfo {
97
- AllocationEntries : podAllocation ,
98
- ResizeStatusEntries : podResizeStatus ,
92
+ AllocationEntries : podAllocation ,
99
93
})
100
94
if err != nil {
101
95
return fmt .Errorf ("failed to create checkpoint: %w" , err )
@@ -123,19 +117,12 @@ func (sc *stateCheckpoint) GetPodResourceAllocation() PodResourceAllocation {
123
117
}
124
118
125
119
// GetPodResizeStatus returns the last resize decision for a pod
126
- func (sc * stateCheckpoint ) GetPodResizeStatus (podUID string ) ( v1.PodResizeStatus , bool ) {
120
+ func (sc * stateCheckpoint ) GetPodResizeStatus (podUID string ) v1.PodResizeStatus {
127
121
sc .mux .RLock ()
128
122
defer sc .mux .RUnlock ()
129
123
return sc .cache .GetPodResizeStatus (podUID )
130
124
}
131
125
132
- // GetResizeStatus returns the set of resize decisions made
133
- func (sc * stateCheckpoint ) GetResizeStatus () PodResizeStatus {
134
- sc .mux .RLock ()
135
- defer sc .mux .RUnlock ()
136
- return sc .cache .GetResizeStatus ()
137
- }
138
-
139
126
// SetContainerResourceAllocation sets resources allocated to a pod's container
140
127
func (sc * stateCheckpoint ) SetContainerResourceAllocation (podUID string , containerName string , alloc v1.ResourceRequirements ) error {
141
128
sc .mux .Lock ()
@@ -153,19 +140,10 @@ func (sc *stateCheckpoint) SetPodResourceAllocation(a PodResourceAllocation) err
153
140
}
154
141
155
142
// SetPodResizeStatus sets the last resize decision for a pod
156
- func (sc * stateCheckpoint ) SetPodResizeStatus (podUID string , resizeStatus v1.PodResizeStatus ) error {
143
+ func (sc * stateCheckpoint ) SetPodResizeStatus (podUID string , resizeStatus v1.PodResizeStatus ) {
157
144
sc .mux .Lock ()
158
145
defer sc .mux .Unlock ()
159
146
sc .cache .SetPodResizeStatus (podUID , resizeStatus )
160
- return sc .storeState ()
161
- }
162
-
163
- // SetResizeStatus sets the resize decisions
164
- func (sc * stateCheckpoint ) SetResizeStatus (rs PodResizeStatus ) error {
165
- sc .mux .Lock ()
166
- defer sc .mux .Unlock ()
167
- sc .cache .SetResizeStatus (rs )
168
- return sc .storeState ()
169
147
}
170
148
171
149
// Delete deletes allocations for specified pod
@@ -199,12 +177,8 @@ func (sc *noopStateCheckpoint) GetPodResourceAllocation() PodResourceAllocation
199
177
return nil
200
178
}
201
179
202
- func (sc * noopStateCheckpoint ) GetPodResizeStatus (_ string ) (v1.PodResizeStatus , bool ) {
203
- return "" , false
204
- }
205
-
206
- func (sc * noopStateCheckpoint ) GetResizeStatus () PodResizeStatus {
207
- return nil
180
+ func (sc * noopStateCheckpoint ) GetPodResizeStatus (_ string ) v1.PodResizeStatus {
181
+ return ""
208
182
}
209
183
210
184
func (sc * noopStateCheckpoint ) SetContainerResourceAllocation (_ string , _ string , _ v1.ResourceRequirements ) error {
@@ -215,13 +189,7 @@ func (sc *noopStateCheckpoint) SetPodResourceAllocation(_ PodResourceAllocation)
215
189
return nil
216
190
}
217
191
218
- func (sc * noopStateCheckpoint ) SetPodResizeStatus (_ string , _ v1.PodResizeStatus ) error {
219
- return nil
220
- }
221
-
222
- func (sc * noopStateCheckpoint ) SetResizeStatus (_ PodResizeStatus ) error {
223
- return nil
224
- }
192
+ func (sc * noopStateCheckpoint ) SetPodResizeStatus (_ string , _ v1.PodResizeStatus ) {}
225
193
226
194
func (sc * noopStateCheckpoint ) Delete (_ string , _ string ) error {
227
195
return nil
0 commit comments