The previous algorithm for comparing files used python's
dircmp and is considered to be a shallow comparision. This
allowed distinctly small possibilities that two files being
compared could be different but not caught.
We now use go-mtree to do the comparison. This can emulate the
shallow comparison we had before but we can also adding a
sha256digest as part of the comparison using the new --keywords
option.
Also, made slight tweaks to gomtree functions in Atomic.util
so we debug and influence the return of JSON data.
This solves https://github.com/projectatomic/atomic/issues/761
Closes: #777
Approved by: rhatdan
This makes the default SPC_ARGS and RUN_ARGS a bit smarter. We only add
"-t" if we're attached to a terminal, otherwise Docker will fail to
start. We also add a --detach option to passthrough to `docker run`.
These options make atomic easier to use through D-Bus.
Closes: #776
Approved by: rhatdan
Make `atomic pull` work with "dockertar:/path" arguments for the docker
storage backend just as well as it does for ostree.
Closes: #776
Approved by: rhatdan
Fix the behaviour for atomic top where if you want to include
additional fields to monitor, you now specificy one field per
-o switch. For example:
atomic top -o ppid -o time
Closes: #780
Approved by: baude
If duplicate images exist in ostree and docker, mounting images
will fail during generate if storage is not specified.
Closes: #778
Approved by: rhatdan
Covers all but verify and generate. This is a refactoring of the
images subverbs (i.e. info, version, delete, ...)
Added in a unittest for list and info.
Closes: #771
Approved by: baude
Change --storage flag to not conflict with -f, and update some tests
to not error on some duplicate storage.
Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
Closes: #768
Approved by: giuseppe
Commit 9a0114c284 removed several
methods not used by Atomic CLI. Unfortunately, one of the methods
was being called by openscap. This is reported in bz# 1397839.
Reverted the removal of the method.
Closes: #769
Approved by: baude
Add --rollback flag to atomic update, which switches a system
container to the other deployment if one exists.
Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
Closes: #762
Approved by: rhatdan
If the has_image|has_container evals to True, then return
the proper object; else None
Add unittest structure for backends/backendutils.py
We want to make sure we have a good backend/backendutils
unittest. This should simplify unittests for all backends.
refactor.py: Remove the file used to help mini-test the
refactoring work. It is not needed by upstream and was
only including during the development phases.
Closes: #757
Approved by: baude
syscontainers: get_containers accept what containers to inspect
syscontainers: use image instead of self.args.image
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #757
Approved by: baude
Atomic/backendutils.py: Class for working with unknown backend
Atomic/objects/image|layer|container.py: classes for objects
Atomic/backends/backend|_docker|_ostree.py: Abstract backends for ostree and docker
Closes: #757
Approved by: baude
The unmount function for system containers was failing
for images that had regular files in its / directory
because shutil.rmtree was being used. The rmtree method
requires its input to a path of type dir. Added a simple
condition to check the input path and use os.remove(path)
on files.
Closes: #759
Approved by: rhatdan
With the -m switch, we can now compare the metadata between
the two diff objects. We report only the differences between them. All
common data is deleted from the object structures.
This solves --> https://github.com/projectatomic/atomic/issues/760
Closes: #764
Approved by: baude
Add functionality to detect environment variables in template files.
The variables that can be set by the user through --set is displayed
on 'atomic images info'. The variables with overridable default
values will either have their default value displayed, or shown as
{SET_BY_OS} if atomic sets them. Variables without default value
must be set by the user and is listed separately.
Currently install --system already checks for variables that have no
value after install, and will error out.
Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
Closes: #752
Approved by: giuseppe
Systemd currently blocks apps from executing systemctl commands
from inside of a container effecting the host system.
If you set the SYSTEMD_IGNORE_CHROOT=1 environment variable this
will turn off this behaviour, allowing a SPC to manage the hosts
systemd.
Closes: #755
Approved by: cgwalters
In code paths with Python 3, when dealing with remote registries,
we find that under certain conditions values are set as bytes which
need to be encoded/decoded to work properly with things like json
and ord().
Closes: #747
Approved by: rhatdan
When walking the layers of an image in atomic verify, we need to be sure
we use a fq image name when probing. In cases where the tagging includes
a non-fq image name, we were not. This resolves Bugzilla 1377952.
Closes: #744
Approved by: baude
When using the dbus interface to perform a scan, self.options
was being set to None. This tripped a condition with the
setting of args where it could not be iterated. We now ensure
self.options is not None prior to the iteration.
Closes: #743
Approved by: rhatdan
The previous change where we removed the tag from the write
file location impacted the signing because the tag was also
being omitted. This ensures the tag is omitted from the file
path but included in the call skopeo standalone-sign.
Closes: #741
Approved by: rhatdan
The manifests produced by Atomic were incorrect resulting in
an incorrect hash being used to sign. This also resulted in
the signature path being incorrect. Contributing to the failure
was the json serialization which is now not used.
Closes: #737
Approved by: rhatdan
Rename atomic_client to atomic_dbus_client, so it is easier to understand.
Cleanup a couple of errors causin dbus to break.
Closes: #732
Approved by: rhatdan
1. Decode gpg2 output as UTF-8.
2. Use startswith() and require ':' to be more strict.
3. Handle older gpg2 outputs in which the User-ID is part of the 'pub'
line.
Closes: #724
Approved by: rhatdan
older gobject-introspection versions convert these objects to an array
instead of a dictionary. Add a workaround for both versions of it.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #724
Approved by: rhatdan
When determining if a registry name is a registry name, you have to strip
the port or it will fail. For example:
```
python -c 'from Atomic.util import Decompose; print(Decompose("localhost:5000/somethingibuilt:latest").all)'
('', 'localhost:5000', 'somethingibuilt', 'latest', '')
```
Note how the localhost:5000 ends up in the repo "field". With this fix:
```
python -c 'from Atomic.util import Decompose; print(Decompose("localhost:5000/somethingibuilt:latest").all)'
('localhost:5000', '', 'somethingibuilt', 'latest', '')
```
Now ends up in the registry field.
Closes: #729
Approved by: baude