Skip to content

Random-route is not creating if application name contains .[dot]. #918

@parasuram-tanguturu

Description

@parasuram-tanguturu

the manifest used is :

---
applications:
- buildpack: staticfile_buildpack
  instances: 1
  memory: 32MB
  name: routingappui-2.0.0
  path: frontend
  random-route: true
- buildpack: java_buildpack
  instances: 1
  memory: 1024MB
  name: routingapp-2.0.0
  path: backend/RoutingApplication-2.0.0.jar
  random-route: true
  services:
  - routing-app-mongo-xs

giving error as
CF-RouteInvalid(210001): The route is invalid: host format

note : here random-route is true.

expected root cause : java-client is unable create random route if appname contains "."
ex: routingapp-2.0.0
in CLI random-route will be created with routingapp-200 means . is ignored by default.
but in java-client it is not happening.

solution:

image

line no:944 in DefaultApplications
hosts = Collections.singletonList(String.join("-", manifest.getName(), randomWords.getAdjective(), randomWords.getNoun()));

change to
hosts = Collections.singletonList(String.join("-", manifest.getName().replaceAll("\\.", ""), randomWords.getAdjective(), randomWords.getNoun()));

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions