Pass watched Custom Resource to values mapper#93
Pass watched Custom Resource to values mapper#93SimonBaeumer wants to merge 2 commits intooperator-framework:mainfrom stackrox:add-cr-to-mapper-func
Conversation
|
Can you walk me through your use case? The idea here is that the input into the mapper is the spec of the object. Do you have mapping logic that looks at fields other than |
|
Thanks for your fast answer @joelanford!
Yes, we need to be able to read cluster state to read certain values - i.e. if a PVC already exists and this requires us to know the deployed namespace. This may exceed a Or do there another way to manipulate values before applying helm upgrade/install/uninstall? |
|
I saw the Translator implementation in your fork, which (I think?) addresses this. If so, I am in favor of replacing the Mapper with the Translator (or renaming the Translator to Mapper). As was mentioned in the PR comments, having both are duplicative since anyone implementing a custom Translator can perform any other necessary mapping that the mapper would have performed. One notable semantic change would be that all of the translation and mapping would happen before overrides are applied. This would make setting the overrides less ergonomic since mapped values may otherwise be an internal implementation detail of the operator. |
|
Closing in favor of #114 |
To map values from Custom Resources it is necessary to have access to the current reconciled CR inside the values mapper.