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
[operator] variable corruption between roles when upgrading spec.version #6199
Comments
Here's a simple ansible test I used to illustrate what I believe is happening. This follows the basic layout of the kiali operator with a main playbook and two roles (role-one and role-two are analgous to kiali-remove and kiali-deploy roles in the operator). Run this:
results in:
And you see the kiali_vars from role-one does not corrupt the kiali_vars from role-two - that's because role-one doesn't set a fact called kiali_vars due to doit=false. But now run this:
results in:
Notice role-two lost external_services from kiali_vars and image_name came from role-one. This means role-one kiali_vars made it over to role-two, which is not what we want. Facts are global and exist across role invocations. So we need to make sure the one role doesn't set facts that corrupt facts in another role. |
When you upgrade a Kiali CR from one spec.version to another, the remove role is called and then the deploy role. If the remove role changes its kiali_vars, because facts are global, this will corrupt the kiali_vars expected in the deploy role.
I think the solution is to have a different global fact name in the remove role so it doesn't have the same name as the deploy role (this means rename
kiali_vars
in the remove role to something likekiali_vars_remove
).see https://issues.redhat.com/browse/OSSM-4009
The text was updated successfully, but these errors were encountered: