rdev/internal/port/registry_provider.go
jordan 4486042155
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
fix(registry): delete container images on project teardown
Root cause of DIGEST_INVALID errors was registry disk exhaustion.
Project teardown wasn't cleaning up container images, causing the
registry PVC to fill up over time.

Changes:
- Add RegistryProvider port interface for registry operations
- Extend zot.Client with DeleteProjectRepositories method
- Wire registry provider into ProjectInfraService
- Delete images during DeleteProject cleanup (step 4)

The zot client uses the OCI distribution API:
- Lists all repos, filters by project prefix
- Gets manifest digests via HEAD request
- Deletes manifests by digest to trigger GC

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 02:56:18 -07:00

29 lines
1.0 KiB
Go

// Package port defines interfaces (ports) for external dependencies.
package port
import (
"context"
"github.com/orchard9/rdev/internal/domain"
)
// RegistryProvider manages container registry operations.
type RegistryProvider interface {
// Check returns the health status of the registry.
Check(ctx context.Context) domain.RegistryStatus
// ListRepositories returns all repositories in the registry.
ListRepositories(ctx context.Context) ([]string, error)
// ListProjectRepositories returns all repositories for a specific project.
// This includes both the main repo and sub-repos like cache.
ListProjectRepositories(ctx context.Context, projectID string) ([]string, error)
// DeleteRepository deletes all tags and manifests for a repository.
DeleteRepository(ctx context.Context, repo string) error
// DeleteProjectRepositories deletes all repositories for a project.
// This should be called during project teardown to reclaim storage.
DeleteProjectRepositories(ctx context.Context, projectID string) error
}