Skip to content

Commit b5a37f6

Browse files
authored
Merge pull request Mellanox#1 from Mmduh-483/relese-guid-from-removed-pod
Release guid from removed pods
2 parents 59c9a36 + fd2e719 commit b5a37f6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/daemon/daemon.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func (d *daemon) AddPeriodicUpdate() {
222222

223223
// Update annotations for passed pods
224224
finalPassCounter := 0
225-
for _, pod := range passedPods {
225+
for index, pod := range passedPods {
226226
ibAnnotation, err := utils.ParseInfiniBandAnnotation(pod)
227227
if err != nil {
228228
ibAnnotation = map[string]string{networkName: utils.ConfiguredInfiniBandPod}
@@ -235,6 +235,11 @@ func (d *daemon) AddPeriodicUpdate() {
235235
glog.Errorf("AddPeriodicUpdate(): failed to update pod annotations with err: %v", err)
236236
continue
237237
}
238+
239+
if err = d.guidPool.ReleaseGUID(guidList[index].String()); err != nil {
240+
glog.Warningf("AddPeriodicUpdate(): failed to release guid \"%s\" from removed pod \"%s\""+
241+
" in namespace \"%s\" with error: %v", guidList[index].String(), pod.Name, pod.Namespace, err)
242+
}
238243
}
239244

240245
finalPassCounter++

0 commit comments

Comments
 (0)