Skip to content

Conversation

@derekhjray
Copy link

Check LinuxResources field, and skip Update() operation if not specified or invalid to avoid the potential panic issue of misconfigure

…uxResources

Signed-off-by: Derek Ray <derek9ray@gmail.com>
}

func (c *cpuController) Update(path string, resources *specs.LinuxResources) error {
if resources == nil || resources.CPU == nil || (resources.CPU.Shares == nil && resources.CPU.Period == nil && resources.CPU.Quota == nil) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*.Create already handles nil case.
If we check it before update/create operation, it's easy to cause mismatch.
For example, I just want to update shares only. this is breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants