Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

issue with splitting hostname from route #26

Open
iKrushYou opened this issue May 8, 2020 · 7 comments
Open

issue with splitting hostname from route #26

iKrushYou opened this issue May 8, 2020 · 7 comments
Labels
bug Something isn't working feature New Feature
Milestone

Comments

@iKrushYou
Copy link
Contributor

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
Copy link
Contributor Author

iKrushYou commented May 8, 2020

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

@HappyTobi
Copy link
Owner

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

@iKrushYou
Copy link
Contributor Author

iKrushYou commented May 13, 2020

I believe I am using 1.2.1

Sorry for not specifying earlier

@HappyTobi
Copy link
Owner

HappyTobi commented May 13, 2020

@iKrushYou

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

@HappyTobi HappyTobi added the bug Something isn't working label May 26, 2020
@HappyTobi HappyTobi added this to the 1.2.2 milestone May 26, 2020
HappyTobi added a commit that referenced this issue May 26, 2020
HappyTobi added a commit that referenced this issue May 26, 2020
@HappyTobi
Copy link
Owner

@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.

@iKrushYou
Copy link
Contributor Author

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

@HappyTobi
Copy link
Owner

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

@HappyTobi HappyTobi modified the milestones: 1.2.2, 1.3.0 May 26, 2020
@HappyTobi HappyTobi added the feature New Feature label May 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working feature New Feature
Projects
None yet
Development

No branches or pull requests

2 participants