Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-8190

Prevent to set more than one "Reject" limit for an organization quota via API

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • quay-v3.12.4
    • quay
    • False
    • None
    • False
    • User Experience
    • Quay Enterprise

      Via API it is possible to set more than one Reject limit for an organization quota!

      ```
      curl -X GET -H "Authorization: Bearer ${bearer_token}" -H 'Content-Type: application/json' https://${quay_registry}/api/v1/organization/${orga}/quota | jq
      % Total % Received % Xferd Average Speed Time Time Time Current
      Dload Upload Total Spent Left Speed
      100 262 100 262 0 0 609 0 -::- -::- -::- 609
      [
      {
      "id": 1,
      "limit_bytes": 108447924225,
      "default_config": false,
      "limits": [

      { "id": 1, "type": "Reject", "limit_percent": 20 }

      ],
      "default_config_exists": true
      }
      ]

      curl -X POST -H "Authorization: Bearer ${bearer_token}" -H 'Content-Type: application/json' --data '

      {"threshold_percent": 30, "type": "Reject"}

      ' https://${quay_registry}/api/v1/organization/${orga}/quota/1/limit
      "Created"

      curl -X GET -H "Authorization: Bearer ${bearer_token}" -H 'Content-Type: application/json' https://${quay_registry}/api/v1/organization/${orga}/quota | jq
      % Total % Received % Xferd Average Speed Time Time Time Current
      Dload Upload Total Spent Left Speed
      100 313 100 313 0 0 733 0 -::- -::- -::- 734
      [
      {
      "id": 1,
      "limit_bytes": 108447924225,
      "default_config": false,
      "limits": [

      { "id": 2, "type": "Reject", "limit_percent": 30 }

      ,

      { "id": 1, "type": "Reject", "limit_percent": 20 }

      ],
      "default_config_exists": true
      }
      ]
      ```

      This shouldn't be possible because having two different reject limits makes absolutely no sense!

      Throw an error if one tries to set more than one reject limits!
      This affects API only!
      On the webUI this situation is caught and a error message is shown!

              Unassigned Unassigned
              rhn-gps-lbohnsack Lars Bohnsack
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: