review: whole-repo simplify pass - #52
Merged
Merged
Conversation
…yout into vm/ - replace four hand-rolled ctx-cancelable sleeps with commonk8s.SleepCtx - cmp.Or for empty-string fallbacks; errors.AsType for error matching - inline single-call-site forwarders (probes.applyResult, stats read*Usage) - probePort: narrow RLock read instead of a full pod DeepCopy per probe tick - move cocoon run-dir layout knowledge (COW size, console socket, cloudimg probe) from provider/cocoon into vm/rundir.go - single owner for quantity-to-CLI-arg conversion (vm.normalizeSizeArg) - tests: wire Probes once in newTestProvider (-67 duplicated lines) - reattach the isCocoonNotFound godoc that sat on startCmdPipe
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
/code+/simplifyaudit round. Behavior-preserving cleanups only:selectblocks withcommonk8s.SleepCtx(provider watcher backoff/restart, probe loop, SAC dial retry).cmp.Orfor empty-string fallbacks (NewLeaseParser,NewCocoonCLI);errors.AsTypefor error matching (Go 1.26).probes.applyResult,stats.readNodeUsage,stats.readProcessUsage.probePortnow reads the annotation underRLockinstead of deep-copying the whole pod on every probe tick.provider/cocoonintovm/rundir.go, restoring thevm/-owns-cocoon-internals boundary.vm.normalizeSizeArgthe single owner of quantity→CLI-arg conversion; the provider passes raw quantity strings for memory, same as storage.Probesonce innewTestProvider(−67 duplicated assembly lines); drop a dead channel inprobes_test.isCocoonNotFoundgodoc that sat onstartCmdPipe.Gates: golangci-lint 0 issues (linux+darwin), asl clean (linux+darwin),
go test -race ./...green. Net −87 lines.