Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oci_append tries to write back to base_image which is weird and incorrect #19

Open
mattmoor opened this issue May 13, 2023 · 2 comments

Comments

@mattmoor
Copy link
Member

oci_append.site: Creating...
╷
│ Error: Unable to push image
│ 
│   with oci_append.site,
│   on service.tf line 14, in resource "oci_append" "site":
│   14: resource "oci_append" "site" {
│ 
│ Unable to push image, got error: PUT https://gcr.io/v2/mattmoor-chainguard/apko-hugo-cloudrun/manifests/sha256:d983e9ebe396bdbb1a035aed87fa4e30551188393349ad54cbaaab4c5aaf388c: DIGEST_INVALID: Manifest digest
│ "sha256:95bd4706afe03ac83a251988698f0b87edc1f8ac47276c3077a6849c5b5ee719" does not match expected digest "sha256:d983e9ebe396bdbb1a035aed87fa4e30551188393349ad54cbaaab4c5aaf388c".
@mattmoor
Copy link
Member Author

Ok, so the actual problem here is that oci_append attempts to write the resulting image back to base_image, and I was passing the base image by digest.

This is a sort of design flaw we should think through because it makes it impossible to append to a base image from a public source, but explains the error!

@mattmoor mattmoor changed the title oci_append appears to produce an invalid digest oci_append tries to write back to base_image which is weird and incorrect May 13, 2023
@imjasonh
Copy link
Member

crane append has similar semantics, but it has other options to make it not that way:

  • if base_image is not configured, we can simply append to scratch and produce an image that's just the given contents
  • if repo is configured, we push to that repo instead of pushing over base_image's
  • crane append will also tag, but we should keep that as a responsibility of oci_tag.

imjasonh pushed a commit that referenced this issue Apr 2, 2024
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

No branches or pull requests

2 participants