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

servicedisco: unable to register services of the same name but different tags in the same group #13814

Closed
shoenig opened this issue Jul 18, 2022 · 1 comment · Fixed by #13869
Assignees
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/service-discovery/nomad type/bug
Milestone

Comments

@shoenig
Copy link
Member

shoenig commented Jul 18, 2022

I suspect we might be storing services of a group in a map[service.name] somewhere, when that isn't enough to ensure uniqueness (i.e. instead use service.Hash()).

E.g.

job "simple" {
  datacenters = ["dc1"]
  type        = "service"

  group "database" {

    service {
      name     = "db"
      tags     = ["one"]
      provider = "nomad"
    }

    service {
      name     = "db"
      tags     = ["two"]
      provider = "nomad"
    }

    task "db" {
      driver = "raw_exec"
      config {
        command = "bash"
        args    = ["-c", "sleep 15000"]
      }
    }
  }
}

only one instance of the service shows up

$ nomad service info db
Job ID     Address  Tags   Node ID   Alloc ID
simple_lb  <none>   [two]  1a9a9fe9  37058c6a

and

$ nomad service list
Service Name  Tags
db            [two]
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/service-discovery/nomad type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant