-
Notifications
You must be signed in to change notification settings - Fork 68
Description
I was taking a look at #496 and while testing the Catalog polling logic by pushing catalog updates, I noticed the Catalog would update but the resolution on the Operator would still fail. I found that the cached Catalog contents are likely not being updated due to
operator-controller/internal/catalogmetadata/cache/cache.go
Lines 86 to 91 in b5c6bc9
| if data, ok := fsc.cacheDataByCatalogName[catalog.Name]; ok { | |
| if catalog.Status.ResolvedSource.Image.Ref == data.ResolvedRef { | |
| fsc.mutex.RUnlock() | |
| return os.Open(cacheFilePath) | |
| } | |
| } |
In catalogd v0.8.0 the meaning of the Status.ResolvedSource.Image.Ref field changed and a new Status.ResolvedSource.Image.ResolvedRef field was added (see https://github.com/operator-framework/catalogd/pull/185/files#diff-e36279cce9b48e5f464ffa40cb649dc902d9a850d128b39796d351610ad1ffffR114-R123)
The fix for this bug should be a pretty straightforward change to use the Status.ResolvedSource.Image.ResolvedRef in place of Status.ResolvedSource.Image.Ref as the check above is always true if a Catalog has entered the cache and the image is unchanged so it misses when the resolved reference's SHA256 changes after polling has performed an update.