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 app developer I want to see an error when I try to create a managed service instance of a disabled service plan #3506

Closed
georgethebeatle opened this issue Oct 8, 2024 · 1 comment
Assignees
Milestone

Comments

@georgethebeatle
Copy link
Member

georgethebeatle commented Oct 8, 2024

Background

Right now in Korifi we do set service plan visibility on the service plan resource, but the service instance controller does not observe it. This means that the instance will go to failed state and will never be able to recover.

Acceptance

GIVEN I have successfully created a service instance
WHEN I disable the service plan
THEN the service instance I created before disabling the plan should remain ready (and eventually bindable)

CF API user

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

Kubectl user

GIVEN I have a plan that is not visible
WHEN I create a service instance for it via kubectl apply
THEN I see the service instance resource getting into the failed state

GIVEN I have created a service instance that is in Failed state because of the service plan not being visible
WHEN I enable the service plan
THEN I see the service instance becoming ready and provisioned with the broker

Dev Notes

  • Think about whether is makes sense to spin off a separate story for org visibility or if we should deliver all three visibilities with one story
  • For now space visibility is out of scope
@danail-branekov danail-branekov added this to the v0.13 milestone Oct 8, 2024
@georgethebeatle georgethebeatle modified the milestones: v0.13, v0.14 Oct 16, 2024
@danail-branekov danail-branekov self-assigned this Oct 30, 2024
@danail-branekov
Copy link
Member

Closing in favour of #3575 and #3574

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants