containerd / cgroups

cgroups package for Go
https://containerd.io
Apache License 2.0
1.08k stars 236 forks source link

Allow for passing properties to NewSystemd #344

Open shell-skrimp opened 3 months ago

shell-skrimp commented 3 months ago

I had a need to disable some functionality but couldnt do so with current implementation so I made a tweak that allows for passing custom properties.

dcantah commented 2 months ago

@shell-skrimp Unfortunately this changes the public API of NewSystemd which would be a breaking change. You could introduce a new "constructor" that takes in the properties. Basically what you have right now just with a new name like NewSystemdWithProperties

samuelkarp commented 2 months ago

I had a need to disable some functionality

Can you tell us more about your use-case? As @dcantah noted this is a breaking change; a new constructor would be a better option but as of now I don't think we know of a particular use-case for this in containerd.

shell-skrimp commented 2 months ago

Hey all, sorry I didnt reply sooner, been busy ;)

My use case was in a different project where I needed to create cgroups for a parent and its child processes. I think that @samuelkarp idea to have a new constructor is probably best way to go to prevent breakage. However, I'm not sure if this cgroups project wants to be consumable by other projects or if it only wants to stay in the scope of containerd? If the latter then you can disregard this PR.