Skip to content

feat(api): add locators to runtime workloads - #2302

Merged
akijakya merged 1 commit into
mainfrom
feat/2299-workload-locators
Oct 8, 2026
Merged

akijakya merged 1 commit into
mainfrom
feat/2299-workload-locators

Conversation

@akijakya

@akijakya akijakya commented Oct 8, 2026

Copy link
Copy Markdown
Member

Adds transport-neutral locators to the runtime Workload and deprecates addresses and ports, as the first step of #2299.

Changes

  • New WorkloadLocator message (protocol, url) and repeated WorkloadLocator locators = 12 on Workload. Each locator embeds the full endpoint URL, e.g. http://10.244.0.9:9999 or slim://org/namespace/agent.
  • addresses (8) and ports (9) are marked deprecated = true, still populated and still serialized.
  • DiscoveredWorkload CRD print columns: Locators added; Addresses and Ports moved to the wide output (priority=1).
  • Regenerated workload.pb.go; the DeepCopy test covers locators.

Why deprecate first

dirctl daemon embeds dir-runtime (cli/go.mod requires dir-runtime/discovery, server and store v1.3.6), and dir-runtime sets Addresses/Ports. Removing the fields here breaks the cli build until a dir-runtime release no longer uses them, and dir-runtime can only switch once this API is released. Order:

  1. This PR: add locators, deprecate addresses/ports (non-breaking).
  2. dir-runtime: emit locators and probe HTTP(S) locators in the A2A resolver; drop the org.agntcy/locator annotation convention.
  3. Follow-up here: bump dir-runtime, remove addresses/ports and reserve their names and numbers.

Testing

  • go test ./runtime/... in api, golangci-lint on api.
  • buf lint and buf breaking against main pass.
  • client, server, cli and tests modules build.

Refs #2299

Add a repeated WorkloadLocator (protocol + URL) field to the runtime
Workload so endpoints are described transport-neutrally, and deprecate
addresses and ports in favor of it. The fields are removed in a
follow-up once dir-runtime emits locators, since dirctl embeds
dir-runtime and depends on them.

Refs #2299

Signed-off-by: András Jáky <[email protected]>
@akijakya
akijakya requested a review from a team as a code owner October 8, 2026 08:58
@akijakya akijakya added kind/feature Categorizes issue or PR as related to a new feature. area/dir/api labels Oct 8, 2026
@akijakya akijakya self-assigned this Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped⏩ skipped✅ passedOct 8, 2026, 8:58 AM

@github-actions github-actions Bot added the size/XS Denotes a PR that changes 0-49 lines label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped⏩ skipped✅ passedOct 8, 2026, 8:58 AM

@ramizpolic ramizpolic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

nit: did we rebuild the CRD for the discovered workload? The kubebuilder helps propagate these changes back to runtime

@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@akijakya

akijakya commented Oct 8, 2026 •

Copy link
Copy Markdown
Member Author

nit: did we rebuild the CRD for the discovered workload? The kubebuilder helps propagate these changes back to runtime

No CRD manifest to rebuild here: api:gen ran controller-gen for the CRD types, and the DeepCopy output is unchanged because the spec is the proto Workload. The YAML is generated in dir-runtime (task crd:gen), which picks up locators and the new print columns when it bumps the API; that's tracked in agntcy/dir-runtime#102, together with switching to emitting locators, so the CRD schema doesn't prune them.

Merged via the queue into main with commit cc5b967 Oct 8, 2026
38 checks passed
@akijakya
akijakya deleted the feat/2299-workload-locators branch October 8, 2026 11:03
akijakya added a commit to agntcy/dir-runtime that referenced this pull request Oct 13, 2026
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]>
akijakya added a commit to agntcy/dir-runtime that referenced this pull request Oct 14, 2026
* chore(deps): bump dir API and client to the locators commit

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]>

* feat(discovery): describe workload endpoints as locators

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

* chore(chart): regenerate DiscoveredWorkload CRD with locators

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

* chore(store): apply Go 1.27 embedded literal modernization

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

* docs: document workload locators

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

* chore(deps): pin dir API and client to agntcy/dir@9252429b

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]>

* fix(discovery): probe card URLs by the locator's protocol

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]>

---------

Signed-off-by: András Jáky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dir/api kind/feature Categorizes issue or PR as related to a new feature. size/XS Denotes a PR that changes 0-49 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants