Deferred, non-blocking cleanup opportunities identified during review of the Rosetta x86 / multi-platform PRs (#279, kernel/hypeman-cli#54). None affect behavior; they were intentionally left out to keep those PRs reviewable. Two are marked inline with TODO(followup) and link here.
hypeman (server)
hypeman-cli
Filed from the reviewer cleanup pass; see the discussion on #279.
Deferred, non-blocking cleanup opportunities identified during review of the Rosetta x86 / multi-platform PRs (#279, kernel/hypeman-cli#54). None affect behavior; they were intentionally left out to keep those PRs reviewable. Two are marked inline with
TODO(followup)and link here.hypeman (server)
Resolve/ResolveForPlatform(lib/images/reference.go) — near-duplicate methods differing only by platform-aware vs platform-less manifest inspection; collapse behind one path. (inlineTODO(followup))createAndQueueImagere-resolves the platform (lib/images/manager.go) —CreateImagealready parsed/validated the platform; pass it in instead of callingresolveRequestPlatformagain, which also removes the effectively-unreachable error branch. (inlineTODO(followup))ResolvedRef.DigestRef()helper — replace hand-assembledrepo + "@" + digeststrings with a method onResolvedRef.conversionFailedErr(msg)helper — extract the 3 duplicatedWaitForReadyfailure-message branches inlib/images/manager.go.ErrRateLimitedand useerr.Error()in the handlers (cmd/api/api/{images,instances}.go).assertFailsFastNotFoundhelper for the two structurally identical fail-fast restore tests; a genericcaptureManager[Req]to collapse the 4 near-identical capture mocks (cmd/api/api/instances_test.go).hypeman-cli
WithJSONSet/RawJSONworkarounds once thehypeman-goSDK exposes a typedplatformfield —inspect/image list/run/pullcan then read the typed field directly. Marked inline withTODO(sdk-bump:...).Filed from the reviewer cleanup pass; see the discussion on #279.