Skip to content

refactor(phase2): dedup VTEP registration and suspend-state cleanup - #27

Merged
syscod3 merged 1 commit into
mainfrom
chore/phase2-simplify
Jul 7, 2026
Merged

refactor(phase2): dedup VTEP registration and suspend-state cleanup#27
syscod3 merged 1 commit into
mainfrom
chore/phase2-simplify

Conversation

@syscod3

@syscod3 syscod3 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Post-merge /simplify cleanup pass over the Phase 2 suspend-on-idle diff. No behaviour change intended.

Changes

  • Extract ensureVTEPAndFDB helperhandleScheduled and handleResuming had two near-identical VTEP-register + FDB-sync blocks. Now both route through one helper. Side effect: resume now registers the VTEP under a vtep_register child span (it was omitted on the resume path before), and the log wording is unified.
  • handleTerminating — compute suspendDirFor(vm) once instead of calling it twice.
  • scheduler NodeInfo — rename Used{VCPU,MemoryMiB}Resident{VCPU,MemoryMiB} to match the field's documented meaning (resident excludes Suspended VMs); inline the single-use oversubscribed local into the log call.
  • clearSuspendState helper — the two node-loss reschedule branches each cleared the same two status fields; extracted into one helper.

Verification

  • go build ./... (host + GOOS=linux) clean
  • go test ./internal/controller/... green
  • agent test package compiles (GOOS=linux go test -c)
  • pre-commit golangci-lint passed

Post-merge cleanup pass over the Phase 2 suspend-on-idle diff:

- Extract ensureVTEPAndFDB helper; route handleScheduled and handleResuming
  through it. Resume now registers the VTEP under a vtep_register child span
  (previously omitted) and log wording is unified.
- handleTerminating: compute the suspend dir once instead of calling
  suspendDirFor twice.
- scheduler: rename NodeInfo.Used{VCPU,MemoryMiB} to Resident{VCPU,MemoryMiB}
  to match its documented meaning; inline the single-use oversubscribed local.
- Extract clearSuspendState helper for the two node-loss reschedule branches.
@syscod3
syscod3 merged commit a0edd88 into main Jul 7, 2026
17 checks passed
@syscod3
syscod3 deleted the chore/phase2-simplify branch July 7, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant