Repository navigation
feat(api): add locators to runtime workloads - #2302
Conversation
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]>
|
The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).
|
|
The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).
|
ramizpolic
left a comment
There was a problem hiding this comment.
LGTM
nit: did we rebuild the CRD for the discovered workload? The kubebuilder helps propagate these changes back to runtime
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
No CRD manifest to rebuild here: |
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]>
* 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]>
Adds transport-neutral locators to the runtime
Workloadand deprecatesaddressesandports, as the first step of #2299.Changes
WorkloadLocatormessage (protocol,url) andrepeated WorkloadLocator locators = 12onWorkload. Each locator embeds the full endpoint URL, e.g.http://10.244.0.9:9999orslim://org/namespace/agent.addresses(8) andports(9) are markeddeprecated = true, still populated and still serialized.DiscoveredWorkloadCRD print columns:Locatorsadded;AddressesandPortsmoved to the wide output (priority=1).workload.pb.go; the DeepCopy test covers locators.Why deprecate first
dirctl daemonembeds dir-runtime (cli/go.modrequiresdir-runtime/discovery,serverandstorev1.3.6), and dir-runtime setsAddresses/Ports. Removing the fields here breaks theclibuild until a dir-runtime release no longer uses them, and dir-runtime can only switch once this API is released. Order:locators, deprecateaddresses/ports(non-breaking).org.agntcy/locatorannotation convention.addresses/portsand reserve their names and numbers.Testing
go test ./runtime/...inapi, golangci-lint onapi.buf lintandbuf breakingagainstmainpass.client,server,cliandtestsmodules build.Refs #2299