Repository navigation
feat(fc): Firecracker zero-YAML CLI flags, then rename provider firecracker → fc - #919
Merged
Merged
Conversation
…r.yaml Mirrors the Hetzner pass (#918) for Firecracker so the provider works with no .onctl YAML: - setDefaults(): firecracker.* defaults (kernelImage, rootfsImage, vcpuCount, memSizeMib, binPath, network.bridge/cidr, vm.username) matching the old firecracker.yaml. providerfirecracker.GetConfig still defaults these for direct package use; kernelImage/rootfsImage (which GetConfig left empty) now resolve to the conventional ~/.onctl paths with no config. - create flags --kernel-image, --rootfs-image, --fc-binary, --vcpu, --memory bound to the firecracker.* keys read by GetConfig; the generic --username also drives firecracker.vm.username. - Removed embedded internal/files/init/firecracker.yaml (`onctl init` no longer scaffolds it). - flags_defaults_test.go covers the new flags' existence, viper binding, and defaults. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ha7EmqjjYwGC3f1wk41TE2
Renames the provider *identity* from `firecracker` to `fc` while keeping every reference to the Firecracker technology/binary intact: - Provider string: `--provider fc`, `ONCTL_CLOUD=fc`, cloudProviderList entry. - Config keys: firecracker.* -> fc.* (e.g. fc.kernelImage, fc.vcpuCount, fc.network.bridge, fc.vm.username). - Package internal/providerfirecracker -> internal/providerfc. - Exported Go types: ProviderFirecracker->ProviderFC, FirecrackerConfig->FCConfig, FirecrackerVMConfig->FCVMConfig, FirecrackerProcess->FCProcess, FirecrackerAPI->FCAPI (plus unexported helpers: firecrackerRequest->fcRequest, firecrackerStatus*->fcStatus*, defaultFirecrackerKernelArgs->defaultFCKernelArgs, firecrackerMAC/TapName/VM, parseFirecrackerType, load/saveFirecrackerMetadata, allocateFirecrackerIP, and the test helpers). - Files pkg/cloud/firecracker.go -> fc.go, firecracker_test.go -> fc_test.go. - README provider name + ONCTL_CLOUD updated. Deliberately KEPT (these name the Firecracker technology, not the provider): - the literal `firecracker` binary name (fc.binPath default), - the ~/.onctl/firecracker image/state directory paths (so existing image layouts keep working), - comments/strings describing the Firecracker API, VMM and microVMs, - the firecracker/firecracker-host-setup.sh template path in the README. go build / go vet / go test ./... all green; gofmt clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ha7EmqjjYwGC3f1wk41TE2
Walkthrough for testing this branch on a GCP fc-host VM: building/copying the binary, running create/pause/resume/destroy against the new `fc` provider and flags, and confirming the old `firecracker` provider name is rejected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ha7EmqjjYwGC3f1wk41TE2
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #919 +/- ##
==========================================
+ Coverage 22.41% 22.81% +0.40%
==========================================
Files 42 42
Lines 4163 4182 +19
==========================================
+ Hits 933 954 +21
+ Misses 3114 3113 -1
+ Partials 116 115 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c95d4d5f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
initState only let the hetzner provider skip a missing/unreadable config file. The fc provider now ships built-in defaults too (this PR), so it needs the same configless path or fresh `ONCTL_CLOUD=fc` runs abort before defaults/flags are applied. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gf7TpG2y985TySw8Pg7Cn3
This was referenced Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related changes for the local Firecracker provider, in two commits:
feat(create)— bring Firecracker to parity with the Hetzner zero-YAML pass (feat(create): expose Hetzner config as CLI flags; drop required .onctl YAML #918): everyfirecracker.yamlsetting is now a CLI flag with a default, so the provider works with no.onctlconfig.refactor— rename the provider identity fromfirecrackertofc(string, config keys, package, types, filenames), while keeping every reference to the Firecracker technology/binary intact.Commit 1 — Firecracker CLI flags; drop
firecracker.yamlsetDefaults(): defaults for thefirecracker.*keys (kernelImage, rootfsImage, vcpuCount, memSizeMib, binPath, network.bridge/cidr, vm.username) matching the old YAML.GetConfigalready defaulted most of these for direct package use;kernelImage/rootfsImage(previously empty) now resolve to the conventional~/.onctl/firecracker/images/...paths with no config.createflags bound to the keys the code already reads:--kernel-image,--rootfs-image,--fc-binary,--vcpu,--memory. The generic--usernamealso drives the microVM user.internal/files/init/firecracker.yaml(onctl initno longer scaffolds it).flags_defaults_test.gocovers the new flags' existence, viper binding, and defaults.Commit 2 — rename provider
firecracker→fc--provider fc,ONCTL_CLOUD=fc,cloudProviderListentry.firecracker.*→fc.*(e.g.fc.kernelImage,fc.vcpuCount,fc.network.bridge,fc.vm.username).internal/providerfirecracker→internal/providerfc.ProviderFirecracker→ProviderFC,FirecrackerConfig→FCConfig,FirecrackerVMConfig→FCVMConfig,FirecrackerProcess→FCProcess,FirecrackerAPI→FCAPI(plus unexported helpers and test funcs).pkg/cloud/firecracker.go→fc.go,firecracker_test.go→fc_test.go.ONCTL_CLOUDupdated.Deliberately kept (these name the Firecracker technology, not the provider)
firecrackerbinary name (fc.binPathdefault);~/.onctl/firecrackerimage/state directory paths, so existing image layouts keep working;firecracker/firecracker-host-setup.shtemplate path in the README.Breaking changes
Renaming the provider identity is breaking for existing Firecracker users:
--provider firecracker/ONCTL_CLOUD=firecracker→fcfirecracker:config block →fc:(note:onctl initno longer writes this file; defaults cover it)Tests
go build ./...,go vet ./...,go test ./...all green;gofmtclean.onctl create --helpshows the new flags;onctl initno longer scaffolds a firecracker/fc YAML.🤖 Generated with Claude Code