[merged] Refactor containers verb#792
Conversation
| container.image_id = info['ImageID'] | ||
| container.created = info['Created'] | ||
| container.status = runtime['status'] | ||
| container.status = container.state = runtime['status'] |
There was a problem hiding this comment.
Why do we have container.status and container.state?
There was a problem hiding this comment.
Depending on how the struct information is gather (i.e. inspect vs containers), they have State and/or Status and they differ. In ostree, we set both to be the same and handle it.
Atomic/backendutils.py
Outdated
| format(img, ', '.join([x.backend for x in img_in_backends]))) | ||
|
|
||
| def get_backend_for_container(self, container, str_preferred_backend=None): | ||
| def get_backend_and_container(self, container, str_preferred_backend=None): |
There was a problem hiding this comment.
Confusing name of method. You are passing in "container" and returning con_obj. Either
container should be renamed to container_id, or function should be get_backend_and_container_object
| if con_obj: | ||
| container_in_backends.append((be, con_obj)) | ||
| if len(container_in_backends) == 1: | ||
| return container_in_backends[0] |
There was a problem hiding this comment.
i dont understand your question
There was a problem hiding this comment.
Function returns two objects. This seems to be returning 1?
There was a problem hiding this comment.
No, it returns an instance of the backend and a container object seen there on line 89.
Atomic/containers.py
Outdated
|
|
||
| class Containers(Atomic): | ||
|
|
||
| FILTERALES= {"container": "id", "image": "image_name", "command": "command", |
There was a problem hiding this comment.
Fixed, although that was the previous name as well. Now called FILTER_KEYWORDS
ba759fd to
3b55727
Compare
|
If tests pass, I will merge. |
6d566bd to
37131aa
Compare
With the exception of fstrim, the containers verb has now been refactored. It primarily now uses the containers object in its implementation.
37131aa to
a9b235c
Compare
|
@rhatdan looks like i got it this time. |
|
📌 Commit a9b235c has been approved by |
|
☀️ Test successful - status-atomicjenkins |
With the exception of fstrim, the containers verb has now been
refactored. It primarily now uses the containers object in its
implementation.