1
0
mirror of https://github.com/projectatomic/atomic.git synced 2026-02-05 18:45:01 +01:00

690 Commits

Author SHA1 Message Date
Dan Walsh
b5a5ff1a75 Bump the version 1.10.3 v1.10.3 2016-06-01 09:14:23 -04:00
Giuseppe Scrivano
75fc43b769 tests: add tests for system containers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #401
Approved by: rhatdan
2016-06-01 13:01:22 +00:00
Giuseppe Scrivano
cd150a8384 atomic: do not overwrite values that get from the info file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #401
Approved by: rhatdan
2016-06-01 13:01:22 +00:00
Giuseppe Scrivano
a217e2882d atomic: _checkout_system_container doesn't return any value
returning True was translated to an error and the process would not
exit with 0.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #401
Approved by: rhatdan
2016-06-01 13:01:22 +00:00
Giuseppe Scrivano
2ca4d1a8c5 atomic: automatically create the OSTree repo if not present
Closes: https://github.com/projectatomic/atomic/issues/397

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #401
Approved by: rhatdan
2016-06-01 13:01:22 +00:00
Giuseppe Scrivano
25d1c8b0ce atomic: allow to specify the checkout path with an env variable
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #401
Approved by: rhatdan
2016-06-01 13:01:22 +00:00
Giuseppe Scrivano
cb52def38e atomic: use a function to generate a system container default name
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #401
Approved by: rhatdan
2016-06-01 13:01:22 +00:00
Colin Walters
02fe5ce47a atomic: More completely handle failure to import OSTree
GI raises `ValueError` apparently, not `ImportError`.  So rework
things to be nested and handle the cases of:

 - No GI
 - GI but no OSTree
 - OSTree

Closes: #400
Approved by: giuseppe
2016-05-31 22:13:07 +00:00
Dan Walsh
836e8b27b9 Bump version. v1.10.2 2016-05-31 16:10:09 -04:00
Giuseppe Scrivano
39245230c5 atomic: hide system containers options if OSTree is not present
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #398
Approved by: rhatdan
2016-05-31 19:56:32 +00:00
Giuseppe Scrivano
fea2eb5caf atomic: fix update description
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #398
Approved by: rhatdan
2016-05-31 19:56:31 +00:00
Giuseppe Scrivano
d282560179 tests: better align output
Use truncated printf output instead of aligning with tabs.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #392
Approved by: jlebon
2016-05-31 19:15:57 +00:00
Giuseppe Scrivano
21a1a1d98b tests: do not run destructive tests by default
I don't feel comfortable with running test_storage.sh on my
development machine, so enable it only with ENABLE_DESTRUCTIVE=1.

Tests are marked to be destructive with an inline tag ":destructive-test".

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #392
Approved by: jlebon
2016-05-31 19:15:57 +00:00
Brent Baude
d8b2d19d76 Indicate used in atomic images
When you run atomic images, we now indicate which images
have been used by a container. The indicator is the
'>' character and it preceeds the image name in the listing.
Also improved some output problems with long repository names.

Updated atomic images man page to reflect this change.

Closes: #394
Approved by: rhatdan
2016-05-31 18:06:53 +00:00
Dan Walsh
ee5d95e799 Bump to 1.10.1
Include a couple of bug fixes for 1.10 release, as well as
atomic images --noheading
v1.10.1
2016-05-31 08:46:02 -04:00
Giuseppe Scrivano
0546da2408 atomic: remove any symlink from the destination path
Convert /ostree -> /sysroot/ostree as runc doesn't like symlinks in
the path to the bundle

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #396
Approved by: rhatdan
2016-05-31 11:46:59 +00:00
William Temple
95e59f643b fix errors in mount.py
Closes: #393
Approved by: rhatdan
2016-05-31 11:30:10 +00:00
Daniel J Walsh
a3bb3f0ad3 Merge pull request #395 from rhatdan/noheading
Add atomic images --noheading
2016-05-30 05:54:42 -04:00
Dan Walsh
f027f871ea Add atomic images --noheading
In certain cases like piping to grep, you do not want to include headings
2016-05-29 06:12:34 -04:00
Dan Walsh
1d6aecf1db Bump to atomic-1.10 v1.10 2016-05-25 12:17:14 -04:00
Brent Baude
5190152d88 Change rules around declaring a default scanner.
Previously, with the understanding we would be shipping a single
generic scanner configuration file, would 1) install the config
file and we had preset a default scanner in atomic.conf.

