cloud-gov / cf-service-connect

Cloud Foundry CLI Service Connection Plugin
Other
18 stars 6 forks source link

Support CAPI v3 for v3-zdt-push'd applications #55

Open ryanhofdotgov opened 4 years ago

ryanhofdotgov commented 4 years ago

Because of differences between Cloud Foundry API (CAPI) v2 and v3, cf connect-to-service fails on applications that have been deployed with a zero downtime push, using cf CLI v6.

If you have deployed an app with cf v3-zdt-push, you have to use cf v3-ssh or the cf CLI v7. cf ssh under cf CLI v6 will fail.

From Rolling App Deployments (Beta):

Pushing updates to your app with a v3-zdt command causes the new web process and app GUID to mismatch. cf ssh does not handle this scenario. You must use the cf v3-ssh command instead. Note: This limitation only applies to cf CLI v6.

Steps to reproduce:

  1. Deploy a Cloud Foundry app using cf v3-zdt-push
  2. Attempt to connect via cf connect-to-service APP-NAME SERVICE-NAME. That will result in:
    Finding the service instance details...
    Setting up SSH tunnel...
    FAILED
    Error opening SSH connection: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain

    Executing cf ssh APP-NAME will result in the same error.

Workaround is to use cf v3-ssh or cf7 ssh to do local port forwarding, and then use the service client (e.g., psql) to connect to that local port.