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

[Feature]: Korifi API users can push manifests with services #2322

Closed
danail-branekov opened this issue Mar 20, 2023 · 2 comments · Fixed by #2805
Closed

[Feature]: Korifi API users can push manifests with services #2322

danail-branekov opened this issue Mar 20, 2023 · 2 comments · Fixed by #2805
Assignees
Labels
mta support the MTA controller

Comments

@danail-branekov
Copy link
Member

danail-branekov commented Mar 20, 2023

Blockers/Dependencies

No response

Background

As of today Korifi does not support manifests with services

Acceptance Criteria

GIVEN I have create a user-provided service s1
GIVEN I push the following manifest

---
version: 1
applications:
- name: app1
  services:
  - name: s1
    binding_name: b2

THEN I see it starts successfully
AND WHEN I cf env app
THEN I see the desired service bindings available in VCAP_SERVICES:

Getting env variables for app app1 in org org1 / space space1 as cf-admin...
System-Provided:
VCAP_SERVICES: {
  "user-provided": [
    {
      "binding_guid": "f7d23617-91d4-44b9-8663-5b44b690f3f9",
      "binding_name": "b2",
      "credentials": {
        "type": "user-provided",
        "uri": "postgres://admin:admin@postgres-svc.postgres.svc.cluster.local:5432/postgresdb"
      },
      "instance_guid": "67ca25f2-80b1-48c7-961e-8e3882ebb3ae",
      "instance_name": "s1",
      "label": "user-provided",
      "name": "b2",
      "syslog_drain_url": null,
      "tags": [],
      "volume_mounts": []
    }
  ]
}

Dev Notes

  • Managed services are out of scope.
  • Deprecated manifest top-level service configuration is out of scope.
  • On CF for VMs deleting services from the manifest and repushing it does not delete the existing bindings. We want that behaviour on Korifi as well.
  • Changing the binding name in a manifest and pushing it again does not change the binding name on CF for VMs. We want the same behaviour on Korifi as well.
@danail-branekov danail-branekov added the mta support the MTA controller label Mar 20, 2023
@danail-branekov danail-branekov changed the title [Feature]: Korifi API users can push manifests with serivices [Feature]: Korifi API users can push manifests with services Jun 13, 2023
@danail-branekov danail-branekov self-assigned this Jul 12, 2023
danail-branekov added a commit that referenced this issue Jul 17, 2023
Issue: #2322

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
Co-authored-by: Danail Branekov <danailster@gmail.com>
danail-branekov added a commit that referenced this issue Jul 17, 2023
Issue: #2322

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
Co-authored-by: Danail Branekov <danailster@gmail.com>
danail-branekov added a commit that referenced this issue Jul 17, 2023
Issue: #2322

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
Co-authored-by: Danail Branekov <danailster@gmail.com>
danail-branekov added a commit that referenced this issue Jul 20, 2023
Issue: #2322

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
Co-authored-by: Danail Branekov <danailster@gmail.com>
gcapizzi pushed a commit that referenced this issue Jul 20, 2023
Issue: #2322

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
Co-authored-by: Danail Branekov <danailster@gmail.com>
@danail-branekov
Copy link
Member Author

Rejecting as when the service instance referenced in the manifest does not exist korifi succeeds and does not create a service binding. Under the same conditions cf for vms is failing like this: For application 'foo': Service instance 's1' not found. We should mimick this behaviour

@danail-branekov
Copy link
Member Author

For context on the issue above:

When the manifest references a service that does not exist, on CF for VMs the error For application 'foo': Service instance 's1' not found is returned by the manifest apply job:

REQUEST: [2023-08-17T16:04:45Z]
POST /v3/spaces/8218cc1f-34cf-454c-b255-a93fe05efa50/actions/apply_manifest HTTP/1.1
Host: api.mel-c.korifi.cf-app.com
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/x-yaml
User-Agent: cf/8.7.1+9c81242.2023-06-15 (go1.20.5; amd64 linux)
[application/x-yaml Content Hidden]

RESPONSE: [2023-08-17T16:04:45Z]
HTTP/1.1 202 Accepted
Content-Type: application/json
Date: Thu, 17 Aug 2023 16:04:45 GMT
Location: https://api.mel-c.korifi.cf-app.com/v3/jobs/7a138912-a983-4178-967a-c308b5024d17
Referrer-Policy: strict-origin-when-cross-origin
Server: nginx
X-B3-Spanid: 7ca820e5149a072b
X-B3-Traceid: 7ca820e5149a072b
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Runtime: 0.075094
X-Vcap-Request-Id: 6f90e0e4-ba3d-41b8-6121-d81c8198b1e9::4eb90dc3-ffc4-480e-9cb4-da734915ed24
X-Xss-Protection: 1; mode=block


....

REQUEST: [2023-08-17T16:04:51Z]
GET /v3/jobs/7a138912-a983-4178-967a-c308b5024d17 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.1+9c81242.2023-06-15 (go1.20.5; amd64 linux)
[application/json Content Hidden]

RESPONSE: [2023-08-17T16:04:51Z]
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Thu, 17 Aug 2023 16:04:51 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: nginx
X-B3-Spanid: 97b94483648962e6
X-B3-Traceid: 97b94483648962e6
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Runtime: 0.006392
X-Vcap-Request-Id: 856e3eb4-7105-4a15-6ad8-7c6c5b2ebf9f::debc2a4e-9596-44a6-a632-39ffccde49de
X-Xss-Protection: 1; mode=block
{
  "created_at": "2023-08-17T16:04:45Z",
  "errors": [
    {
      "code": 10010,
      "detail": "For application 'app1': Service instance 's1' not found",
      "title": "CF-ResourceNotFound"
    }
  ],
  "guid": "7a138912-a983-4178-967a-c308b5024d17",
  "links": {
    "self": {
      "href": "https://api.mel-c.korifi.cf-app.com/v3/jobs/7a138912-a983-4178-967a-c308b5024d17"
    },
    "space": {
      "href": "https://api.mel-c.korifi.cf-app.com/v3/spaces/8218cc1f-34cf-454c-b255-a93fe05efa50"
    }
  },
  "operation": "space.apply_manifest",
  "state": "FAILED",
  "updated_at": "2023-08-17T16:04:50Z",
  "warnings": []
}


For application 'app1': Service instance 's1' not found
FAILED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mta support the MTA controller
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants