Skip to content

Correctly handle resourceQuota creation for special types of quotas #1636

Description

Describe the bug

It is not possible to limit a tenant in the number of public IPs (i.e. LoadBalancer services). If the example from the k8s documentation is used, the rendered ResourceQuota objects is malformed.

To Reproduce

cd path/to/cozystack/repo
cd package/apps/tenants
helm template -n tenant-root tenant-user234 . --dry-run=server --set resourceQuotas."services\.loadbalancers"=5

the rendered result is

---
# Source: tenant/templates/quota.yaml
apiVersion: v1
kind: ResourceQuota
metadata:
  name: tenant-quota
  namespace: tenant-user234
spec:
  hard:
      limits.services.loadbalancers: 5 # <== incorrect
      requests.services.loadbalancers: 5 # <== incorrect

Expected behaviour

There should be just one line with services.loadbalancers: 5.

Additional context

The problem lies in packages/library/cozy-lib which right now handles all resources in a uniform fashion without special handling for k8s' special kinds of quotas.

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions