cf-puppeteer icon indicating copy to clipboard operation
cf-puppeteer copied to clipboard

issue with splitting hostname from route

Open iKrushYou opened this issue 4 years ago • 7 comments

I've encountered an issue while trying various route paths (paths that used to work with the old contraband autopilot)

Here's my example:

cf zero-downtime-push armada-liquid -f pcf2/manifest.yaml --legacy-push --vars-file pcf2/vars-uat.yaml --show-crash-log

manifest.yaml

---
default_envs: &default_envs
  SPRING_PROFILES_ACTIVE: common,dev,cloud
  TZ: GMT
defaults: &defaults
  buildpacks:
    - java_buildpack_offline
  env:
    *default_envs
  timeout: 120
  services:
    - vault-service
applications:
  - name: armada-openshift
    routes:
      - route: armada-openshift((domain_suffix))
    <<: *defaults
    path: armada-openshift-1.0.0-exec.jar

I have tried two variations so far that do not work

vars-uat.yaml

domain_suffix: "-uat.apps.cf2.com"

expected: armada-openshift-uat.apps.cf2.com result: armada-uat.apps.cf2.com

check if routes should be added or switched from existing one
map routes to new application armada-openshift
map route [map-route armada-openshift apps.cf2.com --hostname armada-uat]Creating route armada-uat.apps.cf2.com for org TZU0 / space tzu0_uat as akrush...
OK
Route armada-uat.apps.cf2.com already exists
Adding route armada-uat.apps.cf2.com to app armada-openshift in org TZU0 / space tzu0_uat as akrush...

and

vars-uat.yaml

domain_suffix: ".uat.apps.cf2.com"

expected: armada-openshift.uat.apps.cf2.com result: error

check if routes should be added or switched from existing one
map routes to new application armada-openshift
map route [map-route armada-openshift apps.cf2.com --hostname armada.uat]Creating route armada.uat.apps.cf2.com for org TZU0 / space tzu0_uat as akrush...
FAILED
Error resolving route:
Server error, status code: 400, error code: 210001, message: The route is invalid: host format
could not map route armada.uat.apps.cf2.com to application%!(EXTRA string=armada-openshift)

both of these setups result in non-optimal results where the former sets all routes to armada-uat.apps.cf2.com instead of the full route name

and the latter just doesn't work at all

This does work with the following though:

vars-uat.yaml

domain_suffix: ".apps.cf2.com"

To be completely honest, I don't know if it has to do with the vars file (although my guess would be no) however I am away from my work laptop right now so I wanted to post this before going to bed.

Best, Alex

iKrushYou avatar May 08 '20 03:05 iKrushYou

~After extensive trial and error it seems like this could be in part due to a caching error where it wasn't updating the host name~

It seems like my manifest i have provided is misleading. I have discovered that the hostname is defaulting to whatever is the FIRST application listed in the manifest. I actually have two other apps above that one. It actually looks more like this:

applications:
  - name: armada-core
    routes:
      - route: armada((domain_suffix))
    <<: *defaults
    path: armada-core-1.0.0-exec.jar
  - name: armada-openshift
    routes:
      - route: armada-openshift((domain_suffix))
    <<: *defaults
    path: armada-openshift-1.0.0-exec.jar

And this seems to be why it's defaulting to armada-uat instead of the expected value

iKrushYou avatar May 08 '20 15:05 iKrushYou

Hi @iKrushYou,

thanks for the issue. What kind of version you are using? There was an issue in Version 1.2.0, so you have to use Version 1.2.1.

Kind regards

HappyTobi avatar May 10 '20 13:05 HappyTobi

~I believe~ I am using 1.2.1

Sorry for not specifying earlier

iKrushYou avatar May 13 '20 13:05 iKrushYou

@iKrushYou

thx, I will check that. And give you some feedback.

HappyTobi avatar May 13 '20 19:05 HappyTobi

@iKrushYou so I checked the issue and the problem it not the replacement / suffix, it's the multiapp manifest. I will bring that feature in 1.3.0.

HappyTobi avatar May 26 '20 22:05 HappyTobi

Oh that also makes sense. I guess I kind of assumed it would work with multiple apps. Thanks for looking into it!

iKrushYou avatar May 26 '20 22:05 iKrushYou

I'm working on it. Home I can release the new version in 2 Weeks, till then you have to split sorry.

HappyTobi avatar May 26 '20 22:05 HappyTobi