cgroups icon indicating copy to clipboard operation
cgroups copied to clipboard

MemoryThresholdEvent function incorrect return type

Open AlvinKuruvilla opened this issue 3 years ago • 5 comments

In the memory.go why does the MemoryThresholdEvent() function return a MemoryEvent and not a memoryThresholdEvent as the documentation above seems to suggest it would?

AlvinKuruvilla avatar Dec 11 '20 00:12 AlvinKuruvilla

https://github.com/containerd/cgroups/blob/4cbc285b33272039927a0b066d3412799db8de14/memory.go#L36-L48

AlvinKuruvilla avatar Dec 11 '20 00:12 AlvinKuruvilla

@AlvinKuruvilla Poor wording on my part. All of the Memory___Event functions return a MemoryEvent interface so they can all be registered via the memory controllers memoryEvent method. I can push a fix to make this more clear (unless you already have a branch with a fix 😋).

dcantah avatar Jan 25 '21 08:01 dcantah

Okay sounds good I will definitely try to get a PR for this soon I assume adding a little more details to all of the comments on each of the Memory___Event functions and the MemoryEvent interface is good enough?

AlvinKuruvilla avatar Jan 28 '21 04:01 AlvinKuruvilla

Yep, that sounds perfect!

dcantah avatar Jan 28 '21 12:01 dcantah

Just created a PR: #190 The CI tests seem to be failing though, not sure why.

AlvinKuruvilla avatar Feb 03 '21 16:02 AlvinKuruvilla

Closed with https://github.com/containerd/cgroups/pull/266

dcantah avatar Feb 06 '23 05:02 dcantah