.cursor/skills/update-forklift-version/SKILL.md
Step-by-step guide for updating the kubev2v/forklift Go dependency in kubectl-mtv. Use when bumping the forklift version, syncing settings or CRD types, or checking for upstream changes.
npx skillsauth add yaacov/kubectl-mtv update-forklift-versionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
GOFLAGS=-mod=mod GOPROXY=https://proxy.golang.org,direct \
go get github.com/kubev2v/forklift@latest
go mod tidy
go mod vendor
go build ./...
Verify the build succeeds before proceeding.
Settings are defined in pkg/cmd/settings/types.go in two maps:
SupportedSettings -- commonly configured settingsExtendedSettings -- advanced/less-common settingsFetch the Ansible defaults file (canonical defaults for all settings):
https://raw.githubusercontent.com/kubev2v/forklift/main/operator/roles/forkliftcontroller/defaults/main.yml
For every setting in our maps, compare against the upstream file:
| Check | Action |
|-------|--------|
| Default value mismatch | Update Default field in our definition |
| Setting removed upstream | Search vendored code (vendor/github.com/kubev2v/forklift/) to confirm removal, then delete from our map |
| New setting upstream | Add to SupportedSettings (user-facing) or ExtendedSettings (advanced) with correct type, default, description, and category |
| New category needed | Add to SettingCategory constants and CategoryOrder slice in types.go |
Run go test ./pkg/cmd/settings/... -- the test suite checks:
The Plan CRD types live in the vendor at:
vendor/github.com/kubev2v/forklift/pkg/apis/forklift/v1beta1/plan.go # PlanSpec, PlanStatus
vendor/github.com/kubev2v/forklift/pkg/apis/forklift/v1beta1/plan/vm.go # plan.VM struct
| File | What to update |
|------|---------------|
| cmd/create/plan.go | Add CLI flag, wire into planSpec |
| cmd/patch/plan.go | Add CLI flag, wire into PatchPlanOptions |
| pkg/cmd/patch/plan/plan.go | Handle new field in patch builder |
| pkg/cmd/describe/plan/describe.go | Display new field in buildSpecSection |
| MCP help generator | If the flag should be visible to AI assistants |
| File | What to update |
|------|---------------|
| cmd/patch/plan.go (NewPlanVMCmd) | Add CLI flag for VM-level field |
| pkg/cmd/patch/plan/plan.go (PatchPlanVM) | Handle new VM field in patch |
| pkg/cmd/describe/plan/describe.go (buildVMsSection) | Display new VM field |
When a PlanSpec bool has +kubebuilder:default:=true, the API server auto-sets it.
If the CLI needs to explicitly set it to false, a post-create patch is required
(see existing pattern in pkg/cmd/create/plan/plan.go for MigrateSharedDisks,
PreserveStaticIPs, UseCompatibilityMode, etc.).
Fields like InstallLegacyDrivers and EnableNestedVirtualization use *bool
so they can be nil (auto-detect), true, or false. The CLI flag should be a
StringVar accepting "true", "false", or "auto" (= nil/auto-detect).
Use "auto" as the default in create commands. In patch commands use ""
as the default (meaning "don't change") and add a Changed flag so that
--flag auto can explicitly clear the field back to nil.
Also review for changes in:
vendor/github.com/kubev2v/forklift/pkg/apis/forklift/v1beta1/provider.go # ProviderSpec, ProviderType
vendor/github.com/kubev2v/forklift/pkg/apis/forklift/v1beta1/mapping.go # NetworkPair, StoragePair, DestinationNetwork
vendor/github.com/kubev2v/forklift/pkg/apis/forklift/v1beta1/host.go
vendor/github.com/kubev2v/forklift/pkg/apis/forklift/v1beta1/hook.go
Key things to watch:
ProviderType constants (new source provider types)StorageVendorProduct enum values (update completion lists)DestinationNetwork.Type enum values (update network pair parsing)MigrationType constantsProviderSpec.Settings keysgo test ./... -count=1
go build ./...
After vendoring the new version, a fast way to spot changes:
# See what files changed in the vendored forklift package
git diff --name-only -- vendor/github.com/kubev2v/forklift/
# Detailed diff of CRD types
git diff -- vendor/github.com/kubev2v/forklift/pkg/apis/
tools
Reference for building, releasing, publishing images, and deploying kubectl-mtv. Use when creating releases, building binaries or container images, deploying to OpenShift, or updating the Krew plugin index.
tools
Guide for writing and running tests in kubectl-mtv, including Go unit tests, MCP e2e tests (Python/pytest), and linting. Use when adding tests, running the test suite, or debugging test failures.
tools
Guide for adding or modifying MCP tools and understanding command discovery in kubectl-mtv. Use when working on the MCP server, adding new tools, or changing how commands are exposed to AI assistants.
documentation
Guide for adding and editing chapters in the kubectl-mtv technical guide (Jekyll + GitHub Pages). Use when writing documentation, adding chapters, or updating the guide table of contents.