dapr / dapr/components-contrib

Non-K8s name resolvers need to support namespacing

Open
#3,179 1 comment 0 reactions 0 assignees View on GitHub
kind/bug P0 pinned
Dominant language
Go
Stars
602
Forks
580
Avg merge
4d 9h
Merged PRs (30d)
6

Description

> Spin-off from https://github.com/dapr/components-contrib/pull/3178#discussion_r1359104181

Currently, all name resolvers except the K8s one do not support namespacing. This includes: consul, mDNS, and the upcoming SQLite (#3178).

Although those resolvers are primarily meant for local development, where namespacing is perhaps less used, it should still be implemented to support advanced scenarios and improve security.

Implementing namespacing is currently not possible unless the runtime participates too.

- [X] Update `nameresolution.Metadata` to add a [pre-defined constant](https://github.com/dapr/components-contrib/blob/master/nameresolution/metadata.go#L18) for NAMESPACE (_as a side note, we should probably use something with stronger typing than just a map of strings with pre-defined keys_)
- Implemented in #3178
- [ ] Update the runtime to pass the namespace when [registering with a name resolver](https://github.com/dapr/dapr/blob/b6540a1c464d71e5afeecc143d8a3a64bf0f5c03/pkg/runtime/runtime.go#L1105-L1110)
- [ ] Update the mDNS component to register the app using namespaces
- [ ] Update the Consul component to register the app using namespaces
- [ ] Update the SQLite component to register the app using namespaces

**Important:** To preserve backwards-compat, with mDNS and Consul if the namespace is the default one ("default") we must register the app both with **and** without a namespace. Or older versions of Dapr won't be able to invoke this app. This behavior must be supported for at least N+2 releases.

Contributor guide

Open the contributing guide

Research direction

Start with nameresolution/metadata.go and the runtime registration entry point linked in the issue, then inspect the mDNS, Consul, and SQLite components. Trace how the namespace is passed and registered, including the default-namespace compatibility requirement. Done means all listed resolvers support namespaces while mDNS and Consul retain both registration forms for the required releases.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sqlite
Domain
distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.