With the realization that the scanner could be variable based
on the distribution, the generic file is not longer installed
by default. Therefore, we should probably not set a default.

The prior code failed if a default was not defined in
/etc/atomic.conf.  That code check has been altered and we now
adhere to the following rules:

* If no default is defined AND there is only one configured
 scanner, we assume the single scanner IS the default.

* If no default is defined AND there are multiple scanners, we
 error out and ask the user to define one.

* If there is a default defined, good to go!

Closes: #383
Approved by: rhatdan
2016-05-25 14:31:56 +00:00
Giuseppe Scrivano
1eed8e989b atomic: allow the absence of the system checkout path
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #391
Approved by: baude
2016-05-24 19:39:09 +00:00
Giuseppe Scrivano
fee64cc30f tests: write correctly to /etc/sysconfig/docker-storage-setup
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #390
Approved by: baude
2016-05-24 17:56:24 +00:00
Giuseppe Scrivano
09c4f6f9de mount: initialize correctly 'removexattr'
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #390
Approved by: baude
2016-05-24 17:56:24 +00:00
Giuseppe Scrivano
468a0b244c mount: delete correctly symlinks
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #390
Approved by: baude
2016-05-24 17:56:24 +00:00
Giuseppe Scrivano
df7a903971 atomic: fix typo
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #390
Approved by: baude
2016-05-24 17:56:24 +00:00
Giuseppe Scrivano
1408662687 atomic: refactor system images list
Change it to work more similarly to Docker images, so that the same
code paths can be used to print the list.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #390
Approved by: baude
2016-05-24 17:56:24 +00:00
Giuseppe Scrivano
d828a94290 atomic: add ExecStop to default systemd unit file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #390
Approved by: baude
2016-05-24 17:56:24 +00:00
Giuseppe Scrivano
bb06b2dc45 atomic: support the case there is no OSTree repository
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #390
Approved by: baude
2016-05-24 17:56:24 +00:00
Giuseppe Scrivano
167ac9e748 atomic: read default values from manifest file
Introduce a new "manifest.json" file where it is possible to store
more information related to the system container.

A first need of this file is to store default values when
--set=NAME=VALUE is not provided.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #389
Approved by: rhatdan
2016-05-23 20:28:40 +00:00
Dan Walsh
403b51a5ca Add support for modifying /etc/sysconfig/docker-storage-setup
atomic modify can be used to add devices to the storage backend.
It can also be used to switch the backend storage driver.

Closes: #385
Approved by: rhatdan
2016-05-23 15:32:20 +00:00
Marius Vollmer
009c1d9700 util: Add bourne shell utilities
Closes: #385
Approved by: rhatdan
2016-05-23 15:32:20 +00:00
Giuseppe Scrivano
287bc7d414 tests: Change the OSTree repo mode to bare-user
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #388
Approved by: cgwalters
2016-05-23 11:45:00 +00:00
Giuseppe Scrivano
bf61f296a3 tests: do not use the system OSTree repository
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #377
Approved by: jlebon
2016-05-20 20:03:19 +00:00
Giuseppe Scrivano
cb15563d07 scan: do not leave mounted paths
Cleanup mounted paths on errors

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #377
Approved by: jlebon
2016-05-20 20:03:19 +00:00
Giuseppe Scrivano
c774c23a3e scan: add support for system containers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #377
Approved by: jlebon
2016-05-20 20:03:19 +00:00
Giuseppe Scrivano
ce30c0c188 mount: add support for system containers
Use an xattr to store what drivers is used to manage the mountpoint.
This is important because OSTree containers are simply bind mount to
the rootfs of the container already checked out on the file system,
while images are checked out and must be "rm -rf" when unmounted.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #377
Approved by: jlebon
2016-05-20 20:03:19 +00:00
Dan Walsh
40c9535ad6 Exit with proper exit code
Closes: #387
Approved by: rhatdan
2016-05-17 19:55:08 +00:00
Giuseppe Scrivano
f0d2de591a atomic: make ostree default storage
If not storage is specified, ostree is assumed.

