Skip to content

Add ImageInsert tests#2603

Merged
vieux merged 4 commits intomoby:masterfrom
jadeallenx:tests/insert
Nov 12, 2013
Merged

Add ImageInsert tests#2603
vieux merged 4 commits intomoby:masterfrom
jadeallenx:tests/insert

Conversation

@jadeallenx
Copy link
Copy Markdown

Closes #1130
Incorporates #1942

Test that the insert command returns errors and reports success appropriately.

All tests pass.

@jadeallenx
Copy link
Copy Markdown
Author

Ping @creack

@creack
Copy link
Copy Markdown
Contributor

creack commented Nov 8, 2013

Thanks @mrallen1 and @dsissitka.
LGTM /cc @vieux

Comment thread server.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is a behaviour change. If some script was parsing inject's output.
It'll be broken

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, please to not truncate ID and return the full one.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@vieux Inject or insert? If insert, it is a behavior change because insert used to shit in your terminal:

$ docker insert 8dbd9 https://www.docker.io/static/img/docker-top-logo.png /foo

5765ac1d7336c1d805f04e745b7fdc9583bb23202a825c6e26c933b636a357cd
5765ac1d7336: 

$ 

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

insert, ok it's a change. But please return only long ID to be easily parseable.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps I'm overlooking something but it seems like that'd be inconsistent. See, for example, ImageImport. It uses ProgressReader and returns a short ID.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

there is an ongoing PR to return long ids everywhere

Return long image ID
Return streamformatted error or "raw" error
@jadeallenx
Copy link
Copy Markdown
Author

@vieux I just added a commit to reflect your review comments. (All tests still pass.)

Thanks.

Comment thread server.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm sorry, but could you just return the id + out.Write(sf.FormatStatus(img.ID, ""))

Thanks

@jadeallenx
Copy link
Copy Markdown
Author

OK, sure. :) ping @vieux

@vieux vieux merged commit 62f873a into moby:master Nov 12, 2013
@vieux
Copy link
Copy Markdown
Contributor

vieux commented Nov 12, 2013

LGTM, merged manually

cpuguy83 pushed a commit to cpuguy83/docker that referenced this pull request May 25, 2021
Fixed IPv6 portmapper iptables chain initialization
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.

docker insert fails quietly, should report failure

4 participants