Commit graph

25 commits

Author SHA1 Message Date
Doug Davis
d942c59b69 Wrap strings that could look like ints in quotes
When we use the engine/env object we can run into a situation where
a string is passed in as the value but later on when we json serialize
the name/value pairs, because the string is made up of just numbers
it appears as an integer and not a string - meaning no quotes.  This
can cause parsing issues for clients.

I tried to find all spots where we call env.Set() and the type of the
name being set might end up having a value that could look like an int
(like author). In those cases I switched it to use env.SetJson() instead
because that will wrap it in quotes.

One interesting thing to note about the testcase that I modified is that
the escaped quotes should have been there all along and we were incorrectly
letting it thru. If you look at the metadata stored for that resource you
can see the quotes were escaped and we lost them during the serialization
steps because of the env.Set() stuff.  The use of env is probably not the
best way to do all of this.

Closes: #9602

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-12-15 05:10:49 -08:00
Josh Hawn
059e589c34 Compute TarSum on storage of image layer content
Now, newly created/imported layers will have the checksum of
the layer diff computed and stored in the image json file.

For now, it is not an error if the computed checksum does not
match an existing checksum, only a warning message is logged. The
eventual goal is to use the checksums in the image JSON to verify
the integrity of the layer contents when doing `docker load` or
`docker pull`, and error out if it does not match.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2014-11-05 10:17:55 -08:00
Josh Hawn
26184de8ab Remove jsonData argument from image.StoreImage
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 <josh.hawn@docker.com> (github: jlhawn)
2014-11-03 17:39:21 -08:00
Alexandr Morozov
ee7dd44c01 Mass gofmt
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-24 15:11:48 -07:00
Alexandr Morozov
7c62cee51e Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-24 15:03:06 -07:00
Qiang Huang
ec000cbf30 graph: add VirtualSize for inspect output
Currently inspect output just shows Size info, and that usally be
very small and even 0 which is confusing.

Fixes #8016

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2014-09-23 08:42:32 +08:00
Alexandr Morozov
114838cbda
Some more style fixes
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-29 15:21:28 +04:00
Daehyeok.Mun
35df24c8e6 graph: change argument order of Register function
This commit is patch for following comment
FIXME: pass img as first argument

Signed-off-by: Daehyeok.Mun <daehyeok@gmail.com>
2014-08-28 20:06:07 +09:00
Josiah Kiehl
a02f67be5b Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
2014-08-13 15:18:15 -07:00
Solomon Hykes
6856a6b110 Move "pull" and "push" to graph/pull.go and graph/push.go
This is part of the ongoing effort to remove the deprecated server/
package, and generally cleanup and simplify the codebase.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-08 07:25:09 +00:00
Tibor Vass
af0781974d Check error returned by eng.Register() in TagStore.Install()
Signed-off-by: Tibor Vass <teabee89@gmail.com>
2014-08-06 17:19:01 -04:00
Solomon Hykes
d787937957 Move "image_tag" and "tag" to graph/tag.go
Note: these 2 jobs should be merged into one. This was noted in a FIXME.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:51 -04:00
Solomon Hykes
fa27580cff Move "import" to graph/import.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Solomon Hykes
f2029f7be1 Move "load" to graph/load.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Solomon Hykes
77781440f1 Move "viz" to graph/viz.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Solomon Hykes
51dd68d659 Move "images" to graph/list.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Solomon Hykes
55235e121e Move "image_history" to graph/history.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Solomon Hykes
6e28d11d1f Move "image_export" to graph/export.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Erik Hollensbe
4398108433 Move parsing functions to pkg/parsers and the specific kernel handling
functions to pkg/parsers/kernel, and parsing filters to
pkg/parsers/filter. Adjust imports and package references.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-07-29 13:09:10 -07:00
Victor Vieux
b3ee9ac74e update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-24 22:19:50 +00:00
Vincent Batts
d3bc787bca docker save: raw json
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-06-20 14:38:17 -04:00
Victor Vieux
3e4e8636c1 do not alter json in docker save
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-17 00:06:21 +00:00
Victor Vieux
68fb7f4b74 Standardize API keys: CamelCase
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-31 01:22:07 +00:00
Victor Vieux
603e00a3a7 move inspect from server to daemon
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-20 19:36:15 +00:00
Solomon Hykes
ff4ef50470 Start separating the image subsystem
This is a first step towards moving all code related to local
manipulation of images into a cleanly separated subsystem,
accessible via a stable set of commands in the engine API.

`graph.TagStore` now implements `engine.Installer`. For now, it
is installed by `Server.InitServer`, along with all other Server
commands. However this will change in future patches.

`graph.TagStore.Install` registers the following commands:

* `image_set` creates a new image and stores it locally.
* `image_get` returns information about an image stored locally.
* `image_tag` assigns a new name and tag to an existing image.

These commands are a pre-requisite for moving 'push' and 'pull'
out of `Server`.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-05-09 19:15:26 -07:00