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

fix: oras push should return error when artifacttype is empty for spec 1.1 #1317

Merged
merged 3 commits into from
Apr 8, 2024

Conversation

wangxiaoxuan273
Copy link
Contributor

@wangxiaoxuan273 wangxiaoxuan273 commented Mar 29, 2024

What this PR does / why we need it:
oras push should return an error when --config is used, --artifact-type is not used and --image-spec is set to v1.1.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1313

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

Copy link

codecov bot commented Apr 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.10%. Comparing base (122f01b) to head (15e944c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1317      +/-   ##
==========================================
+ Coverage   84.06%   84.10%   +0.04%     
==========================================
  Files          90       90              
  Lines        3458     3467       +9     
==========================================
+ Hits         2907     2916       +9     
  Misses        329      329              
  Partials      222      222              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wangxiaoxuan273 wangxiaoxuan273 marked this pull request as ready for review April 2, 2024 06:04
@wangxiaoxuan273
Copy link
Contributor Author

wangxiaoxuan273 commented Apr 2, 2024

There are 3 issues to discuss:

  1. Do we allow users to input --image-spec auto? (currently yes)
  2. What should be the output of oras push -h for --image-spec? (current display below)
Screenshot 2024-04-02 at 15 08 57
  1. We need to document the behavior of auto. (default to v1.1, unless --config is used and --artifact-type is not given)

cmd/oras/root/push.go Outdated Show resolved Hide resolved
cmd/oras/internal/option/spec.go Outdated Show resolved Hide resolved
cmd/oras/root/push.go Outdated Show resolved Hide resolved
cmd/oras/root/push.go Outdated Show resolved Hide resolved
cmd/oras/root/push.go Outdated Show resolved Hide resolved
Signed-off-by: Xiaoxuan Wang <[email protected]>
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM with suggestions

cmd/oras/root/push.go Outdated Show resolved Hide resolved
Copy link
Contributor

@qweeah qweeah left a comment

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: Xiaoxuan Wang <[email protected]>
@qweeah qweeah merged commit 2ef6dc0 into oras-project:main Apr 8, 2024
8 checks passed
@wangxiaoxuan273 wangxiaoxuan273 deleted the spec branch April 9, 2024 08:21
FeynmanZhou pushed a commit to FeynmanZhou/oras that referenced this pull request May 11, 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

Successfully merging this pull request may close these issues.

avoid pushing artifacts without artifactType if --image-spec v1.1 is specified
3 participants