Please check the type of change your PR introduces:
[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, renaming)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] Documentation content changes
[ ] Other (please describe):
What is the current behavior?
In new versions of ydb-operator, the logic of configuration generation for Storage/Database objects has changed - the hosts section is generated by mutationWebhook and then paste into ConfigMap during resource synchronization. In previous versions of the operator, the hosts section was added at the stage of creating the ConfigMap https://github.com/ydb-platform/ydb-kubernetes-operator/blob/0.4.30/internal/resources/database.go#L84.
add a check for the presence of the hosts section before updating ConfigMap in Database/Storage objects to avoid broken configuration when updating versions of ydb-operator
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
In new versions of ydb-operator, the logic of configuration generation for Storage/Database objects has changed - the hosts section is generated by mutationWebhook and then paste into ConfigMap during resource synchronization. In previous versions of the operator, the hosts section was added at the stage of creating the ConfigMap https://github.com/ydb-platform/ydb-kubernetes-operator/blob/0.4.30/internal/resources/database.go#L84.
When user updating the version of the ydb-operator, the mutating/validating webhook is not executed (because they are processed by the k8s api server), and therefore the hosts section for .spec.configuration in the Database is not registered here https://github.com/ydb-platform/ydb-kubernetes-operator/blob/0.5.2/api/v1alpha1/database_webhook.go#L131-L148. Then Database object updates the ConfigMap without generated hosts section https://github.com/ydb-platform/ydb-kubernetes-operator/blob/0.5.2/internal/resources/database.go#L75-L86
Issue Number: YDBOPS-9722
What is the new behavior?
Other information