Skip to content

fix(images): Accept http(s)+oci image references - #437

Merged
jedevc merged 2 commits into
prod-stagingfrom
craciunoiuc/support-http-oci
Oct 1, 2026
Merged

jedevc merged 2 commits into
prod-stagingfrom
craciunoiuc/support-http-oci

Conversation

@craciunoiuc

@craciunoiuc craciunoiuc commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Accepts http+oci:// / https+oci:// image references, so an OCI layout served over HTTP works wherever a registry reference does. The node is what fetches it, so the CLI carries the URI through verbatim.

The reference grammar and normalization move to unikraft.com/x/image-spec/reference, replacing the CLI's internal/x/reference fork.

Depends on unikraft-cloud/x#508 (merged).

GitHub-Fixes: TOOL-1093

@craciunoiuc
craciunoiuc requested review from jedevc and a balanced review from Copilot August 4, 2026 13:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds parsing and round-tripping support for http+oci and https+oci instance image references.

Changes:

  • Introduces scheme-aware image parsing and wire serialization.
  • Updates instance creation/editing and image listing behavior.
  • Adds unit, integration, and help-output coverage.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/types/image.go Preserves URI-based image references.
internal/types/image_test.go Tests image reference behavior.
internal/images/images.go Adds scheme-aware parsing.
internal/images/images_test.go Tests supported formats and errors.
internal/cmd/instances.go Sends URI references to the API.
internal/cmd/images.go Loads URI-backed platform images.
cmd/unikraft/testdata/TestHelp/instances Updates generated help expectations.
cmd/unikraft/integration/instance_http_oci_test.go Adds end-to-end coverage.

Comment thread internal/images/images.go Outdated
Comment thread internal/cmd/images.go Outdated
Comment thread internal/cmd/instances.go Outdated
@craciunoiuc
craciunoiuc force-pushed the craciunoiuc/support-http-oci branch from 7fa36ff to cdca2ea Compare August 4, 2026 16:01
Comment thread cmd/unikraft/integration/instance_http_oci_test.go Outdated
Comment thread internal/types/image.go Outdated
Comment thread internal/types/image.go Outdated
Comment thread internal/images/images.go Outdated
@craciunoiuc

Copy link
Copy Markdown
Contributor Author

All comments legitimate, will address

@craciunoiuc craciunoiuc reopened this Aug 19, 2026
@craciunoiuc
craciunoiuc force-pushed the craciunoiuc/support-http-oci branch 2 times, most recently from 7673dc5 to 4efad6e Compare August 20, 2026 13:04
@craciunoiuc

Copy link
Copy Markdown
Contributor Author

addressed

@jedevc
jedevc force-pushed the craciunoiuc/support-http-oci branch from 4efad6e to b52016f Compare September 30, 2026 10:17
Comment thread internal/cmd/images.go
@jedevc
jedevc force-pushed the craciunoiuc/support-http-oci branch 4 times, most recently from ee6a529 to 26cb700 Compare September 30, 2026 14:02
Comment thread cmd/unikraft/testdata/TestHelp/instances Outdated
@jedevc
jedevc force-pushed the craciunoiuc/support-http-oci branch 6 times, most recently from 38a4dde to c3ed1a0 Compare October 1, 2026 09:30
craciunoiuc and others added 2 commits October 1, 2026 10:40
An http(s)+oci image is fetched by the platform, so the CLI only
carries the URI through, verbatim.

Parsing moves to image-spec's reference package, and the image
listings build on its Reference rather than distribution's types.

GitHub-Fixes: TOOL-1093

Signed-off-by: Cezar Craciunoiu <cezar@unikraft.io>
Signed-off-by: Justin Chadwell <justin@unikraft.com>
A minimal file server serves a layout out of an imported volume, and
the instance has to boot from its http+oci URI and print its output.

The layout is repacked before it is served: the node's unpacker wants
index.json to list the manifest directly and every directory in the
tarball before its contents, which the CLI's layouts don't give it.

Signed-off-by: Justin Chadwell <justin@unikraft.com>
@jedevc
jedevc force-pushed the craciunoiuc/support-http-oci branch from c3ed1a0 to 8562251 Compare October 1, 2026 09:40
@jedevc
jedevc marked this pull request as ready for review October 1, 2026 09:42

@jedevc jedevc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-by: Justin Chadwell <justin@unikraft.com>
Approved-by: Justin Chadwell <justin@unikraft.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread internal/cmd/images.go
Comment on lines +617 to 624
if parsedRef.Scheme().IsHTTP() {
// A layout served over HTTP is addressed by its URI alone.
return []ImageEntry{{
platformImage: &image,
Digest: baseDigest,
Ref: types.NewImageRef(parsedRef),
}}, nil
}

@jedevc jedevc Oct 1, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there's no namespaces for this. Expected.

Comment thread internal/cmd/images.go
@jedevc
jedevc merged commit 69d54ae into prod-staging Oct 1, 2026
14 checks passed
@jedevc
jedevc deleted the craciunoiuc/support-http-oci branch October 1, 2026 10:00
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.

3 participants