1
0
mirror of https://github.com/projectatomic/atomic.git synced 2026-02-07 06:44:52 +01:00
Commit Graph

19 Commits

Author SHA1 Message Date
Brent Baude
b229aa589b Atomic/delete.py: Use available backends proporty
The prune method should run without dockerd.  We now switched
to using the available_backends property instead of the
backends property.

This fixes https://github.com/projectatomic/atomic/issues/869.

Closes: #871
Approved by: baude
2017-02-08 15:48:29 +00:00
Brent Baude
048fced244 Fix Delete errors with images and containers
Fix a slew of issues related to deletion of images and containers.  Also
added --assume_yes to be consistent with other commands.  This will benefit
dbus interaction as well given that we do not want confirmation occuring
over dbus.

Issues that were fixed:
 * Proper catch and error for trying to delete all images|containers when no images|containers exist
 * Catch and error when no image|container is given by user and no --all
 * when --storage and --all are used, only images|containers in that backend are now deleted
 * when --all is given but not --storage, all images|containers from all backends are now deleted.
 * Fixed logical error when deleting containers
 * Deletion of images|containers now is consistent in its confirm and abort messages.

Added unittests.

Closes: #864
Approved by: rhatdan
2017-02-04 11:18:49 +00:00
Brent Baude
f79d56bd13 Disconnect backends
Ideally, the atomic CLI should be able to operate independently
of the backends it supports.  For example, if dockerd is inactive,
the ostree backend and atomic cli should still work.

This requires some tweaking to the backendutils code and the work
flow.  We also need to specifically know if the user passes
--storage so that we treat that as an explicit override.  The work
flow is now roughly:

* a default storage can be defined in atomic.conf (was always this way)
* if not defined, defaults to docker.
* if --storage is passed, treat explictly and fail if cannot execute
* if no --storage is specified, use default.  if default is not available, move
 onto the next backend.
2017-01-25 19:07:20 -06:00
Brent Baude
9ed159fe53 Atomic/delete.py: bz 1413887 Delete image fails
Under certain conditions when trying to delete an image, a exception
occured because obj.repotags is not populated as a list.  This is OK
but wasnt being handled correctly.  New conditionals to use obj.id when
this happens.

Closes: #837
Approved by: rhatdan
2017-01-18 15:05:06 +00:00
Alex Jia
7f630caff6 Atomic.delete: fix typos in delete_image()
To try to delete all of images, we will hit error like this
"local variable 'img_obj' referenced before assignment", in
fact, the variable should be 'del_obj', it's a typo.

Signed-off-by: Alex Jia <ajia@redhat.com>

Closes: #827
Approved by: rhatdan
2017-01-17 13:06:29 +00:00
Brent Baude
193a748d6d Add --all to images delete
To make containers delete and images delete consistent, we have
added an --all option to images delete.

Closes: #795
Approved by: rhatdan
2016-12-09 16:26:32 +00:00
Brent Baude
e405c6a048 Refactor containers verb
With the exception of fstrim, the containers verb has now been
refactored.  It primarily now uses the containers object in its
implementation.

Closes: #792
Approved by: rhatdan
2016-12-09 14:05:49 +00:00
Brent Baude
ef984ed066 Refactor images
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
2016-11-29 21:47:05 +00:00
yuqi-zhang
fb3779349e Add --storage option to image-related commands
Add an optional --storage flag to the following commands:
 - images delete
 - info
 - mount
 - verify
 - version

If specified, the command will only look at the specified storage
(ostree/docker) for the image to perform the action. If not
specified, the command will look through both ostree/docker for
the image (as it was before). However, if the storage is not
specified and the image exists in both ostree and docker, the
command will error and prompt the user to specify. Image inspection
also no longer forces the user to delete/rename one or the other.

This is meant to address the duplicate naming issue (where a user
can have an image in both ostree and docker with the same name).

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>

Closes: #720
Approved by: giuseppe
2016-10-24 09:27:00 +00:00
Giuseppe Scrivano
f596f1205a syscontainers: rename some functions
they are part of the class SystemContainers, do not repeat
system_container in the name.

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

Closes: #683
Approved by: rhatdan
2016-10-06 11:07:34 +00:00
Dan Walsh
c0256dcfe6 Implement dbus interface for atomic commands
Add missing interfaces.

Fix functions to return text, rather then displaying directly.

Change atomic_client.py to take input from command line. These args are translated into function calls in python.

Add tests scripts in tests/integration/dbus directory

Closes: #668
Approved by: rhatdan
2016-10-04 14:31:42 +00:00
Dan Walsh
7eb2af9c34 Remove --force option and use --assumeyes
atomic images delete --force

Should force the remove of images that are in use, not answer the prompt yes.

atomic -y|--assumeyes images delete foobar

Should force the answer to yes

Also lots of cleanups of the man page.
2016-09-09 08:54:25 -04:00
Dan Walsh
84cc530db2 Move subparser code to submodules.
cli setup should happen in the submodules, for submodules that exist.
Also fix alphabetic order of command verbs.

