Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a Korifi API user I want to get an error when creating a service instance for a plan that is not enabled #3574

Closed
danail-branekov opened this issue Oct 30, 2024 · 0 comments · Fixed by #3577

Comments

@danail-branekov
Copy link
Member

danail-branekov commented Oct 30, 2024

GIVEN I have a plan that is not visible (i.e. admin visibility type)
WHEN I create a service instance for it
THEN I get an error that the service plan is invalid

GIVEN I have a plan that is not visible in the current org (but is visible in another org)
WHEN I create a service instance for it
THEN I get an error that the service plan is invalid

Behaviour on classic CF (mel-c)

The create service instance request fails with 422 Unprocessable entity:

REQUEST: [2024-10-30T10:33:42Z]
POST /v3/service_instances HTTP/1.1
Host: api.mel-c.korifi.cf-app.com
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: cf/8.7.11+b1b4068.2024-07-09 (go1.22.5; amd64 linux)
{
  "name": "xsuaa",
  "relationships": {
    "service_plan": {
      "data": {
        "guid": "f5023ed8-7b73-4700-9bef-7d2e923a817a"
      }
    },
    "space": {
      "data": {
        "guid": "4d2e8b37-8463-42e7-8eaa-3f6910f9d214"
      }
    }
  },
  "type": "managed"
}


RESPONSE: [2024-10-30T10:33:42Z]
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json; charset=utf-8
Date: Wed, 30 Oct 2024 10:33:42 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: nginx
Vary: Accept
X-B3-Spanid: 6d312e0736de03ef
X-B3-Traceid: 5415146c99f84de36d312e0736de03ef
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Runtime: 0.014311
X-Vcap-Request-Id: 5415146c-99f8-4de3-6d31-2e0736de03ef::72b1859a-d733-4601-9b7e-16863a85afbd
X-Xss-Protection: 1; mode=block
{
  "errors": [
    {
      "code": 10008,
      "detail": "Invalid service plan. Ensure that the service plan exists, is available, and you have access to it.",
      "title": "CF-UnprocessableEntity"
    }
  ]
}

As a result, the service instance is not created at all

Dev notes

  • The story should implement checks in the API, kubectl user exprience is out of scope
@danail-branekov danail-branekov added this to the v0.14 milestone Oct 30, 2024
@danail-branekov danail-branekov self-assigned this Oct 30, 2024
zabanov-lab added a commit to zabanov-lab/korifi that referenced this issue Oct 30, 2024
fixes cloudfoundry#3574

Co-authored-by: Danail Branekov <danailster@gmail.com>
danail-branekov added a commit to zabanov-lab/korifi that referenced this issue Oct 31, 2024
fixes cloudfoundry#3574

Co-authored-by: Danail Branekov <danailster@gmail.com>
danail-branekov added a commit to zabanov-lab/korifi that referenced this issue Oct 31, 2024
fixes cloudfoundry#3574

Co-authored-by: Danail Branekov <danailster@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant