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

Routes defined with _ converted to - (Routes replacing underscore with minus / dash) #1114

Open
tsteckenborn opened this issue Mar 25, 2024 · 3 comments

Comments

@tsteckenborn
Copy link

  • MBT Version: Cloud MTA Build Tool version 1.2.27
  • OS Version: ubuntu2004-20240129164719

Steps to Reproduce:

  1. Define an application with a route, such as:
---
applications:
- name: test
  routes:
  - route: test_host_something.cfapps.eu10.hana.ondemand.com
[...]
  1. Check the deployed applications route
  2. You'll notice that instead of the expected test_host_something.cfapps.eu10.hana.ondemand.com it created the route test-host-something.cfapps.eu10.hana.ondemand.com

Via the Cloud Foundry CLI creation of the route test-host-something.cfapps.eu10.hana.ondemand.com works without issues.

@yutaoj
Copy link
Collaborator

yutaoj commented May 9, 2024

is it a issue on MTA Deploy Service ? could you provide more content of a mta.yaml and more reproduce steps ?

@tsteckenborn
Copy link
Author

tsteckenborn commented May 12, 2024

Given a mta that defines a route, such as for example https://github.com/SAP-samples/cf-mta-examples/blob/main/app-routes/http2-routes/mta.yaml if your routes include an underscore, such as my_app_route_http1.${default-domain} when deployed you'll notice that your routes don't include the _ but all instances are replaced with -. Creating a route with _ using the cloud foundry cli works without an issue. So something during the process of build to deployment seems to modify this.

With regards to reproducability - simply deploy any application with such a route to cloud foundry and check the created routes.

@boyan-velinov
Copy link

Hey @tsteckenborn

The correction of CF app routes happens during MTA deployment in BTP CF. In general, there are the following legacy policies for auto-correction of hosts

The situation with autocorrection of routes and hosts is not the best one, but it is important to know that it exists since the introduction of MTA deployment in SAP CF. Back than the MTA deployments inherits these resitrcitions from the platform.
Now the CF does not restrict the routes in that manner and it is worth to consider how to improve the behavior of MTA deployment. However, a simple removal of autocorrection might lead to breaking change for part of the customers because their productive routes will be changed.

My suggestion is to use short hostnames without dashes which will not be autocorrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants