YDBOPS-9722 fillMissingSections for ConfigMap on operator upgrade #210
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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