Closes: #564
Approved by: giuseppe
2016-08-30 10:52:48 +00:00
Giuseppe Scrivano
f0e86dcf34 delete: fix Docker images pruning with Python3
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #503
Approved by: cgwalters
2016-07-29 10:50:54 +00:00
Giuseppe Scrivano
f4282f0dba iQIcBAABAgAGBQJXl4HqAAoJECY9bfLhY+HqrLwP/R4HjkMURTKdkMVqfPFklTQd
DhhPRwdholRaXs192P0FFFPmLjNGB2VZzsNRpWhhNMt27Bkt8ivkxlcFW8OJoCmE
 3Fs/l9hAYgf5NvIUISIVNUxoN2vd5gIczgm5FH7ZNN4J4a3j9PX8dpzmz+kjzfUL
 ZZjhZdcfDnd/4rb4pDrZ248wprUlzLu0mLpm9qeUgnRZqSHfx1zvPu9VgIPMq+jK
 Bta7NVC4uVWv9tLd74KmTeGT/hfzbjfsmjutw+qdIsnp80xJ6jhvQx+VMhF6C/cN
 4f4GTV5B0t1i0Jc1vrgyfqyqCN5XpqTS1dgp8Bx80Pa36Eok1JmzGw0gsgJ/tpEE
 TiZTVe83EGDF/esZy2KfpnvAqIjoBRm/SuDMOHhQ8RnTfOmqY1eV0hQ1ZsfKyDUs
 6gHmYgOEv+EWUM0PqyZ3UfgbOjSS626u3JGPxBwVVdDbeeW3ptsST8FlEhB+6MXf
 +g0W8ho44NL7j/PN6c5mdIEIFvjwphQ8PCPKtGA2Uc489RMaHME1miMd4rl5hyBO
 ed5fKB4qp9DeC8VWIQEz0ALtj3u0UvSGYAXMlSlnvSnwl5tu8dw7xpGqiNJQEDni
 +FnBNuBwcn/6HsDDoBP6eeiMkA4uFUnsa50bJsUKiuTQM0DF7nc8Y6lrLVmK8Iur
 X0Q8d1mZ8psYHLzSh/bQ
 =blTC
 -----END PGP SIGNATURE-----

delete: support images from the OSTree repository

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

Closes: #497
Approved by: jlebon
2016-07-26 15:52:25 +00:00
Giuseppe Scrivano
c39386def8 iQIcBAABAgAGBQJXl4HAAAoJECY9bfLhY+HqMNMP/0brLgpIEbkkPN1BhdJhKj+H
RGXZRNUThJOSjAFdnRc+UZvNbuIfKT7CEW9yyo4fh9mtUxZi6UYRpywKMWxWaVDu
 qxOlaAHdYKJZUyt9sIC8Lx+63BomJH+LZXTVVs1UP5kZ4UaDPqypPxDXjgCulAJg
 6/vn3r16SEFqtX/1ehVOTbN+I4mdkich451I/oQtWHU4vD+fk/YPNXIOZTAhPq1E
 +nLoC2qsP1H6Xpvpdg8c6OB/d+yFiROpHqhAAWWfDdE/n/EoSZdvZT0OtNrCvEAn
 X5TQ/Z0rQfVR5/+CZj1H+w01mwcYMNkhLW14srz7SVGf+TpbtHQzItENiK380fSM
 jOlzmGbkaLORdTIDFOUCSwclHJ7dG00RDkpsE3Ou5TAzSIsu8MWg2Q++fYO0D1jw
 vsMSDtZs/UwPoQgXmEBOPuT0ySBESePjqUoCnY8lR4hLKpZKMmZ9hiZ+hOLaHrMu
 biGcUzXUOGfsV2UgOfR9XJ/ruBOT5LWCnYH6V3hgI0S/P5mhBuS+NvcUaF3n+3/g
 RiRkYxCVGe1qpoUQEEBUPJqngubr7QLnZj+85mfzC/Afj+ikwfKhMekfIQwObIGD
 hi3VDWt9tBZPn8tqR7CeQnlpHTxcHoojCMdE5T9NAbXaULIUzpAeMZ5BTyuQKsHD
 lQpDIBy7+V1UHruXQOs6
 =+yCq
 -----END PGP SIGNATURE-----

prune: always prune OSTree references

4abc3eb8c9 changed this to be done only
when there are Docker images that are pruned as well.  Change it back to
the previous behavior.

Closes: https://github.com/projectatomic/atomic/issues/496

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

Closes: #497
Approved by: jlebon
2016-07-26 15:52:25 +00:00
Jhon Honce
d8b1a5e08e Refactor to use util.write_* functions
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2016-07-25 12:57:36 -07:00
Jhon Honce
4abc3eb8c9 Refactor 'atomic images list --prune' to 'atomic images prune'
Update supporting files and tests

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #492
Approved by: rhatdan
2016-07-21 10:43:40 +00:00
Jhon Honce
eeac7339f7 Card container_security_114 - Add delete image support
* Add support for calling skopeo to delete v2 images from v2 registry
* Implement atomic images list --no-trunc
* Update documentation and bash tab expansion
* Cleanup code and comments
* Update integration tests

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #425
Approved by: rhatdan
2016-07-20 09:59:09 +00:00