Closed oleksiytsyban closed 7 months ago
Didn't manage to find where is the error exactly. Requires further investigation.
It is not an error, it is just how it works. It checks deployments one by one and if Replicas = 0 then removes an image from the checklist. So if there are two deployments with the same image (canary deployment is an example) the first one can have Replicas = 1 and the image added to the checklist and the second can have Replicas = 0 and the image removed from the checklist. So we are not checking for the image despite it is in use.
I was searching for the piece of code where the exporter removes an image
, but didn't manage to find it.
The exporter collects all containers with their controller references for the given image.
controllerWithContainerInfos
contains controller metadata fields.
https://github.com/deckhouse/k8s-image-availability-exporter/blob/210abc0c05f55dc4ae286da6ed0c32936667e667/pkg/registry/indexers.go#L36-L43
I think the behavior you are speaking about was fixed in the scope of this mysterious PR https://github.com/deckhouse/k8s-image-availability-exporter/pull/67
Yes, indeed the code I was talking about removed here: https://github.com/deckhouse/k8s-image-availability-exporter/pull/67/files#diff-72bfae920914f6e9789199b940ce1a9f3eb84125226bbb9b10db92174ff933dbL213-L227
I will test the latest version. Looks like the issue is resolved. Thank you.
Tested with 0.10.1. Works fine. This issue is fixed. Thank you.
If there are several deployments with same image and at least one of them has Replicas = 0 there is a good chance of removing this image from checking list. rc.imageStore.ReconcileImage does not check for other deployments with same image.