ocp

An OpenShift provider for Forklift, a tool that migrates virtual machines between environments. OpenShift is Red Hat's Kubernetes-based platform; this provider can be the migration destination and can also be a source for OpenShift-to-OpenShift moves.

In plain words
What is it for?
It is for discovering OpenShift namespaces, storage classes, network definitions, virtual machines, and virtual-machine instances during migrations.
Why use it?
It gives Forklift access to OpenShift clusters and the resources needed to plan and run migrations.

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/ocp
Clone the repo
git clone --depth 1 https://github.com/kubev2v/forklift-console-plugin

Made for: Cursor.

Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,588 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.00017 $0.03588
Opus 5 $0.00009 $0.01794
Sonnet 5 $0.00003 $0.00718
Haiku 4.5 $0.00002 $0.00359

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

Security

Grade A, and why

ocp 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/ocp.mdc · 372 lines

How it starts

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

OpenShift (OCP) Provider

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

Overview

The OpenShift provider is unique among Forklift providers: it serves as the migration target in every migration, and can also act as a source for OCP-to-OCP (live) migrations. Unlike source-only providers (vSphere, oVirt, OpenStack), it watches native Kubernetes/KubeVirt resources rather than connecting to a vendor-specific API.

Dual Role

Role When Resources used
Target Every migration StorageClasses, NetworkAttachmentDefinitions, Namespaces
Source OCP live migration VirtualMachines, VirtualMachineInstances

Host vs Remote Provider

  • Host provider (Spec.URL == ""): represents the local cluster where Forklift is installed. Uses the controller's in-cluster ServiceAccount. Determined by Provider.IsHost().
  • Remote OCP provider: connects to a different OCP cluster via Spec.URL + Secret containing a bearer token.
  • Restricted host provider: a host-type provider created outside the operator namespace (POD_NAMESPACE). Scoped to its own namespace only; API requests use the requesting user's token for RBAC. Determined by Provider.IsRestrictedHost().

Source Files

pkg/controller/provider/
├── container/ocp/    # Inventory collector (K8s watches)
│   ├── collector.go  # Collector factory, Version() stub
│   └── collection.go # Collection types wrapping K8s objects
├── model/ocp/        # Data model (SQLite-backed)
│   ├── model.go      # Base, Namespace, StorageClass, NAD, VM, etc.
│   ├── tree.go       # Tree kinds (VmKind, NamespaceKind)
│   └── doc.go        # All() returns registered model types
└── web/ocp/          # REST API handlers (gin)
    ├── doc.go         # Handler registration, Root path
    ├── base.go        # Base handler, UserClient, list helpers
    ├── provider.go    # GET /providers/openshift[/:uid]
    ├── namespace.go   # .../namespaces[/:uid]
    ├── storageclass.go          # .../storageclasses[/:uid]
    ├── netattachdefinition.go   # .../networkattachmentdefinitions[/:uid]
    ├── vm.go                    # .../vms[/:uid]
    ├── instancetype.go          # .../instancetypes[/:uid]
    ├── clusterinstancetype.go   # .../clusterinstancetypes[/:uid]
    ├── persistentvolumeclaim.go # .../persistentvolumeclaims[/:uid]
    ├── datavolume.go            # .../datavolumes[/:uid]
    ├── kubevirt.go              # .../kubevirts[/:uid]
    ├── tree.go        # .../tree/namespace (VM-by-namespace tree)
    ├── resource.go    # Base REST resource struct
    └── client.go      # Finder + Resolver for ref-based lookups

Read the full file on GitHub · 372 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 · 372 lines · 17 tokens per session scan A a0f25ab40bb2

Subscribe to this mod's changes

ocp is a cursor rule published in the GitHub repository kubev2v/forklift-console-plugin (11 stars, last pushed 3d ago), licensed Apache-2.0. It adds 17 tokens to every session and 3,588 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.

Related

Other cursor rules, from other repositories