Skip to content

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

@everettraven

Description

@everettraven

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions