Skip to content

Fix DNS compatibility by replacing underscores in generated app names#122

Merged
ramonskie merged 1 commit intomainfrom
fix-underscore-in-app-names
Dec 5, 2025
Merged

Fix DNS compatibility by replacing underscores in generated app names#122
ramonskie merged 1 commit intomainfrom
fix-underscore-in-app-names

Conversation

@ramonskie
Copy link
Copy Markdown
Contributor

Summary

  • Fix DNS compatibility issue where underscores in randomly generated app names cause Cloud Foundry deployment failures
  • Sanitize generated names by replacing underscores with hyphens to comply with DNS hostname requirements (RFC 1123)

Changes

  • Updated RandomName() function to replace underscores with hyphens after generating the shortid
  • Added test case to verify generated names do not contain underscores
  • Updated test regex to reflect the new character set (removed underscore from allowed characters)

Context

The shortid library can generate IDs containing underscores (e.g., u_b3v_wvg). Cloud Foundry uses app names in DNS URLs where underscores are not allowed per DNS hostname specifications, causing deployment failures.

Copy link
Copy Markdown
Contributor

@ivanovac ivanovac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ramonskie ramonskie merged commit ea11cc4 into main Dec 5, 2025
2 checks passed
@ramonskie ramonskie deleted the fix-underscore-in-app-names branch December 5, 2025 15:43
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

Successfully merging this pull request may close these issues.

2 participants