Commit Graph

12 Commits

Author SHA1 Message Date
Kir Kolyshkin fa414d963d Format sources with gofumpt
gofumpt is a superset of gofmt, enabling some more code formatting
rules.

This commit is brought to you by

	gofumpt -w .

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2023-05-26 16:17:31 -07:00
Nalin Dahyabhai 4d61c789f3 test helper: maxArgs = 0 is actually a meaningful value
We do have commands that don't take any arguments, and quietly ignoring
arguments when they get them is not a good idea.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-01-27 09:21:43 -05:00
Miloslav Trmač 67e2c873d4 Add more error handling to cmd/containers-storage
Introduce an outputJSON helper to decrease repetition.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-14 17:17:54 +02:00
Miloslav Trmač 7c002b2a2a Consolidate error reporting in cmd/containers-storage
Have the action handlers return an error value, and let
main() format that error, if any; this avoids duplicated
error formating code in the action handlers, dropping
89 lines.

This might change the error format in some cases (typically
%v vs. %+v).

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-14 17:17:53 +02:00
Miloslav Trmač e52f3a3174 Add missing error handling
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-09-12 16:31:41 +02:00
Giuseppe Scrivano 6513bb3530 containers-storage: support layer bigdata
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-02-02 11:39:03 +01:00
Nalin Dahyabhai f502182d8d Add tests for the ReadOnly field
Check that layers and images in read-only stores are correctly marked as
such.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-05-21 11:54:50 -04:00
Nalin Dahyabhai 6275d3a46a CLI helper: print backtraces with errors
Print backtrace information when displaying an error returned by our
API, to make troubleshooting tests a bit easier.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-02-26 14:19:15 -05:00
Nalin Dahyabhai 198923f615 Add mapped top layers to images
Allow images to have multiple top layers which should only differ by
which UID/GID mappings are used in them, to make creating multiple
containres which use the same mappings faster.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-05-30 13:46:08 -04:00
Nalin Dahyabhai afc53ace61 CLI: fix JSON output for layer/container-parent-owners
Provide the information that was actually requested when we produce JSON
output for the layer-parent-owners and container-parent-owners commands.
Carried over from #156.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-04-10 14:39:47 -04:00
Nalin Dahyabhai 33d36cbee8 Add LayerParentOwners()/ContainerParentOwners()
Add store methods for finding the list of UIDs and GIDs which probably
need to be mapped if a given layer or container's layer, which has to
have been mounted at least once in order for us to know where it goes,
is going to be used for a container that is run with the configured ID
mappings in a separate user namespace.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-04-03 10:34:32 -04:00
Nalin Dahyabhai 3d990cefd5 Add a CLI "layer" command
Add a "layer" command, for examining layer records.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-09-29 15:06:59 -04:00