-
Notifications
You must be signed in to change notification settings - Fork 949
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
bugfix: pull non-exist image in container create #1764
bugfix: pull non-exist image in container create #1764
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1764 +/- ##
==========================================
+ Coverage 56.3% 56.33% +0.02%
==========================================
Files 200 200
Lines 15657 15659 +2
==========================================
+ Hits 8816 8821 +5
+ Misses 5745 5744 -1
+ Partials 1096 1094 -2
|
Please add an integration test in the CI, so that this case could be covered forever. Thanks a lot. |
@@ -60,6 +60,10 @@ func (cc *CreateCommand) runCreate(args []string) error { | |||
|
|||
ctx := context.Background() | |||
apiClient := cc.cli.Client() | |||
if err := pullMissingImage(ctx, apiClient, config.Image, false); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The best will be done in api server, hope someone can do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allencloud @Ace-Tang I don't think it should be done in the API server, because we don't know the client want to pull the missing image and it will make the API heavy. Currently, the Pull
API allows the caller to do the customize like pullMissingImage
. It's good enough, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you said, @fuweid , one api just do one thing, seems make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code change look goods. But please add integration testing for this functionality 😄
Signed-off-by: Ace-Tang <[email protected]>
There was a problem hiding this 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: Ace-Tang [email protected]
Ⅰ. Describe what this PR did
Pull image if not exist in container create process.
Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews