Skip to content

fix: Update container resource occupation validation strategy

Calvin Yu请求将github/fork/weili520/info_tip合并到master

Created by: weili520

Signed-off-by: TheYoungManLi cjl@kubesphere.io

What type of PR is this?

/kind bug

What this PR does / why we need it:

During creating a deployment, if the workspace or project has a quota limit, the container should also need to set resource limits, otherwise, we should give them an error tip.

For example, the project hello's project quota limit is as follows:

  requests.cpu: 1 core requests.memory: 2 Gi
  limits.cpu: 2 core   limits.memory: Not limited

and the container's default resource quota is:

 requests.cpu: 1 core requests.memory: 1 Gi
 limits.cpu: 4 core   limits.memory: 4 Gi 

so, if we don't update container's quota during creating deployment, the tip info should be this:

截屏2021-12-14 17 05 57

and then update it to:

requests.cpu: 1 core requests.memory: 1 Gi
limits.cpu: Not limited   limits.memory: 4 Gi

the tip should be as this: 截屏2021-12-14 17 10 01

Which issue(s) this PR fixes:

Fixes #

Special notes for reviewers:

https://user-images.githubusercontent.com/33231138/145969269-cfb9b554-a81b-4df5-bb32-4058071ef8e6.mov

Does this PR introduced a user-facing change?

Update container's resource occupation prompt during creating a deployment.

Additional documentation, usage docs, etc.:

合并请求报告

加载中