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 with a dependency fails to upgrade when a new parameter is introduced #1776
Comments
@alembiewski I confirm that I'm able to reproduce this; hopefully will come up with a fix proposal/PR in the near future. |
Now, parameters added by an OV upgrade (for example, when a new OV brings in a new required parameter with a default value) no longer trigger an update plan. This fixes kudobuilder#1776 Signed-off-by: Andrei Sekretenko <asekretenko@d2iq.com>
Now, parameters added by a new operator version (for example, when a new OV brings in a new required parameter with no default, so that it is necessary to set a value together with upgrade) no longer trigger an update plan. This fixes kudobuilder#1776 Signed-off-by: Andrei Sekretenko <asekretenko@d2iq.com>
Now, parameters added by a new operator version (for example, when a new OV brings in a new required parameter with no default, so that it is necessary to set a value together with upgrade) no longer trigger an update plan. This fixes kudobuilder#1776 Signed-off-by: Andrei Sekretenko <asekretenko@d2iq.com>
@alembiewski After trying to come up with a simpler test, I realized that the underlying issue is more general, and affects not only dependent operators. Currently, there is no way to upgrade an operator that has both dedicated upgrade and update plans, if the upgrade adds a required parameter without a default. One could imagine that such an update should be possible when a value for the new parameter is set together with update; however, If one tries to specify a value for the new parameter, this results in two conflicting plans being triggered. I fully agree with your suggestion that "update" should simply be not be triggered in this case, and hence this is a bug. IMO, it is quite logical that your example in this issue is also affected by this bug: as the parameter value in your example is pulled from the parent instance, the upgrade results not only in adding a parameter to dependency's OV, but also in adding a parameter to the instance of the dependency. Thus, my #1780 tries to address the bug I outlined above.
That's an interesting point, which probably should be a new issue. |
…1780) * Test adding a required no-default parameter on upgrade. Currently, an operator upgrade that brings in a new required parameter without a default, is impossible if the operator defines both "update" and "upgrade" plans. An upgrade without setting this parameter fails (which is a correct behaviour); however, an attempt to upgrade while setting the previously nonexistent parameter also fails due to both plans being triggered, regardless of the fact that no existing parameter is changed. This test verifies that an upgrade of such an operator is possible together with setting a value for the new required parameter, and that the plan chosen is "upgrade" and not "update". Signed-off-by: Andrei Sekretenko <asekretenko@d2iq.com> * Do not trigger an update when a parameter is added by an OV upgrade. Now, parameters added by a new operator version (for example, when a new OV brings in a new required parameter with no default, so that it is necessary to set a value together with upgrade) no longer trigger an update plan. This fixes #1776 Signed-off-by: Andrei Sekretenko <asekretenko@d2iq.com>
What happened: I developed a simple operator with a single dependency with the following structure:
Dependency operator exposes one single parameter, that could be updated via parent instance. Both operators have
deploy
,update
andupgrade
plans defined, making it possible to implement a custom operational behavior for each operation.The Initial deployment goes well:
Then let's say I want to extend my dependency and add another parameter and make it configurable via parent operator:
alembiewski/operator-with-dependencies@faa9037
When I'm trying to do an upgrade, the plan fails with the following error:
What you expected to happen:
Since I'm not changing any parameter value, but only adding a new one, it's not clear why the
update
plan gets triggered for the dependency in this case. I would expect KUDO to only trigger anupgrade
plan. And how the upgrade is going to work in case when the value of the existing parameters actually changes between the versions? What is the recomended way to perform upgrades in such cases?How to reproduce it (as minimally and precisely as possible):
0.0.1
version from alembiewski/operator-with-dependencies@c84b612Anything else we need to know?:
Environment:
kubectl version
):kubectl kudo version
):uname -a
):The text was updated successfully, but these errors were encountered: