stratos icon indicating copy to clipboard operation
stratos copied to clipboard

Imminent cloudfoundry v2 api death and impact

Open thelangley opened this issue 1 year ago • 4 comments

Stratos Version

4.4 and v4.8.1

Frontend Deployment type

  • [x] Cloud Foundry Application (cf push)
  • [ ] Kubernetes, using a helm chart
  • [ ] Docker, single container deploying all components
  • [ ] npm run start
  • [ ] Other (please specify below)

Backend (Jet Stream) Deployment type

  • [x] Cloud Foundry Application (cf push)
  • [ ] Kubernetes, using a helm chart
  • [ ] Docker, single container deploying all components
  • [ ] Other (please specify below)

Expected behaviour

App starts nicely and is able to be used

Actual behaviour

Stratos does not start due to V2 API being disabled

Steps to reproduce the behavior

Log output covering before error and any error statements

   2024-12-18T08:05:23.64+0000 [APP/PROC/WEB/0] OUT FATA[Wed Dec 18 08:05:23 UTC 2024] Could not get the info for Cloud Foundry: https://api.blahblah.cloudfoundry/v2/info endpoint returned 404
   2024-12-18T08:05:23.64+0000 [APP/PROC/WEB/0] OUT V2 endpoints disabled

Detailed Description

CF cloudcontroller V2 API is due to be retired in the first cut of cf-deployment starting January 2025. We've tried disabling it early to see what breaks.

Stratos is one of the breaks.

Context

Stratos could be re-worked to leverage v3 api calls instead of v2 api calls which would future proof it against this change.

thelangley avatar Dec 18 '24 08:12 thelangley

@thelangley Do you have a list of all the things that are prone to break with the death of V2?

pburkholder avatar Jan 03 '25 17:01 pburkholder

CF uses a versioned API so any Stratos code that tries to make a CF call that starts with /v2 will not work by default.

So that starts with v2/info (which currently provides good info like auth endpoint)

At the moment, Stratos doesn't start because v2/info doesn't exist. There is a PR for the cf-python-client which has a similar issue. It may be that a similar path could be taken https://github.com/cloudfoundry-community/cf-python-client/pull/221

And then there's all of the other endpoints https://v3-apidocs.cloudfoundry.org/version/3.184.0/index.html

It looks like this has been discussed previously but de-prioritised. https://github.com/cloudfoundry/stratos/issues/3149

Majority of the functionality in Stratos already uses the V7 cf cli and v3 endpoints. So the majority of the work may have already been completed. It appears to be just the initial login (finding uaa url from v2/info) with the issue.

So as I see it https://github.com/cloudfoundry/stratos/blob/v4.8.1/src/jetstream/plugins/cloudfoundry/main.go#L214 and any other V2Info bits inside this function need to be re-written. That may mean that other sections of code that use this function may need to be tweaked too

thelangley avatar Jan 06 '25 05:01 thelangley

We are working on the V3 updating (and help is appreciated) with the initial plan being to upgrade Jetstream to only call V3 API's, then write helper function either via the proxy function or a new api to simulate V2 api calls for the Angular frontend to use it's only calling Jetstream functions which should help reduce how much rewriting is needed in Angular. We can assume the Angular app runs in a browser so every call has a longer round-trip which would make V3 api's feel slower as they are often multiple calls.

krutten avatar Mar 12 '25 20:03 krutten

Not sure if it helps, but looks like /v2/info will be kept around even though the rest of v2 will be deprecated according to https://github.com/cloudfoundry/cloud_controller_ng/pull/4280

cweibel avatar Apr 09 '25 16:04 cweibel