Skip to content

HYPERFLEET-1437 - feat: Build the named transport registry and store construction - #290

Draft
kuudori wants to merge 2 commits into
openshift-hyperfleet:mainfrom
kuudori:HYPERFLEET-1437-transport-registry
Draft

HYPERFLEET-1437 - feat: Build the named transport registry and store construction#290
kuudori wants to merge 2 commits into
openshift-hyperfleet:mainfrom
kuudori:HYPERFLEET-1437-transport-registry

Conversation

@kuudori

@kuudori kuudori commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Introduces a named transport registry (internal/transportregistry) that builds configured transport clients and backing stores at startup, with lifecycle management via Close().
  • Adds desireclient (internal/desireclient), a transportclient.TransportClient implementation that writes apply/delete desires and reads mirrored status through the hyperfleet-applier desire store contract.
  • Extends deployment config with transports and stores sections (memory/Redis stores; kubernetes and remote transport types), validated at load time. Deployments without transports keep the existing Maestro-first / Kubernetes fallback behavior.
  • Wires adapter serve and dry-run through transportregistry.Build / BuildRecording, resolving the legacy executor compatibility key (kubernetes or maestro) from the registry.

Details

Transport registry (internal/transportregistry)

  • Build() constructs named transports from config.transports and shared stores from config.stores.
  • Legacy path: when transports is unset, builds a single Maestro client (if configured) or Kubernetes client under the historical registry keys.
  • Named path: supports kubernetes (direct cluster client) and remote (desire-backed client bound to a named store).
  • Stores: memory (in-process) and redis (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)

  • Implements apply, get, discover, and delete against desire.SpecStore.
  • Creates paired read desires for apply operations; surfaces ErrNotSyncedYet when mirrored content is not yet available.
  • Uses TransportContext (ManagementCluster, Resource) for desire identity and partitioning.

Config & wiring

  • New YAML fields on adapter deployment config: transports, stores (template updated in configs/adapter-config-template.yaml).
  • transportclient.Registry provides explicit name-based lookup (Get(name)); no routing or fallback inside the registry.
  • main.go delegates 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 lint
  • make test
  • make test-integration (if Docker/Podman available)
  • adapter serve with legacy config (no transports) - confirm Maestro/Kubernetes behavior unchanged
  • adapter serve with named transports + stores (memory Redis) - confirm startup and registry construction
  • adapter serve --dry-run-event event.json - confirm BuildRecording path works
  • Remote transport: apply/get/discover/delete against a desire store (manual or integration)

Ruclo and others added 2 commits September 1, 2026 14:05
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
@openshift-ci

openshift-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rh-amarin for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (2)
  • do-not-merge/work-in-progress
  • do-not-merge/hold

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 917575e5-7ce1-44e6-a330-d96164649c8c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants