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

Allow setting Content-Type in crane edit manifest #1551

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

jonjohnsonjr
Copy link
Collaborator

This uses the --media-type flag.

This uses the --media-type flag.
@tianon
Copy link
Contributor

tianon commented Feb 1, 2023

Can this new flag default to the mediaType in my edited document? 🥺

(I want to be able to convert docs from Docker media types to OCI media types 🙇)

Edit: Jon is faster than I am! 😂

@codecov-commenter
Copy link

codecov-commenter commented Feb 1, 2023

Codecov Report

Merging #1551 (4d05fe1) into main (da1008f) will decrease coverage by 0.34%.
The diff coverage is 56.54%.

@@            Coverage Diff             @@
##             main    #1551      +/-   ##
==========================================
- Coverage   73.07%   72.74%   -0.34%     
==========================================
  Files         117      118       +1     
  Lines        9082     9241     +159     
==========================================
+ Hits         6637     6722      +85     
- Misses       1780     1833      +53     
- Partials      665      686      +21     
Impacted Files Coverage Δ
pkg/v1/manifest.go 100.00% <ø> (ø)
pkg/v1/remote/delete.go 58.62% <ø> (ø)
pkg/v1/mutate/mutate.go 69.01% <10.52%> (-3.80%) ⬇️
pkg/v1/remote/referrers.go 40.00% <40.00%> (ø)
pkg/v1/remote/write.go 62.69% <55.95%> (-1.42%) ⬇️
pkg/v1/remote/descriptor.go 73.84% <61.53%> (-0.44%) ⬇️
internal/cmd/edit.go 54.12% <85.00%> (+0.64%) ⬆️
pkg/v1/mutate/image.go 69.56% <100.00%> (+0.33%) ⬆️
pkg/v1/mutate/index.go 79.33% <100.00%> (+0.34%) ⬆️
pkg/v1/remote/options.go 77.77% <100.00%> (+1.41%) ⬆️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tianon
Copy link
Contributor

tianon commented Feb 1, 2023

I suppose I should report back that I successfully tested this PR for converting an image from Docker media types to OCI media types and all went well. 😄

@imjasonh
Copy link
Collaborator

imjasonh commented Feb 3, 2023

I suppose I should report back that I successfully tested this PR for converting an image from Docker media types to OCI media types and all went well. 😄

Would a command just to OCIfy a docker image be helpful? That's something we've found a need for in the past and then punted on.

@tianon
Copy link
Contributor

tianon commented Feb 3, 2023

Hmmm, as a flag to crane cp maybe? I don't think I'd personally use it, though, since it's just as easy to munge the 2-3 media types myself and I don't actually do this kind of munging very often (and hopefully even less over time!)

I ran into this while testing something else the first time, and it was only the second time that I was trying to OCI-ify an existing image that I decided to really bug Jon about it in earnest since it seemed like an easy win for the overall ergonomics of crane edit matching my expectations of how it was about to work. 😂

@tianon
Copy link
Contributor

tianon commented Feb 3, 2023

Mostly just to make Jon cringe, I'd be happy to write a jq one-liner for the docs so you can suggest users do crane manifest ... | jq '...' | crane edit manifest ... if that's helpful 😄

Edit: I need to stop trying to have coherent thoughts in the evenings and the mornings apparently - that trivial version wouldn't work recursively, which limits the usefulness a bit (and jq is probably overkill; sed would do the trick pretty reasonably) 🤔

@jonjohnsonjr
Copy link
Collaborator Author

Would a command just to OCIfy a docker image be helpful? That's something we've found a need for in the past and then punted on.

I'm 99% sure there's a PR to do this somewhere.

@jonjohnsonjr jonjohnsonjr merged commit de35f0f into google:main Feb 3, 2023
@jonjohnsonjr jonjohnsonjr deleted the crane-edit-mt branch February 3, 2023 18:36
@tianon
Copy link
Contributor

tianon commented Feb 4, 2023

Would a command just to OCIfy a docker image be helpful? That's something we've found a need for in the past and then punted on.

I'm 99% sure there's a PR to do this somewhere.

Looks like that's #1293 (also relevant is #1245)

bdegeeter added a commit to bdegeeter/porter that referenced this pull request May 16, 2023
…ifest change (google/go-containerregistry#1551)

Signed-off-by: Brian DeGeeter <brian@degeeter.net>
bdegeeter added a commit to bdegeeter/porter that referenced this pull request Jun 8, 2023
…ifest change (google/go-containerregistry#1551)

Signed-off-by: Brian DeGeeter <brian@degeeter.net>
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.

None yet

4 participants