@@ -68,7 +68,7 @@ func restoreState(checkpointManager checkpointmanager.CheckpointManager, checkpo
68
68
if err = checkpointManager .GetCheckpoint (checkpointName , checkpoint ); err != nil {
69
69
if err == errors .ErrCheckpointNotFound {
70
70
return & PodResourceAllocationInfo {
71
- AllocationEntries : make (map [string ]map [string ]v1.ResourceRequirements ),
71
+ AllocationEntries : make (map [types. UID ]map [string ]v1.ResourceRequirements ),
72
72
}, nil
73
73
}
74
74
return nil , err
@@ -101,7 +101,7 @@ func (sc *stateCheckpoint) storeState() error {
101
101
}
102
102
103
103
// GetContainerResourceAllocation returns current resources allocated to a pod's container
104
- func (sc * stateCheckpoint ) GetContainerResourceAllocation (podUID string , containerName string ) (v1.ResourceRequirements , bool ) {
104
+ func (sc * stateCheckpoint ) GetContainerResourceAllocation (podUID types. UID , containerName string ) (v1.ResourceRequirements , bool ) {
105
105
sc .mux .RLock ()
106
106
defer sc .mux .RUnlock ()
107
107
return sc .cache .GetContainerResourceAllocation (podUID , containerName )
@@ -115,15 +115,15 @@ func (sc *stateCheckpoint) GetPodResourceAllocation() PodResourceAllocation {
115
115
}
116
116
117
117
// SetContainerResourceAllocation sets resources allocated to a pod's container
118
- func (sc * stateCheckpoint ) SetContainerResourceAllocation (podUID string , containerName string , alloc v1.ResourceRequirements ) error {
118
+ func (sc * stateCheckpoint ) SetContainerResourceAllocation (podUID types. UID , containerName string , alloc v1.ResourceRequirements ) error {
119
119
sc .mux .Lock ()
120
120
defer sc .mux .Unlock ()
121
121
sc .cache .SetContainerResourceAllocation (podUID , containerName , alloc )
122
122
return sc .storeState ()
123
123
}
124
124
125
125
// SetPodResourceAllocation sets pod resource allocation
126
- func (sc * stateCheckpoint ) SetPodResourceAllocation (podUID string , alloc map [string ]v1.ResourceRequirements ) error {
126
+ func (sc * stateCheckpoint ) SetPodResourceAllocation (podUID types. UID , alloc map [string ]v1.ResourceRequirements ) error {
127
127
sc .mux .Lock ()
128
128
defer sc .mux .Unlock ()
129
129
err := sc .cache .SetPodResourceAllocation (podUID , alloc )
@@ -134,7 +134,7 @@ func (sc *stateCheckpoint) SetPodResourceAllocation(podUID string, alloc map[str
134
134
}
135
135
136
136
// Delete deletes allocations for specified pod
137
- func (sc * stateCheckpoint ) Delete (podUID string , containerName string ) error {
137
+ func (sc * stateCheckpoint ) Delete (podUID types. UID , containerName string ) error {
138
138
sc .mux .Lock ()
139
139
defer sc .mux .Unlock ()
140
140
sc .cache .Delete (podUID , containerName )
@@ -154,23 +154,23 @@ func NewNoopStateCheckpoint() State {
154
154
return & noopStateCheckpoint {}
155
155
}
156
156
157
- func (sc * noopStateCheckpoint ) GetContainerResourceAllocation (_ string , _ string ) (v1.ResourceRequirements , bool ) {
157
+ func (sc * noopStateCheckpoint ) GetContainerResourceAllocation (_ types. UID , _ string ) (v1.ResourceRequirements , bool ) {
158
158
return v1.ResourceRequirements {}, false
159
159
}
160
160
161
161
func (sc * noopStateCheckpoint ) GetPodResourceAllocation () PodResourceAllocation {
162
162
return nil
163
163
}
164
164
165
- func (sc * noopStateCheckpoint ) SetContainerResourceAllocation (_ string , _ string , _ v1.ResourceRequirements ) error {
165
+ func (sc * noopStateCheckpoint ) SetContainerResourceAllocation (_ types. UID , _ string , _ v1.ResourceRequirements ) error {
166
166
return nil
167
167
}
168
168
169
- func (sc * noopStateCheckpoint ) SetPodResourceAllocation (_ string , _ map [string ]v1.ResourceRequirements ) error {
169
+ func (sc * noopStateCheckpoint ) SetPodResourceAllocation (_ types. UID , _ map [string ]v1.ResourceRequirements ) error {
170
170
return nil
171
171
}
172
172
173
- func (sc * noopStateCheckpoint ) Delete (_ string , _ string ) error {
173
+ func (sc * noopStateCheckpoint ) Delete (_ types. UID , _ string ) error {
174
174
return nil
175
175
}
176
176
0 commit comments