Also fix an error message.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #384
Approved by: rhatdan
2016-05-16 13:46:04 +00:00
Dan Walsh
561c1866d6 Test that the atomic command is handling params properly
Want to make sure that we do not regress the handling of test params.

Closes: #358
Approved by: rhatdan
2016-05-12 19:51:20 +00:00
Brent Baude
22c40f50e7 Improve errors msgs for no configured scanners
Eventually we will not ship any default scanner configurations.  Previous
code relied on there always being one (default) defined so improved
error messages and a conditional check was in order.

Closes: #380
Approved by: rhatdan
2016-05-12 14:44:44 +00:00
Brent Baude
04ad0af66e Atomic/atomic.py: Deal with non-ascii input
https://bugzilla.redhat.com/show_bug.cgi?id=1323165#c2 suggests
that atomic install does not deal with non-ascii input very
well.  I believe this addresses the concerns with the proper
UTF-8 encode and decode operations.

Closes: #374
Approved by: rhatdan
2016-05-11 21:27:30 +00:00
Brent Baude
35c18bc67d Atomic/diff: Improve docs and output messages for diff
https://github.com/projectatomic/atomic/issues/378 points out that
when an rpm diff is done with --names-only, the output messaging was
not clear enough.  Reworked the man page, --help, and output message
to clarify that when --names-only is used, it only compares RPMs
based on names and NOT versions.

Nice find by Micah.

Closes: #381
Approved by: rhatdan
2016-05-11 18:52:44 +00:00
Dan Walsh
013f6b0f61 Extend Try block by adding create_parser() function
Currently we do not catch all exceptions, since we setup the Atomic
class before the try block.  This patch moves all of the parser
creation into its own function.  And wraps all calls in a try block.

Closes: #376
Approved by: rhatdan
2016-05-11 18:17:44 +00:00
Dan Walsh
640ad1bf41 Added atomic storage to handle resetting of storage
Also moved atomic migrate to atomic storage.

Currently we support
atomic storage export
atomic storage import
atomic storage reset

Closes: #365
Approved by: rhatdan
2016-05-11 10:51:14 +00:00
Giuseppe Scrivano
a83b35b5b4 util: remove stdout argument for check_output
subprocess.check_output has not stdout argument.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #375
Approved by: rhatdan
2016-05-09 12:35:39 +00:00
Giuseppe Scrivano
51e6a4c545 atomic: Ensure the stored manifest is a string
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #375
Approved by: rhatdan
2016-05-09 12:35:39 +00:00
Dan Walsh
1641d081ab SELinux: Don't scan with selinux separation if scan is using rootfs
We don't have a way to relabel content off of random rootfs so that
a SELinux confined process can read the content.

Closes: #372
Approved by: rhatdan
2016-05-06 15:21:59 +00:00
Brent Baude
e67bf52a2a Atomic/scan.py: Add --rootfs option
Add the ability for atomic scan to deal with chroots on the host's
filesystem.  You can now pass a list of chroots to --rootfs and your
scanner will process them as if they were containers or images.  This
works with VMs too.

$ sudo virt-filesystems -d rhel7
/dev/sda1
/dev/sdb1
/dev/sdb2
/dev/rhel/home
/dev/rhel/root
$ sudo guestmount  -d rhel7 -m /dev/rhel/root --ro /tmp/rhel
$ sudo ./atomic scan --rootfs /tmp/rhel
...

Updated the man pages for atomic scan as well as it had fallen out of
date.

Small update that makes sure the host's os.environ is passed into
scanning container.

Closes: #371
Approved by: rhatdan
2016-05-05 15:45:46 +00:00
Dan Walsh
a8f0e7dca7 Use close_fds=True for all subprocess invocations
The Python default is to keep all FDs open, which is how Unix
traditionally worked. This default behavior is particularly
problematic for the atomic command, which e.g. may
hold a reference to the Docker socket, and we don't
necessarily want to give that reference to all
child processes.

This patch changes most calls to subprocess to be through
util package.  And the util subprocess calls all close_fds=True.

Closes: #370
Approved by: cgwalters
2016-05-03 17:54:31 +00:00