Skip to content

Add V2 physical container volumes - #243

Draft
David Negstad (danegsta) wants to merge 3 commits into
danegsta-danegsta-v2-physical-networkfrom
danegsta-v2-physical-container-volume
Draft

Add V2 physical container volumes#243
David Negstad (danegsta) wants to merge 3 commits into
danegsta-danegsta-v2-physical-networkfrom
danegsta-v2-physical-container-volume

Conversation

@danegsta

@danegstaDavid Negstad (danegsta) commented Aug 18, 2026

Copy link
Copy Markdown
Member

Summary

  • add the namespaced V2 PhysicalContainerVolume API, validation, generated models/deepcopy/OpenAPI, and registration
  • add an ObjectStateMap-backed controller for creating or referencing runtime volumes with durable queued-operation results, namespace gating, monitoring, retries, and finalizer-driven deletion
  • align volume ownership with the V2 physical-resource contract, including opt-in collision replacement and unconditional retention of ID-referenced volumes
  • wire namespace cleanup, controller startup, test environments, and startup harvesting for abandoned non-persistent created volumes
  • document the completed physical volume roadmap item without rewiring PhysicalContainer

Ownership and runtime behavior

spec.volumeID references an existing runtime volume. Referenced volumes are always retained when the API resource is deleted; persistent and replaceExisting are creation-only and rejected with volumeID.

spec.volumeName creates a runtime volume. Created volumes are removed on deletion unless spec.persistent is true. A same-name collision is terminal and non-destructive by default. With spec.replaceExisting, the controller inspects the requested name, removes only the canonical resolved volume, then creates and tracks its replacement. Runtime objects carrying this resource's UID are adopted after uncertain create results or in-memory state loss.

Removal deliberately uses Force: false: Docker does not remove in-use volumes even with force, while Podman force-removes the containers using the volume. In-use or transient removal failures retain controller progress and retry without removing attached containers; not-found removal races are confirmed by reinspection.

Created volumes carry resource ownership, persistence, and creator-process labels. Startup harvesting lists labeled volumes and removes abandoned non-persistent volumes after abandoned containers, also without force.

Validation

  • make generate
  • make test-prereqs
  • focused API, controller, and test-orchestrator tests
  • targeted V2 volume integration, durability, ownership, replacement, and harvesting tests
  • make lint
  • make test
  • go test -race -count 1 -parallel 32 -timeout 180s ./test/integration -run 'TestUnusedVolumeHarvesting|TestV2PhysicalContainerVolume'

Stacked on danegsta-danegsta-v2-physical-network.

@danegsta
David Negstad (danegsta) marked this pull request as draft August 18, 2026 23:51
@danegsta
David Negstad (danegsta)force-pushed the danegsta-v2-physical-container-volume branch from 7e6e26e to 0a1e3edCompareAugust 19, 2026 00:15
@danegsta
David Negstad (danegsta)force-pushed the danegsta-v2-physical-container-volume branch from 0a1e3ed to eede23cCompareAugust 19, 2026 01:23
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: adc97cfc-61a5-473f-b0a2-e1b981651796
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: adc97cfc-61a5-473f-b0a2-e1b981651796
@danegsta
David Negstad (danegsta)force-pushed the danegsta-v2-physical-container-volume branch from eede23c to 2c55bbdCompareAugust 21, 2026 19:16
Sign up for freeto 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

@danegsta