feat: relocate epoch's registry packages + add shared OCI client#4
Merged
Conversation
Relocate epoch's leaf packages into cocoon-common so vk + operator can share them without depending on epoch: manifest (OCI media types + artifact classification) and ociutil (SHA-256, blob copy/verify, ref parsing). epoch keeps its own copies until it retires.
Relocate epoch's snapshot OCI<->tar bridge (Pusher/Stream/Uploader/Downloader) and cloud-image stream into cocoon-common, imports repointed to the common manifest/ociutil packages, so vk + operator convert artifacts without depending on epoch.
A go-containerregistry-backed Registry (Uploader/Downloader + HasManifest + DeleteManifest) that vk and the operator share to push/pull snapshots and cloud images and probe/roll back manifests against any OCI registry (e.g. Artifact Registry) with keychain auth. streamLayer pushes multi-GB blobs without buffering.
This was referenced Jul 1, 2026
Merged
Rename to the cocoon idiom: Uploader.BlobExists -> HasBlob (pairs with HasManifest) and CocoonRunner.ImageImport -> ImportImage (verb-noun), across interfaces, impls, callers, and fakes. Plus test fixes: t.Context() over context.Background(), hoist the cloudimg-test const/var above the type, and compare io.EOF with errors.Is.
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.
Makes cocoon-common the shared home for the OCI snapshot/cloud-image code so
vk and the operator can drop their dependency on the epoch module. Part of
the epoch-removal effort.
Packages
manifest,ociutil— leaf helpers relocated from epoch: OCI media types + artifact classification; SHA-256, blob copy/verify, ref parsing.cloudimg,snapshot— the bridge packages relocated from epoch: the snapshot OCI↔tarPusher/Stream/Uploader/Downloaderand the cloud-image stream. Internal imports repointed to the commonmanifest/ociutil.oci— NEW: ago-containerregistry-backedRegistry(Uploader+Downloader+HasManifest+DeleteManifest) with keychain auth, so snapshots/cloud images live in any standard OCI registry (e.g. Artifact Registry).streamLayerpushes multi-GB blobs without buffering.HasManifest(a cheapHEAD) serves the operator's hibernate/wake existence probe.Notes
*oci.OCIRegistryand epoch'sregistryclient.Clientsatisfyoci.Registrystructurally, so the epoch backend stays a drop-in during the transition.go get cocoon-common@<sha>.Quality
Each commit:
build/vet/test/lint(darwin + linux, 0 issues) green, plus a/code+/simplifypass with tightened comments. No trailers.