Open tsteckenborn opened 6 months ago
is it a issue on MTA Deploy Service ? could you provide more content of a mta.yaml and more reproduce steps ?
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.
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
shorten if the host exceeds 63 symbols - the shorten one will end with some hash sum: https://github.com/cloudfoundry/multiapps-controller/blob/master/multiapps-controller-core/src/main/java/org/cloudfoundry/multiapps/controller/core/validators/parameters/RoutePartValidator.java
replace illegal characters (non alphanumeric or -) with dash '-' => you face this autocorrection policy: https://github.com/cloudfoundry/multiapps-controller/blob/master/multiapps-controller-core/src/main/java/org/cloudfoundry/multiapps/controller/core/validators/parameters/RoutePartValidator.java#L13
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.
Steps to Reproduce:
test_host_something.cfapps.eu10.hana.ondemand.com
it created the routetest-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.