Skip to content

fix: The quantity unit of the container group quota is incorrect

Calvin Yu请求将github/fork/weili520/unit_error合并到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:

Before, when users edit project resource quotas, if they set the key as counts/pods, so the value of limit can be set as '20G' and override the pods' limits., it is incorrect.

截屏2021-12-29 09 48 16

截屏2021-12-29 09 48 25

Which issue(s) this PR fixes:

Fixes ##2797 (closed)

Special notes for reviewers:

截屏2021-12-29 10 11 59

Does this PR introduced a user-facing change?

The unit of project resource quotas limit is incorrect.

Additional documentation, usage docs, etc.:

Now, if users set the key as one of the follows, the value only can be an integer:

  • limits.cpu
  • requests.cpu
  • limits.memory
  • requests.memory
  • count/pods or pods
  • count/deployments.apps or deployments
  • count/statefulsets.apps or statefulsets
  • count/daemonsets.apps or daemonsets
  • count/jobs.batch or jobs
  • count/cronjobs.batch or cronjobs
  • persistentvolumeclaims
  • count/services or services
  • count/ingresses.extensions or routes
  • count/secrets or secrets
  • count/configmaps or configmaps

For other keys, it will not restrict the type of input value.

合并请求报告

加载中