plugin/nomad: Support service filtering (#7724)

Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
This commit is contained in:
Olli Janatuinen
2025-11-25 20:05:14 +01:00
committed by GitHub
parent 3362885b56
commit bdc03ed540
4 changed files with 25 additions and 10 deletions

View File

@@ -29,6 +29,7 @@ type Nomad struct {
Zone string
clients []*api.Client
current int
filter string
}
func (n *Nomad) Name() string {
@@ -103,7 +104,7 @@ func fetchServiceRegistrations(n Nomad, serviceName, namespace string) ([]*api.S
if err != nil {
return nil, nil, err
}
return nc.Services().Get(serviceName, (&api.QueryOptions{Namespace: namespace}))
return nc.Services().Get(serviceName, (&api.QueryOptions{Namespace: namespace, Filter: n.filter}))
}
func handleServiceLookupError(w dns.ResponseWriter, m *dns.Msg, ctx context.Context, namespace string) (int, error) {