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

Implement crane edit #1403

Merged
merged 2 commits into from
Jul 13, 2022
Merged

Implement crane edit #1403

merged 2 commits into from
Jul 13, 2022

Conversation

jonjohnsonjr
Copy link
Collaborator

This works at least on linux with neovim. If stdin appears to be
interactive, crane edit will open an editor with the contents of the
target manifest/config/file. Otherwise, crane edit will read the desired
contents from stdin and just overwrite them for the target.

@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2022

Codecov Report

Merging #1403 (fac75fc) into main (4d7b65b) will decrease coverage by 0.75%.
The diff coverage is 52.84%.

@@            Coverage Diff             @@
##             main    #1403      +/-   ##
==========================================
- Coverage   74.15%   73.40%   -0.76%     
==========================================
  Files         114      115       +1     
  Lines        8455     8758     +303     
==========================================
+ Hits         6270     6429     +159     
- Misses       1579     1687     +108     
- Partials      606      642      +36     
Impacted Files Coverage Δ
internal/cmd/edit.go 52.84% <52.84%> (ø)
pkg/v1/remote/transport/useragent.go 41.17% <0.00%> (-8.83%) ⬇️
pkg/v1/remote/write.go 63.73% <0.00%> (+0.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d7b65b...fac75fc. Read the comment docs.

cmd/crane/cmd/edit.go Fixed Show fixed Hide fixed
cmd/crane/cmd/edit.go Fixed Show fixed Hide fixed
return nil, err
}
if _, ok := ref.(name.Digest); ok {
dst = fmt.Sprintf("%s@%s", ref.Context(), digest)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: ref.Context().Digest(digest) all over the place

This works at least on linux with neovim. If stdin appears to be
interactive, crane edit will open an editor with the contents of the
target manifest/config/file. Otherwise, crane edit will read the desired
contents from stdin and just overwrite them for the target.
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

3 participants