Skip to content

Pod quota is silently unlimited in subdomain mode (searchPimStorage bails at root containers) #2209

Description

@bourgeoa

Environment

Description

  • Problem
    With subdomain identifier strategy + pod quota, quota is never enforced:
    PodQuotaStrategy.searchPimStorage tests identifierStrategy.isRootContainer()
    BEFORE reading metadata. In subdomain mode every pod root (e.g.
    https://alice.example.com/) IS a root container, so discovery returns "no
    storage" without checking the pim:Storage metadata. getTotalSpaceUsed
    then returns MAX_SAFE_INTEGER → writes are never limited.

  • Repro

    • Run with css:config/util/identifiers/subdomain.json and
      css:config/storage/backend/pod-quota-file.json.
    • Create a pod (subdomain), write beyond the limit → write succeeds (no 413).
  • Root cause
    PodQuotaStrategy.searchPimStorage (dist/storage/quota/PodQuotaStrategy.js)
    returns early when isRootContainer(identifier), conflating "no parent
    container above this" with "this container is not a pod". The metadata check
    must come first: a root container CAN be a pod (it has pim:Storage).

  • Suggested fix
    Check pim:Storage metadata before the root-container stop, and only fall
    back to "no pod" after the metadata check at a root container:

// read metadata → if hasPimStorage return identifier
// else if isRootContainer return undefined
// else recurse to parent

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions