Instead of calling the default_docker_lib function a bunch of times
in the arg parser, we call it one and use the result in the parser.
Also, tighten up some exit conditions where self.d.close() is being
called when dockerd is not running.
Closes: #921
Approved by: rhatdan
In this way it is still possible to access $DESTDIR/rootfs as in the
case --rootfs is not specified.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #922
Approved by: yuqi-zhang
It optimizes the OSTree case where we prefer to use the same file
system of the repository for the checkout so that we can use hard links
instead of copying files.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #917
Approved by: baude
A user has asked for the return code from scans to reflect whether or not
all the scans were successful. This was reported in https://bugzilla.redhat.com/show_bug.cgi?id=1387288
So now, a return code of 0 implies all scans were sucessful and the operation
completed normally. A return code of 1 implies that not all scans were
successful OR the operation did not complete normally.
Closes: #919
Approved by: giuseppe
When Atomic unmount is called on an overlayfs based dockerd,
the default docker library is incorrectly determined resulting in
failures to unmount.
We now first ask the running dockerd what its root library directory
is and use that if dockerd is running.
This resolves https://bugzilla.redhat.com/show_bug.cgi?id=1381696
Closes: #912
Approved by: rhatdan
When running atomic scan <img> --json, docker command is printed on stdout,
which makes the JSON output invalid.
This change only prints the docker command when --verbose or --debug options
are used.
Closes: #909
Approved by: rhatdan
atomic storage reset requires that the dockerd be inactive. However,
calling the d.info() requires that docker be active. Adding the
NoDockerDaemon exception allows it to progress without the daemon.
This fixes https://github.com/projectatomic/atomic/issues/910
Closes: #913
Approved by: rhatdan
For potential cockpit use, we have enabled atomic push. It returns
a 0 if successful or throws a dbus Exception upon failure. Added
a series of integrations tests as well.
Closes: #907
Approved by: rhatdan
The following integration tests have been added:
* ScanList
* ImagePull
* ImageUpdate
* ImageUpate when at latest
* ImagePull when already at latest
* Run
* ContainersDelete
* ContainersDelete when container doesnt exist
Closes: #904
Approved by: rhatdan
The bug https://bugzilla.redhat.com/show_bug.cgi?id=1425495 demostrates
a case where atomic attempts to "add" a list and str resulting in a
TypeError exception. This should resolve that BZ.
Closes: #903
Approved by: rhatdan
The new 2.x version of the docker python API has non-backward
compatible changes. These changes are described here:
https://docker-py.readthedocs.io/en/stable/change-log.html#breaking-changes
We need to account for docker.Client and docker.APIClient as well
as changes in the way kwargs are handled. Also, it appears the
AutoVersion method is deprecated.
Closes: #894
Approved by: rhatdan
Define the methodology for testing dbus in integrations tests. Using a decorator,
this allows us to automatically define and test dbus tests. This is only the base
test to exercise the testing.
Closes: #901
Approved by: rhatdan
BZ #1422448 actually points out one regression and one
bug related to atomic stop. The BZ itself points out
a TypeError exception in the code when trying to glue
together a python list and str.
Then the atomic stop command was failling in the case where a
STOP label was defined and it uses the variable $NAME resulting
in a subprocess exception.
The self.name variable was not being set by set_args after
refactoring occured. Ideally, this should all be moved
into the image|container object handling but for now we
just handle it in set_args.
Also added a test in test_display to catch any future
regressions.
Closes: #899
Approved by: rhatdan
atomic install --system busybox@sha256:817a12.. installed a container
named busybox@sha256-817a12.. by default. Change it to skip the
'@sha256:' part and generate only "busybox".
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #890
Approved by: baude
After this fix, we can install a system container by the image sha256 ID:
atomic install --system busybox@sha256:817a12c32a39bbe394944ba49de563e085f1d3c5266eb8e9723256bc4448680e
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #890
Approved by: baude
Users like cockpit need to be able to submit scan jobs and not
tie up the dbus bus while waiting for results. They also want
to be able to check the status of active scans.
We now have an AsyncScan method that takes an image|container
id in string format as input. It will then thread the scan
and return. The scan can then be monitored through dbus
signals.
Results can be obtained using the GetScanResultsByID method.
There is also an ActiveScans method that allows you to check
the active scans. It returns a list of container|image ids
that are being scanned.
Closes: #885
Approved by: baude
At present, when overlayfs is used on RHEL and Centos to unlock
ostree, selinux and permissions get set with the wrong permissions.
This is a work-around for now.
Closes: #896
Approved by: jlebon
When calling atomic images info --storage ostree <some_image>, the
FQ Name of the image being returned was incorrect. We now call
Decompose to set the name correctly in the image object.
This was reported as a side issue in https://github.com/projectatomic/atomic/issues/870
Closes: #897
Approved by: rhatdan
atomic containers list -f FOO=BAR fails when FOO is not a known
filter. Make "atomic images list" work in the same way and raise an
error instead of silently ignoring it.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #889
Approved by: rhatdan