How project-copacetic/copacetic works
Copa is a Go CLI and BuildKit frontend for patching existing container images. Its main workflow accepts an image and vulnerability report—or selects a comprehensive update—then resolves package updates, builds a patch, and exports, loads, or pushes the patched image. It also supports bulk image/chart patching, language-package updates, native Chisel images, patch-layer generation, and provenance rebuilding. The graph reflects documented behavior and sampled call sites; some unsampled subsystem links are omitted rather than inferred.
Main entry points: single.go Single-image patch · cmd.go Patch command · core.go Patch core · build.go BuildKit frontend
Components 19
User entry points
- Copa CLI
main.go - Patch command
pkg/cmd/cmd.go - BuildKit frontend
pkg/frontend/build.go
Patch orchestration
- Single-image patch
pkg/patch/single.go - Patch core
pkg/patch/core.go - Bulk patch engine
pkg/bulk/engine.go
Update resolution
- Trivy report parser
pkg/report/trivy.go - OS package managers
pkg/pkgmgr/dpkg.go - Chisel release handling
pkg/chisel/release.go - Language package managers
pkg/langmgr/golang.go - Provenance rebuilding
pkg/provenance/rebuilder.go
Image construction
- BuildKit image builder
pkg/buildkit/buildkit.go
Additional capabilities
- Patch-layer generator
pkg/generate/generate.go - Helm chart patching
pkg/helm/patchedchart.go - VEX support
pkg/vex/openvex.go - Bulk configuration
pkg/bulk/config.go
Other components
- CLI user
- Image registry
- Local image runtime
Connections 24
- CLI user → Copa CLI: runs
main.go - Copa CLI → Patch command: registers
main.go - Patch command → Single-image patch: dispatches
pkg/cmd/cmd.go - Patch command → Bulk patch engine: dispatches
pkg/cmd/cmd.go - Patch command → Bulk configuration: reads
pkg/cmd/cmd.go - Patch command → Helm chart patching: configures
- CLI user → BuildKit frontend: invokes
- Single-image patch → Trivy report parser: parses
pkg/patch/single.go - Single-image patch → Patch core: delegates
pkg/patch/core.go - Patch core → OS package managers: selects updates
pkg/patch/core.go - Patch core → Chisel release handling: uses releases
pkg/patch/core.go - Patch core → Language package managers: delegates
pkg/patch/core.go - Language package managers → Provenance rebuilding: uses metadata
pkg/langmgr/golang.go - Single-image patch → BuildKit image builder: builds image
pkg/patch/single.go - Single-image patch → Local image runtime: loads image
pkg/patch/single.go - Single-image patch → Image registry: pushes image
- Bulk patch engine → Helm chart patching: resolves charts
pkg/bulk/engine.go - Bulk patch engine → Single-image patch: patches jobs
pkg/bulk/engine.go - BuildKit frontend → OS package managers: installs updates
pkg/frontend/build.go - BuildKit frontend → BuildKit image builder: solves build
- Patch-layer generator → Patch core: executes patch
pkg/generate/generate.go - Patch-layer generator → BuildKit image builder: exports layer
pkg/generate/generate.go - Single-image patch → VEX support: handles VEX
- CLI user → Patch-layer generator: requests layer