Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Catalog cache doesn't update when the Catalog changes #528

Closed
everettraven opened this issue Nov 8, 2023 · 0 comments · Fixed by #529
Closed

Bug: Catalog cache doesn't update when the Catalog changes #528

everettraven opened this issue Nov 8, 2023 · 0 comments · Fixed by #529
Assignees

Comments

@everettraven
Copy link
Contributor

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant