nokia / danm-utils

BSD 3-Clause "New" or "Revised" License
6 stars 9 forks source link

Cleaner: Pod UID based identity check should be used when handling any LCM events #23

Open Levovar opened 4 years ago

Levovar commented 4 years ago

In https://github.com/nokia/danm-utils/pull/5 a correction was made to the periodic cleanup handler to avoid accidentally freeing valid allocations belonging to StatefulSets. This is all nice and dandy, but the handling of the events triggered by Pod state changes, such as Pod Delete: https://github.com/nokia/danm-utils/blob/master/pkg/cleaner/cleaner.go#L163 is effectively still Pod name + namespace based.

The code shouldb e adapted to use custom keys, including Pod UID; and use UID when validating the identities of Pods.