Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node resource can check volume diff and fix #427

Merged
merged 1 commit into from
Jun 7, 2021

Conversation

jschwinger233
Copy link
Member

No description provided.

@@ -136,6 +152,10 @@ func (c *Calcium) doFixDiffResource(ctx context.Context, node *types.Node, cpus
}
n.MemCap += node.InitMemCap - (memory + node.MemCap)
n.StorageCap += node.InitStorageCap - (storage + node.StorageCap)
n.VolumeUsed = volumes
for vol, cap := range node.Volume {
n.Volume[vol] += node.InitVolume[vol] - cap
Copy link
Member Author

Choose a reason for hiding this comment

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

注意这里可能减成负数, 但是这也是合理的, 这样当容器都删除之后, 资源还回去后才能填平

@CMGS CMGS merged commit 318e034 into projecteru2:master Jun 7, 2021
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.

None yet

2 participants