Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove jsonData argument from image.StoreImage#8799

Merged
tiborvass merged 1 commit into
moby:masterfrom
jlhawn:remove_jsondata_arg
Nov 4, 2014
Merged

Remove jsonData argument from image.StoreImage#8799
tiborvass merged 1 commit into
moby:masterfrom
jlhawn:remove_jsondata_arg

Conversation

@jlhawn

@jlhawn jlhawn commented Oct 27, 2014

Copy link
Copy Markdown

The argument specified the json data to save to disk when registering
a new image into the image graph. If it is nil, then the given image
is serialized to json and that is written by default. This default
behavior is sufficient if the given image was originally deserialzed
from this jsonData to begin with which has always been the case.

Signed-off-by: Josh Hawn [email protected] (github: jlhawn)

@jlhawn

jlhawn commented Oct 27, 2014

Copy link
Copy Markdown
Author

hey @crosbymichael, @tiborvass, @vieux, @jfrazelle, et al, please review :D

@jlhawn

jlhawn commented Oct 27, 2014

Copy link
Copy Markdown
Author

ping @unclejack

@unclejack

Copy link
Copy Markdown
Contributor

I was running the tests.

LGTM

@jlhawn

jlhawn commented Oct 27, 2014

Copy link
Copy Markdown
Author

oh! I didn't realize you were looking at this already. Thank you 👍

@jessfraz

Copy link
Copy Markdown
Contributor

You have ESP, LGTM

@jlhawn

jlhawn commented Oct 28, 2014

Copy link
Copy Markdown
Author

ping @tiborvass @vieux @crosbymichael

@vieux

vieux commented Oct 31, 2014

Copy link
Copy Markdown
Contributor

LGTM

@jlhawn

jlhawn commented Nov 4, 2014

Copy link
Copy Markdown
Author

ping @tiborvass @crosbymichael I think we need one more LGTM from a maintainer to put this over the edge. 👍 ?

Comment thread image/image.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.

@jlhawn It'd be a little more efficient to use f, err := os.Create(jsonPath(root)) and then use a json.NewEncoder to write to f.

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.

@jlhawn If you think this is out of scope, I understand, so just let me know :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sure. I've been doing that with other/new things I've been writing anyway. Must avoid unnecessary allocations >_>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

OK, @tiborvass I've updated the PR. Might want to wait for Drone.io to come back green. jlhawn@8e9627a#diff-da07f373046a0a24e67b18699dc15a70R93

@jlhawn jlhawn force-pushed the remove_jsondata_arg branch from e540d43 to 8e9627a Compare November 4, 2014 01:33
Comment thread image/image.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.

@jlhawn why not return encoder.Encode(img) ? :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

sorry, didn't look that far ahead actually. Updated with return json.NewEncoder(f).Encode(img) because why not...

@jlhawn jlhawn force-pushed the remove_jsondata_arg branch from 8e9627a to e1bd487 Compare November 4, 2014 01:38
The argument specified the json data to save to disk when registering
a new image into the image graph. If it is nil, then the given image
is serialized to json and that is written by default. This default
behavior is sufficient if the given image was originally deserialzed
from this jsonData to begin with which has always been the case.

Signed-off-by: Josh Hawn <[email protected]> (github: jlhawn)
@jlhawn jlhawn force-pushed the remove_jsondata_arg branch from e1bd487 to 26184de Compare November 4, 2014 01:39
@tiborvass

Copy link
Copy Markdown
Contributor

LGTM (but will wait for drone)

tiborvass added a commit that referenced this pull request Nov 4, 2014
Remove `jsonData` argument from `image.StoreImage`
@tiborvass tiborvass merged commit 5b03a21 into moby:master Nov 4, 2014
@jlhawn jlhawn deleted the remove_jsondata_arg branch November 4, 2014 18:34
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.

5 participants