Repository navigation
review round: deps to k8s 0.37, dot-free hashed VM names, meta exports for the toolbox name and hibernate import suffix - #32
Merged
Conversation
…oller-runtime v0.24.1→v0.25.1, controller-tools v0.20.1→v0.22.0, go-containerregistry v0.21.7→v0.22.1, klauspost/compress v1.19.2→v1.20.0, x/sync v0.22.0→v0.23.0
The enum table said an empty ConnType infers from the OS alone, while meta.ConnectionType checks the VNC port first.
Toolbox VM names always came from the pod name, and since #31 agent VM names do too (VMNameForDeployment delegates to VMNameForPod); the namespace/deployment/slot wording described neither.
…Shutdown errors directly context.WithoutCancel at the shutdown site says what the shutdownParent variable and its comment restated, and the nil check before storing a Shutdown error only kept a nil slot nil.
apis/v1 has registered through runtime.NewSchemeBuilder(addKnownTypes) with no init() since 937a6a5; the exclusion and its comment described the removed kubebuilder init() pattern and only exempted the package from a rule it already meets.
…r, webhook and vk-cocoon cocoon-operator (toolboxPodName) and cocoon-webhook (cs.Name+"-"+tb.Name) each compose the toolbox pod name, and vk-cocoon (import name) and cocoon-webhook (VM name budget) each spell the hibernate import suffix; the shared contract lives here so they can switch to it.
CMGS
force-pushed
the
review/whole-repo-0924
branch
from
September 24, 2026 03:13
aa88d81 to
b855ae1
Compare
…ies no dot cocoon uses the VM name as the guest hostname, and cloud-init and cloudbase-init keep only the part before the first dot, so since #31 every cloudimg and Windows guest in a namespace came up as vk-<namespace>. Dots in the pod name (a CocoonSet name may carry them) become dashes, and six hex digits of sha256(namespace/pod) over the original name keep the dash-joined name unique and recomputable (the operator re-derives the main agent's name after its pod is gone). ExtractAgentSlot now accepts a name only when VMNameForDeployment reproduces it.
CMGS
force-pushed
the
review/whole-repo-0924
branch
from
September 24, 2026 03:46
b855ae1 to
cb77dc2
Compare
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.
Whole-repo review round (style, simplify, comment budget, hot path, modern Go, docs sync, dependencies, loc-justify). Every tracked file was read in full; no bug reachable from a real caller was found. The exported surface only grows (two additive exports); nothing is unexported or removed. The one contract change is the VM name format (see
meta:below).Commits
deps:k8s.io/{api,apimachinery,client-go} v0.36.3 -> v0.37.0 in lock-step, controller-runtime v0.24.1 -> v0.25.1, controller-tools v0.20.1 -> v0.22.0 (the regenerated CRDs change only the version annotation), go-containerregistry v0.21.7 -> v0.22.1, klauspost/compress v1.19.2 -> v1.20.0, x/sync v0.22.0 -> v0.23.0;go mod tidyvia the proxy. projecteru2/core stays at v0.1.3 (only itslogpackage is used). cocoon-operator, cocoon-webhook, cocoon-net and vk-cocoon build and pass their race suites against this HEAD through a scratchreplace.docs:apis.md— an emptyConnTypeinfers from the VNC port before the OS.review:AnnotationVMName's godoc names the pod as the VM name's source (since meta: name VMs vk-<namespace>.<pod> #31 agent names also derive from the pod name).simplify:httpx.Runderives the shutdown context in place and storesShutdownerrors directly (-3).build:drop theapis/v1gochecknoinitsexclusion; the package has registered throughruntime.NewSchemeBuilderwith noinit()since 937a6a5.meta:VM names becomevk-<namespace>-<pod>-<hash>, where<hash>is 6 hex digits of sha256(<namespace>/<pod>). cocoon uses the VM name as the guest hostname, and cloud-init and cloudbase-init keep only the part before the first dot, so since meta: name VMs vk-<namespace>.<pod> #31 every cloudimg and Windows guest in a namespace came up asvk-<namespace>. Dots in the pod name (a CocoonSet name may carry them, e.g.demo.v1) become dashes; the hash covers the original name, sodemo.v1-0anddemo-v1-0stay distinct (pinned by a test that fails if the hash is taken after the replacement). The hash keeps the dash-joined name unique (team-a/dev-0andteam/a-dev-0differ) and recomputable, which the operator needs to find the main agent's snapshots after its pod is gone.team-a/dev-0andteam/a-dev-0stay pinned as distinct by a regression test.ExtractAgentSlotaccepts a name only whenVMNameForDeploymentreproduces it, so no toolbox of this or a longer-named set reads as an agent slot (both cases pinned by tests that fail without the check). Cost: one sha256 of under 64 bytes per name build, off every hot path. The engine stays unaware of the control plane: cocoon itself is unchanged. The webhook's 46-character budget now coversvk-+ namespace + pod + the 7-character hash, i.e. namespace + pod at most 35. Cutover: meta: name VMs vk-<namespace>.<pod> #31 was never released, so this changes names relative to the releasedvk-<ns>-<pod>; the meta: name VMs vk-<namespace>.<pod> #31 rollout note applies unchanged (a release-hibernated set woken after rollout boots fresh; an in-flight migration of an old-name main stalls).meta:exportToolboxPodName(cocoonSet, toolbox)andHibernateImportSuffix. cocoon-operator (toolboxPodName) and cocoon-webhook (cs.Name+"-"+tb.Name) each compose the toolbox pod name; vk-cocoon (import name) and cocoon-webhook (VM name budget) each spell"-hibernate-import". AGENTS.md §4 puts shared contracts here; the three repos switch to these once this PR merges and their pin moves.Adversarial read of #31 (
meta/vmname.go)Every caller in the four repos agreed with the #31 scheme, and three candidate bugs were [contrived]. The read did surface the dotted guest hostname, which the
meta:commit above resolves.loc-justify (report only, nothing applied)
Every package EARNED; standing rejections (the 7 unexport candidates, the push/pull envelope copy) are unchanged; the
n < 0clause ofExtractAgentSlotwent away with the recompute check. Details in the review ledger.Gates
golangci-lint
0 issues.on linux and darwin;make fmt-checkclean;asl -forwarder=falseclean on both GOOS, advisory forwarder run empty;go buildon both GOOS;go test -race -count=1 ./...clean on darwin and in agolang:1.27linux/arm64 container;make generate manifestsproduces no drift. GitHub Actions are at their latest releases.