spring-cloud / spring-cloud/spring-cloud-consul

Allow for consecutive dashes in normalizeForDns

Open
#331 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Java
Stars
822
Forks
539
Avg merge
9h 31m
Merged PRs (30d)
7

Description

This is a question regarding the following code:

https://github.com/spring-cloud/spring-cloud-consul/blob/master/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/serviceregistry/ConsulAutoRegistration.java#L154

It seems that all non letters or numbers are transalated into dashes (SEPARATOR) and also that several contigous dashes are translated into a single dash. We intended to register in consul a spring boot service with a name that contains two contigous dashes, i.e. for example: service--test and we found it was not possible. Since using other tools this name can be registered to Consul without problems (at least that we could see), therefore we are wondering what is the purpose of the normalizeForDns logic in spring.cloud.consul.

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ConsulAutoRegistration.java around the normalizeForDns method at the linked line, and read the surrounding service-name registration logic. Determine the intended handling of consecutive dashes and verify that service names such as service--test can be registered without breaking the existing normalization behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.