Skip to content

client/oci: Allow OCI image names with a pinned hash#2460

Merged
stgraber merged 1 commit intolxc:mainfrom
neoaggelos:feat/pin-oci-image-hash
Sep 7, 2025
Merged

client/oci: Allow OCI image names with a pinned hash#2460
stgraber merged 1 commit intolxc:mainfrom
neoaggelos:feat/pin-oci-image-hash

Conversation

@neoaggelos
Copy link
Copy Markdown
Contributor

@neoaggelos neoaggelos commented Sep 6, 2025

Summary

Enables specifying OCI images as IMAGE:TAG@HASH

Changes

Previously, attempting to launch an OCI instance with:

$ incus launch docker:kindest/node:v1.33.0@sha256:91e9ed777db80279c22d1d1068c091b899b2078506e4a0f797fbf6e397c0b0b2 test
Error: Failed instance creation: Image not found

and incus logs printed

Sep 06 17:50:37 zs-builder incusd[671766]: time="2025-09-06T17:50:37Z" level=debug msg="Error getting image alias" name="kindest/node:v1.33.0@sha256:91e9ed777db80279c22d1d1068c091b899b2078506e4a0f797fbf6e397c0b0b2" stderr="Failed to run: skopeo inspect docker://kindest/node:v1.33.0@sha256:91e9ed777db80279c22d1d1068c091b899b2078506e4a0f797fbf6e397c0b0b2: exit status 1 (time=\"2025-09-06T17:50:37Z\" level=fatal msg=\"Error parsing image name \\\"docker://kindest/node:v1.33.0@sha256:91e9ed777db80279c22d1d1068c091b899b2078506e4a0f797fbf6e397c0b0b2\\\": Docker references with both a tag and digest are currently not supported\")" stdout=

Update incus client logic so that the tag is ignored if a pinned hash is specified, same as docker does in this situation

After this change, the instance is launched:

$ incus launch docker:kindest/node:v1.33.0@sha256:91e9ed777db80279c22d1d1068c091b899b2078506e4a0f797fbf6e397c0b0b2 test
Launching test

$ incus image show 91e9ed777db8
auto_update: true
properties:
  architecture: x86_64
  description: docker.io/kindest/node (OCI)
  id: kindest/node@sha256:91e9ed777db80279c22d1d1068c091b899b2078506e4a0f797fbf6e397c0b0b2
  type: oci
...

@neoaggelos neoaggelos requested a review from stgraber as a code owner September 6, 2025 18:02
Enables specifying OCI images as `IMAGE:TAG@HASH`

Signed-off-by: Angelos Kolaitis <[email protected]>
@neoaggelos neoaggelos force-pushed the feat/pin-oci-image-hash branch from 533954c to a0aad16 Compare September 7, 2025 09:08
@stgraber stgraber merged commit 9944ea6 into lxc:main Sep 7, 2025
36 checks passed
@neoaggelos neoaggelos deleted the feat/pin-oci-image-hash branch September 7, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants