HYPERFLEET-1437 - feat: Build the named transport registry and store construction - #290
HYPERFLEET-1437 - feat: Build the named transport registry and store construction#290kuudori wants to merge 2 commits into
Conversation
Add desireclient, a transportclient.TransportClient implementation that drives apply/discover/delete through the hyperfleet-applier desire-store contract instead of talking to Kubernetes or Maestro directly, so adapters can target clusters they have no direct network access to. - Add Client (client.go): wraps a desire.SpecStore, constructed via NewClient(store, owner, log) - Add ApplyResource (apply.go): upserts an ApplyDesire from the rendered manifest, deciding create vs. update via the hyperfleet.io/generation annotation (matching k8sclient/maestroclient), and auto-creates the paired ReadDesire so the applied resource becomes visible to discovery - Add GetResource (get.go): decodes a ReadDesire's status into the three-way eventual-consistency contract - not-synced-yet (ErrNotSyncedYet), confirmed-absent (apierrors.NewNotFound via ReasonNotFound), or the mirrored object - returning last-known content on a transient applier-side error rather than treating it as absent - Add DiscoverResources (discover.go): lists ReadDesires for the partition and filters by GVK and discovery criteria client-side, since desire.Identity carries no labels to query by - Add DeleteResource (delete.go): creates a DeleteDesire and removes the sibling ApplyDesire so nothing re-applies; the ReadDesire is deliberately left in place so the resource's disappearance stays observable through discovery - Add TransportContext/buildIdentity (types.go): shared per-request routing (management cluster partition + plural resource type) and desire.Identity construction reused by all four transport methods
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Summary
internal/transportregistry) that builds configured transport clients and backing stores at startup, with lifecycle management viaClose().desireclient(internal/desireclient), atransportclient.TransportClientimplementation that writes apply/delete desires and reads mirrored status through the hyperfleet-applier desire store contract.transportsandstoressections (memory/Redis stores;kubernetesandremotetransport types), validated at load time. Deployments withouttransportskeep the existing Maestro-first / Kubernetes fallback behavior.adapter serveand dry-run throughtransportregistry.Build/BuildRecording, resolving the legacy executor compatibility key (kubernetesormaestro) from the registry.Details
Transport registry (
internal/transportregistry)Build()constructs named transports fromconfig.transportsand shared stores fromconfig.stores.transportsis unset, builds a single Maestro client (if configured) or Kubernetes client under the historical registry keys.kubernetes(direct cluster client) andremote(desire-backed client bound to a named store).memory(in-process) andredis(URL-validated, ping-checked, closed on shutdown).BuildRecording()registers dry-run clients under configured transport names without opening network connections.Desire transport client (
internal/desireclient)desire.SpecStore.ErrNotSyncedYetwhen mirrored content is not yet available.TransportContext(ManagementCluster,Resource) for desire identity and partitioning.Config & wiring
transports,stores(template updated inconfigs/adapter-config-template.yaml).transportclient.Registryprovides explicit name-based lookup (Get(name)); no routing or fallback inside the registry.main.godelegates client construction to the registry and closes owned resources on shutdown.Stacked work
This branch includes HYPERFLEET-1436 (desireclient foundation) plus HYPERFLEET-1437 (registry construction and integration). Also carries recent main-branch dependency/Konflux updates.
Test plan
make lintmake testmake test-integration(if Docker/Podman available)adapter servewith legacy config (notransports) - confirm Maestro/Kubernetes behavior unchangedadapter servewith namedtransports+stores(memory Redis) - confirm startup and registry constructionadapter serve --dry-run-event event.json- confirmBuildRecordingpath works