Bug 1488072 - [RFE] Reconnect container images when seen again
Summary: [RFE] Reconnect container images when seen again
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: GA
: 5.9.0
Assignee: Loic Avenel
QA Contact: brahmani
URL:
Whiteboard: container
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-04 09:05 UTC by Beni Paskin-Cherniavsky
Modified: 2018-04-09 11:54 UTC (History)
7 users (show)

Fixed In Version: 5.9.0.7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-01 13:16:52 UTC
Category: ---
Cloudforms Team: Container Management
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:0380 0 normal SHIPPED_LIVE Moderate: Red Hat CloudForms security, bug fix, and enhancement update 2018-03-01 18:37:12 UTC

Description Beni Paskin-Cherniavsky 2017-09-04 09:05:27 UTC
https://github.com/ManageIQ/manageiq-providers-kubernetes/issues/103

Description of problem:
If refresh archives a container image record and later refresh encounters same image again, we create a duplicate record.  This can be confusing in reports.
May have other side effect, like repeated image scanning.

Version-Release number of selected component (if applicable):
Ever since we archive images.

We don't see this much when images come from openshift registry, as these stay around for a long time.
Scenarios where we may disconnect an image not currently used in any container:

- a Kubernetes provider
- Openshift provider that run images from external registries
- Openshift dropping the image from /oapi/v1/images e.g. by [pruning](https://docs.openshift.org/latest/admin_guide/pruning_resources.html#pruning-images)
- Openshift configured get_container_images: false (https://github.com/ManageIQ/manageiq/pull/14606)
- Openshift configured store_unused_images: false (https://github.com/ManageIQ/manageiq-providers-openshift/pull/9)
- Openshift fetching used images one by one (if https://github.com/ManageIQ/manageiq/pull/14628 gets revived)


Steps to Reproduce (one of above scenarios):
1. create pod with an image from an external registry (e.g. docker hub)
2. refresh the provider => a ContainerImage record is created
3. delete the pod(s) that run it
4. refresh the provider => the ContainerImage is archived
5. create pod with same image
6. refresh the provider => a 2nd ContainerImage record is created with same digest, image_ref etc.

Expected results:
both ContainerGroup-s should link to one ContainerImage record


Additional info:
Fixing this in old save_inventory refresh would have unacceptable performance price, according to discussion on https://github.com/ManageIQ/manageiq/pull/14808
Graph refresh *might* be cheaper.

Comment 2 Dave Johnson 2017-09-04 09:46:30 UTC
Please assess the impact of this issue and update the severity accordingly.  Please refer to https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity for a reminder on each severity's definition.

If it's something like a tracker bug where it doesn't matter, please set it to Low/Low.

Comment 4 Beni Paskin-Cherniavsky 2017-11-19 13:52:49 UTC
I think this recently got fixed by
https://github.com/ManageIQ/manageiq-providers-kubernetes/pull/145
Ladislav, can this be moved to POST?

Comment 5 Ladislav Smola 2017-11-20 07:50:03 UTC
Yes this is fixed by https://github.com/ManageIQ/manageiq-providers-kubernetes/pull/145 , but only for new (graph) refresh.

Comment 8 brahmani 2017-12-04 11:57:06 UTC
verified on 5.9.0.11.20171127204214_e316988;
both ContainerGroup-s link to same ContainerImage image ref record

Comment 11 errata-xmlrpc 2018-03-01 13:16:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0380


Note You need to log in before you can comment on or make changes to this bug.