Skip to content

feat(discovery): describe workload endpoints as locators - #103

Merged
akijakya merged 7 commits into
mainfrom
feat/102-workload-locators
Oct 14, 2026
Merged

akijakya merged 7 commits into
mainfrom
feat/102-workload-locators

Conversation

@akijakya

@akijakya akijakya commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Depends on github.com/agntcy/dir/api and client pinned to agntcy/dir@9252429b on dir main (it contains agntcy/dir#2302 and agntcy/dir#2332), until a dir release includes them.

Workloads now describe their endpoints as locators (protocol + full URL) instead of the deprecated addresses and ports, step 2 of agntcy/dir#2299.

Changes

  • Docker and Kubernetes adapters emit one tcp://<address>:<port> locator per reachable address and exposed port (sorted, IPv6 bracketed, duplicates removed), via a shared types.TCPLocators helper.
  • Process runtime: descriptors accept locators ([{"protocol": "slim", "url": "slim://org/ns/agent"}]), validated for protocol, URL and scheme. addresses/ports stay accepted and become tcp locators. The org.agntcy/locator annotation convention is dropped.
  • A2A resolver probes origins built from locators: tcp → http and https, http/https → their own scheme, other protocols are skipped.
  • addresses/ports are no longer set anywhere (staticcheck SA1019 clean).
  • CRD regenerated: locators in the schema (so the CRD store doesn't prune it) and a Locators print column; Addresses/Ports move to wide output.
  • Docs updated for locators.

Dependency bump

The dir API at that commit (first cc5b967, now 9252429b) requires Go 1.27.1 and k8s.io/apimachinery v0.37.1, and the old dir/client v1.7.0 no longer compiles against it. So this also moves the Go toolchain (Taskfile, builder images) to 1.27.1, k8s.io/api/client-go to v0.37.1, and dir/client to the same commit, plus one Go 1.27 lint modernization in store/crd.

Testing

  • Unit tests for the locator helper, Docker (network and host mode, summary and inspect), Kubernetes (pod and service DNS), process descriptors (locators, validation, address/port conversion) and the A2A resolver (tcp, http, https and non-HTTP locators).
  • Manual: process discovery + server on SQLite with an HTTP agent given by port and a SLIM-only agent given by locator; the HTTP agent's card resolves via its tcp locator, the SLIM agent is listed with its locator and not probed.

Closes #102

Use github.com/agntcy/dir/api and client at cc5b967 (agntcy/dir#2302),
which adds Workload locators. The API now requires Go 1.27.1 and
k8s.io/apimachinery v0.37.1, so the Go toolchain (Taskfile, builder
images) and k8s.io/api and client-go move along. To be replaced by the
released tag before release.

Signed-off-by: András Jáky <[email protected]>
@akijakya akijakya added enhancement New feature or request go labels Oct 8, 2026
@akijakya akijakya self-assigned this Oct 8, 2026
@github-actions github-actions Bot added the size/M label Oct 8, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.48387% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
store/crd/store.go 0.0% 8 Missing ⚠️
discovery/resolver/a2a/resolver.go 93.8% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

The commit on dir main that contains the workload locators (agntcy/dir#2302)
and the workload filters (agntcy/dir#2332).

Signed-off-by: András Jáky <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

A2A probing ignores declared locator protocols, and the claimed Docker inspect host-mode coverage is missing.

2 open findings
What changed in this PR

Migrates workload discovery from deprecated address/port fields to protocol-aware endpoint locators across runtimes, storage, and resolution.

Changes:

  • Adds shared TCP locator generation and updates Docker, Kubernetes, and process discovery.
  • Updates A2A probing, CRD schema, tests, and documentation for locators.
  • Bumps Directory dependencies and the Go toolchain to 1.27.1.
File Description
utils/​go.mod Updates Go version.
Taskfile.yml Updates shared Go toolchain version.
store/​go.sum Refreshes store dependency checksums.
store/​go.mod Updates Directory and Kubernetes dependencies.
store/​crd/​store.go Adapts CR construction to updated API types.
server/​go.sum Refreshes server dependency checksums.
server/​go.mod Updates Directory and Kubernetes dependencies.
server/​Dockerfile Updates builder image.
install/​chart/​templates/​discovery.agntcy.io_discoveredworkloads.yaml Adds locator schema and print column.
docs/​dir-component-runtime-discovery.md Documents locator-based discovery.
discovery/​types/​locator.go Adds shared TCP locator generation.
discovery/​types/​locator_test.go Tests sorting, deduplication, and IPv6.
discovery/​runtime/​process/​descriptor.go Accepts and converts process locators.
discovery/​runtime/​process/​descriptor_test.go Tests descriptor validation and conversion.
discovery/​runtime/​k8s/​adapter.go Emits Kubernetes workload locators.
discovery/​runtime/​k8s/​adapter_test.go Tests pod and service locators.
discovery/​runtime/​docker/​adapter.go Emits Docker workload locators.
discovery/​runtime/​docker/​adapter_test.go Tests Docker locator conversion.
discovery/​resolver/​a2a/​resolver.go Probes HTTP origins from locators.
discovery/​resolver/​a2a/​resolver_test.go Tests locator-based A2A resolution.
discovery/​go.sum Refreshes discovery dependency checksums.
discovery/​go.mod Updates API, client, and transitive dependencies.
discovery/​Dockerfile Updates builder image.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread discovery/resolver/a2a/resolver.go Resolved
Comment thread discovery/runtime/docker/adapter.go Resolved
The A2A resolver chose what to probe from the locator URL's scheme, so a
locator declared as slim (or grpc) with an http:// URL was probed. It now
decides from the declared protocol: tcp tries http and https, http and
https use that scheme, and every other protocol is skipped.

Also cover inspectToWorkload's host-mode branch, which derives locators
from the published port bindings.

Signed-off-by: András Jáky <[email protected]>
@akijakya
akijakya enabled auto-merge (squash) October 14, 2026 08:43
@akijakya
akijakya merged commit f2b1586 into main Oct 14, 2026
14 checks passed
@akijakya
akijakya deleted the feat/102-workload-locators branch October 14, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emit workload locators instead of addresses and ports

4 participants