Closed
Description
Is your task related to a problem? Please describe
Related to #3078 and possibly to operator-framework/java-operator-sdk#830 modifications should not be directly made to passed in objects.
Describe the solution you'd like
Simply reverting the change is not quite enough. As the object could have been obtained from a cache that simply creates a narrow race condition. More than likely the only solution is to clone prior to making the modification. The impetus for that cloning is mitigated if cloning were enforced for any resource obtained by the informer cache.
Describe alternatives you've considered
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
fix fabric8io#3756 prevent modifications by standard operations to us…
fix fabric8io#3756 prevent modifications by standard operations to us…
shawkins commentedon Jan 19, 2022
Related to this, do we want another issue on write protecting the informer caches?
fix fabric8io#3756 prevent modifications by standard operations to us…
manusa commentedon Jan 19, 2022
Wasn't this something we discarded?
It's OK for me, but given the additional processing overhead, it should be something configurable.
shawkins commentedon Jan 19, 2022
That is the idea, to propose/collect possible solutions - that would be optional:
secrets().withImmutableStore().inform()
or
SharedInformer.getImmutableStore() - returns a store that returns copies.
Either could be implemented with a wrapper that clones or adding logic for storage functions - for example to hold just strings in memory.