provider-controller

A controller for managing provider connections and their inventory collectors in the Forklift backend. A controller is a program that repeatedly checks resources and changes them until they match the desired state.

In plain words
What is it for?
Use it to manage Provider resources, secrets, OVA or Hyper-V provider servers, connection checks, inventory collectors, SSH readiness, and SMB CSI validation.
Why use it?
It standardizes provider setup, validation, connection tests, inventory creation, status phases, updates, and cleanup. This reduces manual coordination when credentials, provider servers, or collected inventory change.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/kubev2v/forklift-console-plugin/provider-controller
Clone the repo
git clone --depth 1 https://github.com/kubev2v/forklift-console-plugin

Made for: Cursor.

Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,852 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00014 $0.02852
Opus 5 $0.00007 $0.01426
Sonnet 5 $0.00003 $0.00570
Haiku 4.5 $0.00001 $0.00285

Measured 2d ago against content hash 33f946d7b94a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

provider-controller scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/backend/providers/provider-controller.mdc · 251 lines

How it starts

The opening of the file, as written. The whole thing — 251 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Provider Controller (Common)

Analyzed from commit: 412c71822 on 2026-05-04

Source: pkg/controller/provider/ in the forklift backend.


Reconciliation Loop

The Provider controller watches Provider, Secret, OVAProviderServer, and HyperVProviderServer resources. On each reconcile cycle it runs the following steps in order:

Reconcile(request)
│
├─ 1. Fetch Provider CR (delete container if NotFound)
├─ 2. Set phase = Staging, begin staging conditions
├─ 3. Provider-server lifecycle (OVA / HyperV only)
│     ├─ If deletion → cleanupProviderServer (remove server + finalizer)
│     └─ If alive → ensureProviderServer (create/redeploy)
├─ 4. Validate
│     ├─ validateType
│     ├─ validateURL
│     ├─ validateSecret (provider-type-specific key checks)
│     ├─ testConnection (builds ephemeral collector, calls Test())
│     ├─ inventoryCreated (checks collector parity)
│     ├─ validateSSHReadiness (vSphere + SSH method only)
│     └─ validateSMBCSI (HyperV only)
├─ 5. Ensure SSH keys (vSphere only)
├─ 6. Update container (build/replace inventory collector)
├─ 7. Ready check
│     └─ If no blocker AND ConnectionTestSucceeded + InventoryCreated → phase = Ready
├─ 8. Update DB (sync provider into collector owner)
├─ 9. Requeue
│     ├─ SlowReQ  if not yet ConnectionTestSucceeded + InventoryCreated
│     └─ LongReQ  for periodic re-testing
│
└─ deferred: EndStagingConditions → updateProviderStatus
             Stop reconciliation entirely on ConnectionAuthFailed

Key behaviors

  • Generation tracking: HasReconciled() compares ObservedGeneration with Generation. When the provider spec changes, the old collector is shut down and its DB closed before a new one is created.
  • Secret change detection: SecretResourceVersion in status tracks the last reconciled secret version. When it changes the collector is replaced even if the provider spec hasn't changed.
  • Auth failure stops reconciliation: If ConnectionAuthFailed is set, RequeueAfter is zeroed and no further reconciles happen until the secret/spec changes (prevents account lockout).

Read the full file on GitHub · 251 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 251 lines · 14 tokens per session scan A 33f946d7b94a

Subscribe to this mod's changes

provider-controller is a cursor rule published in the GitHub repository kubev2v/forklift-console-plugin (11 stars, last pushed 2d ago), licensed Apache-2.0. It adds 14 tokens to every session and 2,852 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.